Xerces-C++: XSNamespaceItem.hpp Source File

Xerces-C++ 3.3.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$
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
43class XSAnnotation;
44class XSAttributeDeclaration;
45class XSAttributeGroupDefinition;
46class XSElementDeclaration;
47class XSModelGroupDefinition;
48class XSNotationDeclaration;
49class XSTypeDefinition;
50class SchemaGrammar;
51class XSModel;
52
53 class XMLPARSER_EXPORT XSNamespaceItem : public XMemory
54{
55public:
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
183private:
184
185 // -----------------------------------------------------------------------
186 // Unimplemented constructors and operators
187 // -----------------------------------------------------------------------
188 XSNamespaceItem(const XSNamespaceItem&);
189 XSNamespaceItem & operator=(const XSNamespaceItem &);
190
191protected:
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
PlatformUtils.hpp
XSAnnotationList
RefVectorOf< XSAnnotation > XSAnnotationList
Definition XSConstants.hpp:47
StringList
RefArrayVectorOf< XMLCh > StringList
Definition XSConstants.hpp:54
XSNamedMap.hpp
XSObject.hpp
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition XercesDefs.hpp:163
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
XMLCh
char16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
MemoryManager
Configurable memory manager.
Definition MemoryManager.hpp:40
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition PlatformUtils.hpp:121
XMemory
This class makes it possible to override the C++ memory management by adding new/delete operators to ...
Definition XMemory.hpp:41
XSAnnotation
Definition XSAnnotation.hpp:42
XSAttributeDeclaration
Definition XSAttributeDeclaration.hpp:43
XSAttributeGroupDefinition
Definition XSAttributeGroupDefinition.hpp:43
XSConstants::COMPONENT_TYPE
COMPONENT_TYPE
Definition XSConstants.hpp:61
XSConstants::MULTIVALUE_FACET
@ MULTIVALUE_FACET
The object describes enumeration/pattern facets.
Definition XSConstants.hpp:118
XSElementDeclaration
Definition XSElementDeclaration.hpp:45
XSModelGroupDefinition
Definition XSModelGroupDefinition.hpp:43
XSModel
Definition XSModel.hpp:60
XSNamedMap
Definition XSNamedMap.hpp:41
XSNamespaceItem
Definition XSNamespaceItem.hpp:54
XSNamespaceItem::getAttributeDeclaration
XSAttributeDeclaration * getAttributeDeclaration(const XMLCh *name)
Convenience method.
XSNamespaceItem::getNotationDeclaration
XSNotationDeclaration * getNotationDeclaration(const XMLCh *name)
Convenience method.
XSNamespaceItem::getModelGroupDefinition
XSModelGroupDefinition * getModelGroupDefinition(const XMLCh *name)
Convenience method.
XSNamespaceItem::~XSNamespaceItem
~XSNamespaceItem()
XSNamespaceItem::XSNamespaceItem
XSNamespaceItem(XSModel *const xsModel, const XMLCh *const schemaNamespace, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
XSNamespaceItem::getComponents
XSNamedMap< XSObject > * getComponents(XSConstants::COMPONENT_TYPE objectType)
[schema components]: a list of top-level components, i.e.
XSNamespaceItem::fSchemaNamespace
const XMLCh * fSchemaNamespace
Definition XSNamespaceItem.hpp:223
XSNamespaceItem::fMemoryManager
MemoryManager *const fMemoryManager
Definition XSNamespaceItem.hpp:199
XSNamespaceItem::fGrammar
SchemaGrammar * fGrammar
Definition XSNamespaceItem.hpp:200
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
XSNamespaceItem::getAnnotations
XSAnnotationList * getAnnotations()
[annotations]: a set of annotations.
Definition XSNamespaceItem.hpp:226
XSNamespaceItem::fXSModel
XSModel * fXSModel
Definition XSNamespaceItem.hpp:201
XSNamespaceItem::getTypeDefinition
XSTypeDefinition * getTypeDefinition(const XMLCh *name)
Convenience method.
XSNamespaceItem::getElementDeclaration
XSElementDeclaration * getElementDeclaration(const XMLCh *name)
Convenience method.
XSNamespaceItem::getDocumentLocations
const StringList * getDocumentLocations()
[document location] - a list of locations URI for the documents that contributed to the XSModel.
XSNamespaceItem::getAttributeGroup
XSAttributeGroupDefinition * getAttributeGroup(const XMLCh *name)
Convenience method.
XSNamespaceItem::fXSAnnotationList
XSAnnotationList * fXSAnnotationList
Definition XSNamespaceItem.hpp:221
XSNamespaceItem::XSNamespaceItem
XSNamespaceItem(XSModel *const xsModel, SchemaGrammar *const grammar, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.
XSNotationDeclaration
Definition XSNotationDeclaration.hpp:41
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition XSTypeDefinition.hpp:40