Xerces-C++ 3.2.5

XSComplexTypeDefinition.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_XSCOMPLEXTYPEDEFINITION_HPP)
23#define XERCESC_INCLUDE_GUARD_XSCOMPLEXTYPEDEFINITION_HPP
24
25#include <xercesc/framework/psvi/XSTypeDefinition.hpp>
26
27 XERCES_CPP_NAMESPACE_BEGIN
28
37// forward declarations
38 class XSAnnotation;
39 class XSAttributeUse;
40 class XSSimpleTypeDefinition;
41 class XSParticle;
42 class XSWildcard;
43 class ComplexTypeInfo;
44
45 class XMLPARSER_EXPORT XSComplexTypeDefinition : public XSTypeDefinition
46{
47 public:
48
49 // Content Model Types
50 enum CONTENT_TYPE {
56 CONTENTTYPE_EMPTY = 0,
61 CONTENTTYPE_SIMPLE = 1,
67 CONTENTTYPE_ELEMENT = 2,
71 CONTENTTYPE_MIXED = 3
72 };
73
74 // Constructors and Destructor
75 // -----------------------------------------------------------------------
78
92 XSComplexTypeDefinition
93 (
94 ComplexTypeInfo* const complexTypeInfo
95 , XSWildcard* const xsWildcard
96 , XSSimpleTypeDefinition* const xsSimpleType
97 , XSAttributeUseList* const xsAttList
98 , XSTypeDefinition* const xsBaseType
99 , XSParticle* const xsParticle
100 , XSAnnotation* const headAnnot
101 , XSModel* const xsModel
102 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
103 );
104
106
109 ~XSComplexTypeDefinition();
111
112 //---------------------
116
122 XSConstants::DERIVATION_TYPE getDerivationMethod() const;
123
129 bool getAbstract() const;
130
134 XSAttributeUseList *getAttributeUses();
135
139 XSWildcard *getAttributeWildcard() const;
140
147 CONTENT_TYPE getContentType() const;
148
153 XSSimpleTypeDefinition *getSimpleType() const;
154
159 XSParticle *getParticle() const;
160
168 bool isProhibitedSubstitution(XSConstants::DERIVATION_TYPE toTest);
169
175 short getProhibitedSubstitutions() const;
176
180 XSAnnotationList *getAnnotations();
181
186 const XMLCh* getName() const;
187
192 const XMLCh* getNamespace() const;
193
199 XSNamespaceItem *getNamespaceItem();
200
205 bool getAnonymous() const;
206
211 XSTypeDefinition *getBaseType();
212
220 bool derivedFromType(const XSTypeDefinition* const ancestorType);
221
223
224 //----------------------------------
228
229
231
232 private:
233
237 void setBaseType(XSTypeDefinition* const xsBaseType);
238 friend class XSObjectFactory;
239
240 // -----------------------------------------------------------------------
241 // Unimplemented constructors and operators
242 // -----------------------------------------------------------------------
243 XSComplexTypeDefinition(const XSComplexTypeDefinition&);
244 XSComplexTypeDefinition & operator=(const XSComplexTypeDefinition &);
245
246 protected:
247
248 // -----------------------------------------------------------------------
249 // data members
250 // -----------------------------------------------------------------------
251 ComplexTypeInfo* fComplexTypeInfo;
252 XSWildcard* fXSWildcard;
253 XSAttributeUseList* fXSAttributeUseList;
254 XSSimpleTypeDefinition* fXSSimpleTypeDefinition;
255 XSAnnotationList* fXSAnnotationList;
256 XSParticle* fParticle;
257 short fProhibitedSubstitution;
258};
259
260
261 inline XSAttributeUseList* XSComplexTypeDefinition::getAttributeUses()
262{
263 return fXSAttributeUseList;
264}
265
266 inline XSWildcard* XSComplexTypeDefinition::getAttributeWildcard() const
267{
268 return fXSWildcard;
269}
270
271 inline XSSimpleTypeDefinition* XSComplexTypeDefinition::getSimpleType() const
272{
273 return fXSSimpleTypeDefinition;
274}
275
276 inline short XSComplexTypeDefinition::getProhibitedSubstitutions() const
277{
278 return fProhibitedSubstitution;
279}
280
281 inline XSParticle *XSComplexTypeDefinition::getParticle() const
282{
283 return fParticle;
284}
285
286 inline void
287XSComplexTypeDefinition::setBaseType(XSTypeDefinition* const xsBaseType)
288{
289 fBaseType = xsBaseType;
290}
291
292 XERCES_CPP_NAMESPACE_END
293
294#endif
XSAnnotationList
RefVectorOf< XSAnnotation > XSAnnotationList
Definition XSConstants.hpp:47
XSAttributeUseList
RefVectorOf< XSAttributeUse > XSAttributeUseList
Definition XSConstants.hpp:48
XSTypeDefinition.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
uint16_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
XSAnnotation
Definition XSAnnotation.hpp:42
XSAttributeUse
Definition XSAttributeUse.hpp:40
XSComplexTypeDefinition
Definition XSComplexTypeDefinition.hpp:46
XSComplexTypeDefinition::getAnnotations
XSAnnotationList * getAnnotations()
A set of [annotations].
XSComplexTypeDefinition::fXSSimpleTypeDefinition
XSSimpleTypeDefinition * fXSSimpleTypeDefinition
Definition XSComplexTypeDefinition.hpp:254
XSComplexTypeDefinition::getDerivationMethod
XSConstants::DERIVATION_TYPE getDerivationMethod() const
[derivation method]: either DERIVATION_EXTENSION, DERIVATION_RESTRICTION, or DERIVATION_NONE (see XSO...
XSComplexTypeDefinition::XSComplexTypeDefinition
XSComplexTypeDefinition(ComplexTypeInfo *const complexTypeInfo, XSWildcard *const xsWildcard, XSSimpleTypeDefinition *const xsSimpleType, XSAttributeUseList *const xsAttList, XSTypeDefinition *const xsBaseType, XSParticle *const xsParticle, XSAnnotation *const headAnnot, XSModel *const xsModel, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.
XSComplexTypeDefinition::derivedFromType
bool derivedFromType(const XSTypeDefinition *const ancestorType)
Convenience method: check if this type is derived from the given ancestorType.
XSComplexTypeDefinition::fXSWildcard
XSWildcard * fXSWildcard
Definition XSComplexTypeDefinition.hpp:252
XSComplexTypeDefinition::fParticle
XSParticle * fParticle
Definition XSComplexTypeDefinition.hpp:256
XSComplexTypeDefinition::getProhibitedSubstitutions
short getProhibitedSubstitutions() const
[prohibited substitutions]: A subset of {extension, restriction} or DERIVATION_NONE represented as a ...
Definition XSComplexTypeDefinition.hpp:276
XSComplexTypeDefinition::getSimpleType
XSSimpleTypeDefinition * getSimpleType() const
A simple type definition corresponding to simple content model, otherwise null
Definition XSComplexTypeDefinition.hpp:271
XSComplexTypeDefinition::CONTENT_TYPE
CONTENT_TYPE
Definition XSComplexTypeDefinition.hpp:50
XSComplexTypeDefinition::getAttributeWildcard
XSWildcard * getAttributeWildcard() const
Optional.An attribute wildcard.
Definition XSComplexTypeDefinition.hpp:266
XSComplexTypeDefinition::getNamespace
const XMLCh * getNamespace() const
The [target namespace] of this object, or null if it is unspecified.
XSComplexTypeDefinition::getContentType
CONTENT_TYPE getContentType() const
[content type]: one of empty (CONTENTTYPE_EMPTY), a simple type definition (CONTENTTYPE_SIMPLE),...
XSComplexTypeDefinition::getAbstract
bool getAbstract() const
[abstract]: a boolean.
XSComplexTypeDefinition::fComplexTypeInfo
ComplexTypeInfo * fComplexTypeInfo
Definition XSComplexTypeDefinition.hpp:251
XSComplexTypeDefinition::getName
const XMLCh * getName() const
The name of type NCName of this declaration as defined in XML Namespaces.
XSComplexTypeDefinition::fProhibitedSubstitution
short fProhibitedSubstitution
Definition XSComplexTypeDefinition.hpp:257
XSComplexTypeDefinition::isProhibitedSubstitution
bool isProhibitedSubstitution(XSConstants::DERIVATION_TYPE toTest)
[prohibited substitutions]: a subset of {extension, restriction}
XSComplexTypeDefinition::getAnonymous
bool getAnonymous() const
A boolean that specifies if the type definition is anonymous.
XSComplexTypeDefinition::getParticle
XSParticle * getParticle() const
A particle for mixed or element-only content model, otherwise null
Definition XSComplexTypeDefinition.hpp:281
XSComplexTypeDefinition::getAttributeUses
XSAttributeUseList * getAttributeUses()
A set of attribute uses.
Definition XSComplexTypeDefinition.hpp:261
XSComplexTypeDefinition::getNamespaceItem
XSNamespaceItem * getNamespaceItem()
A namespace schema information item corresponding to the target namespace of the component,...
XSComplexTypeDefinition::~XSComplexTypeDefinition
~XSComplexTypeDefinition()
XSComplexTypeDefinition::getBaseType
XSTypeDefinition * getBaseType()
{base type definition}: either a simple type definition or a complex type definition.
XSComplexTypeDefinition::fXSAnnotationList
XSAnnotationList * fXSAnnotationList
Definition XSComplexTypeDefinition.hpp:255
XSComplexTypeDefinition::fXSAttributeUseList
XSAttributeUseList * fXSAttributeUseList
Definition XSComplexTypeDefinition.hpp:253
XSConstants::DERIVATION_TYPE
DERIVATION_TYPE
Definition XSConstants.hpp:122
XSModel
Definition XSModel.hpp:60
XSNamespaceItem
Definition XSNamespaceItem.hpp:54
XSParticle
Definition XSParticle.hpp:42
XSSimpleTypeDefinition
Definition XSSimpleTypeDefinition.hpp:44
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition XSTypeDefinition.hpp:40
XSTypeDefinition::fBaseType
XSTypeDefinition * fBaseType
Definition XSTypeDefinition.hpp:198
XSWildcard
Definition XSWildcard.hpp:42