2 * Licensed to the University Corporation for Advanced Internet
3 * Development, Inc. (UCAID) under one or more contributor license
4 * agreements. See the NOTICE file distributed with this work for
5 * additional information regarding copyright ownership.
7 * UCAID licenses this file to you under the Apache License,
8 * Version 2.0 (the "License"); you may not use this file except
9 * in compliance with the License. You may obtain a copy of the
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17 * either express or implied. See the License for the specific
18 * language governing permissions and limitations under the License.
22 * @file xmltooling/AbstractAttributeExtensibleXMLObject.h
24 * AbstractXMLObject mixin that implements AttributeExtensibleXMLObject
27 #ifndef __xmltooling_absattrextxmlobj_h__
28 #define __xmltooling_absattrextxmlobj_h__
30 #include <xmltooling/AbstractXMLObject.h>
31 #include <xmltooling/AttributeExtensibleXMLObject.h>
35 #if defined (_MSC_VER)
36 #pragma warning( push )
37 #pragma warning( disable : 4250 4251 )
40 namespace xmltooling {
43 * AbstractXMLObject mixin that implements AttributeExtensibleXMLObject.
44 * Inherit from this class to add support for attribute wildcarding.
46 class XMLTOOL_API AbstractAttributeExtensibleXMLObject
47 : public virtual AttributeExtensibleXMLObject, public virtual AbstractXMLObject
50 virtual ~AbstractAttributeExtensibleXMLObject();
52 // Virtual function overrides.
53 const XMLCh* getAttribute(const QName& qualifiedName) const;
54 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false);
55 const std::map<QName,XMLCh*>& getExtensionAttributes() const;
56 const XMLCh* getXMLID() const;
57 const XMLCh* getLang() const;
60 AbstractAttributeExtensibleXMLObject();
62 /** Copy constructor. */
63 AbstractAttributeExtensibleXMLObject(const AbstractAttributeExtensibleXMLObject& src);
66 * Assists in the unmarshalling of extension attributes.
68 * @param attribute the DOM attribute node being unmarshalled
70 void unmarshallExtensionAttribute(const xercesc::DOMAttr* attribute);
73 * Assists in the marshalling of extension attributes.
75 * @param domElement the DOM element against which to marshall the attributes
77 void marshallExtensionAttributes(xercesc::DOMElement* domElement) const;
80 /** Map of arbitrary attributes. */
81 std::map<QName,XMLCh*> m_attributeMap;
83 /** Points to the last attribute designated as an XML ID. */
84 std::map<QName,XMLCh*>::const_iterator m_idAttribute;
89 #if defined (_MSC_VER)
90 #pragma warning( pop )
93 #endif /* __xmltooling_absattrextxmlobj_h__ */