2 * Copyright 2001-2009 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file xmltooling/AbstractAttributeExtensibleXMLObject.h
20 * AbstractXMLObject mixin that implements AttributeExtensibleXMLObject
23 #ifndef __xmltooling_absattrextxmlobj_h__
24 #define __xmltooling_absattrextxmlobj_h__
26 #include <xmltooling/AbstractXMLObject.h>
27 #include <xmltooling/AttributeExtensibleXMLObject.h>
31 #if defined (_MSC_VER)
32 #pragma warning( push )
33 #pragma warning( disable : 4250 4251 )
36 namespace xmltooling {
39 * AbstractXMLObject mixin that implements AttributeExtensibleXMLObject.
40 * Inherit from this class to add support for attribute wildcarding.
42 class XMLTOOL_API AbstractAttributeExtensibleXMLObject
43 : public virtual AttributeExtensibleXMLObject, public virtual AbstractXMLObject
46 virtual ~AbstractAttributeExtensibleXMLObject();
48 // Virtual function overrides.
49 const XMLCh* getAttribute(const QName& qualifiedName) const;
50 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false);
51 const std::map<QName,XMLCh*>& getExtensionAttributes() const;
52 const XMLCh* getXMLID() const;
55 AbstractAttributeExtensibleXMLObject();
57 /** Copy constructor. */
58 AbstractAttributeExtensibleXMLObject(const AbstractAttributeExtensibleXMLObject& src);
61 * Assists in the unmarshalling of extension attributes.
63 * @param attribute the DOM attribute node being unmarshalled
65 void unmarshallExtensionAttribute(const xercesc::DOMAttr* attribute);
68 * Assists in the marshalling of extension attributes.
70 * @param domElement the DOM element against which to marshall the attributes
72 void marshallExtensionAttributes(xercesc::DOMElement* domElement) const;
75 /** Map of arbitrary attributes. */
76 std::map<QName,XMLCh*> m_attributeMap;
78 /** Points to the last attribute designated as an XML ID. */
79 std::map<QName,XMLCh*>::const_iterator m_idAttribute;
84 #if defined (_MSC_VER)
85 #pragma warning( pop )
88 #endif /* __xmltooling_absattrextxmlobj_h__ */