Xerces-C++ 3.2.0

XSNamespaceItem.hpp
Go to the documentation of this file.
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18 /*
19 * $Id: XSNamespaceItem.hpp 527149 2007-04-10 14:56:39Z amassari $
20 */
21
22 #if !defined(XERCESC_INCLUDE_GUARD_XSNAMESPACEITEM_HPP)
23 #define XERCESC_INCLUDE_GUARD_XSNAMESPACEITEM_HPP
24
25 #include <xercesc/util/PlatformUtils.hpp>
26 #include <xercesc/framework/psvi/XSObject.hpp>
27 #include <xercesc/framework/psvi/XSNamedMap.hpp>
28
29 XERCES_CPP_NAMESPACE_BEGIN
30
42 // forward declarations
43 class XSAnnotation;
44 class XSAttributeDeclaration;
45 class XSAttributeGroupDefinition;
46 class XSElementDeclaration;
47 class XSModelGroupDefinition;
48 class XSNotationDeclaration;
49 class XSTypeDefinition;
50 class SchemaGrammar;
51 class XSModel;
52
53 class XMLPARSER_EXPORT XSNamespaceItem : public XMemory
54 {
55 public:
56
57 // Constructors and Destructor
58 // -----------------------------------------------------------------------
61
69 XSNamespaceItem
70 (
71 XSModel* const xsModel
72 , SchemaGrammar* const grammar
73 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
74 );
75
76 XSNamespaceItem
77 (
78 XSModel* const xsModel
79 , const XMLCh* const schemaNamespace
80 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
81 );
82
84
87 ~XSNamespaceItem();
89
90 //---------------------
94
99 const XMLCh *getSchemaNamespace() const;
100
111 XSNamedMap<XSObject> *getComponents(XSConstants::COMPONENT_TYPE objectType);
112
116 XSAnnotationList *getAnnotations();
117 const XSAnnotationList *getAnnotations() const;
118
125 XSElementDeclaration *getElementDeclaration(const XMLCh *name);
126
133 XSAttributeDeclaration *getAttributeDeclaration(const XMLCh *name);
134
142 XSTypeDefinition *getTypeDefinition(const XMLCh *name);
143
150 XSAttributeGroupDefinition *getAttributeGroup(const XMLCh *name);
151
158 XSModelGroupDefinition *getModelGroupDefinition(const XMLCh *name);
159
166 XSNotationDeclaration *getNotationDeclaration(const XMLCh *name);
167
172 const StringList *getDocumentLocations();
173
175
176 //----------------------------------
180
181
183 private:
184
185 // -----------------------------------------------------------------------
186 // Unimplemented constructors and operators
187 // -----------------------------------------------------------------------
188 XSNamespaceItem(const XSNamespaceItem&);
189 XSNamespaceItem & operator=(const XSNamespaceItem &);
190
191 protected:
192 friend class XSModel;
193 friend class XSObjectFactory;
194 // -----------------------------------------------------------------------
195 // data members
196 // -----------------------------------------------------------------------
197 // fMemoryManager:
198 // used for any memory allocations
199 MemoryManager* const fMemoryManager;
200 SchemaGrammar* fGrammar;
201 XSModel* fXSModel;
202
203 /* Need a XSNamedMap for each component top-level?
204 that is top level.
205 ATTRIBUTE_DECLARATION = 1,
206 ELEMENT_DECLARATION = 2,
207 TYPE_DEFINITION = 3,
208 ATTRIBUTE_USE = 4, no
209 ATTRIBUTE_GROUP_DEFINITION= 5,
210 MODEL_GROUP_DEFINITION = 6,
211 MODEL_GROUP = 7, no
212 PARTICLE = 8, no
213 WILDCARD = 9, no
214 IDENTITY_CONSTRAINT = 10, no
215 NOTATION_DECLARATION = 11,
216 ANNOTATION = 12, no
217 FACET = 13, no
218 MULTIVALUE_FACET = 14 no
219 */
220 XSNamedMap<XSObject>* fComponentMap[XSConstants::MULTIVALUE_FACET];
221 XSAnnotationList* fXSAnnotationList;
222 RefHashTableOf<XSObject>* fHashMap[XSConstants::MULTIVALUE_FACET];
223 const XMLCh* fSchemaNamespace;
224 };
225
226 inline XSAnnotationList* XSNamespaceItem::getAnnotations()
227 {
228 return fXSAnnotationList;
229 }
230
231 inline const XSAnnotationList* XSNamespaceItem::getAnnotations() const
232 {
233 return fXSAnnotationList;
234 }
235
236 inline const XMLCh *XSNamespaceItem::getSchemaNamespace() const
237 {
238 return fSchemaNamespace;
239 }
240
241
242
243 XERCES_CPP_NAMESPACE_END
244
245 #endif
XSNamespaceItem::fSchemaNamespace
const XMLCh * fSchemaNamespace
Definition: XSNamespaceItem.hpp:223
XMemory
This class makes it possible to override the C++ memory management by adding new/delete operators to ...
Definition: XMemory.hpp:40
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition: PlatformUtils.hpp:121
XSAttributeGroupDefinition
Definition: XSAttributeGroupDefinition.hpp:42
XSNamespaceItem
Definition: XSNamespaceItem.hpp:53
XSElementDeclaration
Definition: XSElementDeclaration.hpp:44
XSNamespaceItem::getSchemaNamespace
const XMLCh * getSchemaNamespace() const
[schema namespace]: A namespace name or null corresponding to the target namespace of the schema docu...
Definition: XSNamespaceItem.hpp:236
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
XSModel
Definition: XSModel.hpp:59
XSNamespaceItem::fXSModel
XSModel * fXSModel
Definition: XSNamespaceItem.hpp:201
XSAnnotation
Definition: XSAnnotation.hpp:41
XSNamedMap.hpp
PlatformUtils.hpp
MemoryManager
Configurable memory manager.
Definition: MemoryManager.hpp:39
XSNotationDeclaration
Definition: XSNotationDeclaration.hpp:40
XSNamespaceItem::fGrammar
SchemaGrammar * fGrammar
Definition: XSNamespaceItem.hpp:200
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:118
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
XSNamespaceItem::fMemoryManager
MemoryManager *const fMemoryManager
Definition: XSNamespaceItem.hpp:199
StringList
RefArrayVectorOf< XMLCh > StringList
Definition: XSConstants.hpp:54
XSNamespaceItem::fXSAnnotationList
XSAnnotationList * fXSAnnotationList
Definition: XSNamespaceItem.hpp:221
XSNamespaceItem::getAnnotations
XSAnnotationList * getAnnotations()
[annotations]: a set of annotations.
Definition: XSNamespaceItem.hpp:226
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
XSObject.hpp
XSConstants::COMPONENT_TYPE
COMPONENT_TYPE
Definition: XSConstants.hpp:61
XSNamedMap< XSObject >
XSAnnotationList
RefVectorOf< XSAnnotation > XSAnnotationList
Definition: XSConstants.hpp:41
XSConstants::MULTIVALUE_FACET
The object describes enumeration/pattern facets.
Definition: XSConstants.hpp:118
XSModelGroupDefinition
Definition: XSModelGroupDefinition.hpp:42
XSAttributeDeclaration
Definition: XSAttributeDeclaration.hpp:42
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition: XSTypeDefinition.hpp:39