Xerces-C++ 3.2.5

XSElementDeclaration.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_XSELEMENTDECLARATION_HPP)
23#define XERCESC_INCLUDE_GUARD_XSELEMENTDECLARATION_HPP
24
25#include <xercesc/framework/psvi/XSObject.hpp>
26#include <xercesc/framework/psvi/XSNamedMap.hpp>
27
28 XERCES_CPP_NAMESPACE_BEGIN
29
37// forward declarations
38 class XSAnnotation;
39 class XSComplexTypeDefinition;
40 class XSIDCDefinition;
41 class XSTypeDefinition;
42 class SchemaElementDecl;
43
44 class XMLPARSER_EXPORT XSElementDeclaration : public XSObject
45{
46 public:
47
48 // Constructors and Destructor
49 // -----------------------------------------------------------------------
52
66 XSElementDeclaration
67 (
68 SchemaElementDecl* const schemaElementDecl
69 , XSTypeDefinition* const typeDefinition
70 , XSElementDeclaration* const substitutionGroupAffiliation
71 , XSAnnotation* const annot
72 , XSNamedMap<XSIDCDefinition>* const identityConstraints
73 , XSModel* const xsModel
74 , XSConstants::SCOPE elemScope = XSConstants::SCOPE_ABSENT
75 , XSComplexTypeDefinition* const enclosingTypeDefinition = 0
76 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
77 );
78
80
83 ~XSElementDeclaration();
85
86 //---------------------
90
95 const XMLCh* getName() const;
96
101 const XMLCh* getNamespace() const;
102
108 XSNamespaceItem *getNamespaceItem();
109
111
112 //---------------------
116
121 XSTypeDefinition *getTypeDefinition() const;
122
128 XSConstants::SCOPE getScope() const;
129
134 XSComplexTypeDefinition *getEnclosingCTDefinition() const;
135
139 XSConstants::VALUE_CONSTRAINT getConstraintType() const;
140
145 const XMLCh *getConstraintValue();
146
155 bool getNillable() const;
156
160 XSNamedMap <XSIDCDefinition> *getIdentityConstraints();
161
166 XSElementDeclaration *getSubstitutionGroupAffiliation() const;
167
177 bool isSubstitutionGroupExclusion(XSConstants::DERIVATION_TYPE exclusion);
178
185 short getSubstitutionGroupExclusions() const;
186
197 bool isDisallowedSubstitution(XSConstants::DERIVATION_TYPE disallowed);
198
206 short getDisallowedSubstitutions() const;
207
211 bool getAbstract() const;
212
216 XSAnnotation *getAnnotation() const;
217
219
220 //----------------------------------
224
225 void setTypeDefinition(XSTypeDefinition* typeDefinition);
226
228 private:
229
230 void setEnclosingCTDefinition(XSComplexTypeDefinition* const toSet);
231 friend class XSObjectFactory;
232
233 // -----------------------------------------------------------------------
234 // Unimplemented constructors and operators
235 // -----------------------------------------------------------------------
236 XSElementDeclaration(const XSElementDeclaration&);
237 XSElementDeclaration & operator=(const XSElementDeclaration &);
238
239 protected:
240
241 // -----------------------------------------------------------------------
242 // data members
243 // -----------------------------------------------------------------------
244 short fDisallowedSubstitutions;
245 short fSubstitutionGroupExclusions;
246 XSConstants::SCOPE fScope;
247 SchemaElementDecl* fSchemaElementDecl;
248 XSTypeDefinition* fTypeDefinition;
249 XSComplexTypeDefinition* fEnclosingTypeDefinition;
250 XSElementDeclaration* fSubstitutionGroupAffiliation;
251 XSAnnotation* fAnnotation;
252 XSNamedMap<XSIDCDefinition>* fIdentityConstraints;
253};
254
255 inline XSTypeDefinition* XSElementDeclaration::getTypeDefinition() const
256{
257 return fTypeDefinition;
258}
259
260 inline XSNamedMap<XSIDCDefinition>* XSElementDeclaration::getIdentityConstraints()
261{
262 return fIdentityConstraints;
263}
264
265 inline XSElementDeclaration* XSElementDeclaration::getSubstitutionGroupAffiliation() const
266{
267 return fSubstitutionGroupAffiliation;
268}
269
270 inline short XSElementDeclaration::getSubstitutionGroupExclusions() const
271{
272 return fSubstitutionGroupExclusions;
273}
274
275 inline short XSElementDeclaration::getDisallowedSubstitutions() const
276{
277 return fDisallowedSubstitutions;
278}
279
280 inline XSAnnotation *XSElementDeclaration::getAnnotation() const
281{
282 return fAnnotation;
283}
284
285 inline XSConstants::SCOPE XSElementDeclaration::getScope() const
286{
287 return fScope;
288}
289
290 inline XSComplexTypeDefinition *XSElementDeclaration::getEnclosingCTDefinition() const
291{
292 return fEnclosingTypeDefinition;
293}
294
295 inline void XSElementDeclaration::setTypeDefinition(XSTypeDefinition* typeDefinition)
296{
297 fTypeDefinition = typeDefinition;
298}
299
300 inline void XSElementDeclaration::setEnclosingCTDefinition(XSComplexTypeDefinition* const toSet)
301{
302 fEnclosingTypeDefinition = toSet;
303}
304
305 XERCES_CPP_NAMESPACE_END
306
307#endif
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
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
XSComplexTypeDefinition
Definition XSComplexTypeDefinition.hpp:46
XSConstants::DERIVATION_TYPE
DERIVATION_TYPE
Definition XSConstants.hpp:122
XSConstants::VALUE_CONSTRAINT
VALUE_CONSTRAINT
Definition XSConstants.hpp:172
XSConstants::SCOPE
SCOPE
Definition XSConstants.hpp:152
XSConstants::SCOPE_ABSENT
@ SCOPE_ABSENT
The scope of a declaration within named model groups or attribute groups is absent.
Definition XSConstants.hpp:159
XSElementDeclaration
Definition XSElementDeclaration.hpp:45
XSElementDeclaration::getScope
XSConstants::SCOPE getScope() const
Optional.
Definition XSElementDeclaration.hpp:285
XSElementDeclaration::fDisallowedSubstitutions
short fDisallowedSubstitutions
Definition XSElementDeclaration.hpp:244
XSElementDeclaration::getEnclosingCTDefinition
XSComplexTypeDefinition * getEnclosingCTDefinition() const
The complex type definition for locally scoped declarations (see scope).
Definition XSElementDeclaration.hpp:290
XSElementDeclaration::fIdentityConstraints
XSNamedMap< XSIDCDefinition > * fIdentityConstraints
Definition XSElementDeclaration.hpp:252
XSElementDeclaration::XSElementDeclaration
XSElementDeclaration(SchemaElementDecl *const schemaElementDecl, XSTypeDefinition *const typeDefinition, XSElementDeclaration *const substitutionGroupAffiliation, XSAnnotation *const annot, XSNamedMap< XSIDCDefinition > *const identityConstraints, XSModel *const xsModel, XSConstants::SCOPE elemScope=XSConstants::SCOPE_ABSENT, XSComplexTypeDefinition *const enclosingTypeDefinition=0, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.
XSElementDeclaration::~XSElementDeclaration
~XSElementDeclaration()
XSElementDeclaration::getNamespaceItem
XSNamespaceItem * getNamespaceItem()
A namespace schema information item corresponding to the target namespace of the component,...
XSElementDeclaration::getDisallowedSubstitutions
short getDisallowedSubstitutions() const
[disallowed substitutions]: the returned value is a bit combination of the subset of { DERIVATION_SUB...
Definition XSElementDeclaration.hpp:275
XSElementDeclaration::fScope
XSConstants::SCOPE fScope
Definition XSElementDeclaration.hpp:246
XSElementDeclaration::fAnnotation
XSAnnotation * fAnnotation
Definition XSElementDeclaration.hpp:251
XSElementDeclaration::setTypeDefinition
void setTypeDefinition(XSTypeDefinition *typeDefinition)
methods needed by implementation
Definition XSElementDeclaration.hpp:295
XSElementDeclaration::getNamespace
const XMLCh * getNamespace() const
The [target namespace] of this object, or null if it is unspecified.
XSElementDeclaration::getConstraintType
XSConstants::VALUE_CONSTRAINT getConstraintType() const
[Value constraint]: one of VC_NONE, VC_DEFAULT, VC_FIXED.
XSElementDeclaration::fSubstitutionGroupAffiliation
XSElementDeclaration * fSubstitutionGroupAffiliation
Definition XSElementDeclaration.hpp:250
XSElementDeclaration::fSchemaElementDecl
SchemaElementDecl * fSchemaElementDecl
Definition XSElementDeclaration.hpp:247
XSElementDeclaration::fTypeDefinition
XSTypeDefinition * fTypeDefinition
Definition XSElementDeclaration.hpp:248
XSElementDeclaration::isDisallowedSubstitution
bool isDisallowedSubstitution(XSConstants::DERIVATION_TYPE disallowed)
Convenience method.
XSElementDeclaration::getSubstitutionGroupAffiliation
XSElementDeclaration * getSubstitutionGroupAffiliation() const
[substitution group affiliation]: optional.
Definition XSElementDeclaration.hpp:265
XSElementDeclaration::getAbstract
bool getAbstract() const
{abstract} A boolean.
XSElementDeclaration::getAnnotation
XSAnnotation * getAnnotation() const
Optional.
Definition XSElementDeclaration.hpp:280
XSElementDeclaration::fSubstitutionGroupExclusions
short fSubstitutionGroupExclusions
Definition XSElementDeclaration.hpp:245
XSElementDeclaration::getSubstitutionGroupExclusions
short getSubstitutionGroupExclusions() const
[substitution group exclusions]: the returned value is a bit combination of the subset of { DERIVATIO...
Definition XSElementDeclaration.hpp:270
XSElementDeclaration::isSubstitutionGroupExclusion
bool isSubstitutionGroupExclusion(XSConstants::DERIVATION_TYPE exclusion)
Convenience method.
XSElementDeclaration::getIdentityConstraints
XSNamedMap< XSIDCDefinition > * getIdentityConstraints()
identity-constraint definitions: a set of constraint definitions.
Definition XSElementDeclaration.hpp:260
XSElementDeclaration::getTypeDefinition
XSTypeDefinition * getTypeDefinition() const
[type definition]: either a simple type definition or a complex type definition.
Definition XSElementDeclaration.hpp:255
XSElementDeclaration::getConstraintValue
const XMLCh * getConstraintValue()
[Value constraint]: the actual value with respect to the [type definition].
XSElementDeclaration::fEnclosingTypeDefinition
XSComplexTypeDefinition * fEnclosingTypeDefinition
Definition XSElementDeclaration.hpp:249
XSElementDeclaration::getNillable
bool getNillable() const
If nillable is true, then an element may also be valid if it carries the namespace qualified attribut...
XSElementDeclaration::getName
const XMLCh * getName() const
The name of type NCName of this declaration as defined in XML Namespaces.
XSIDCDefinition
Definition XSIDCDefinition.hpp:41
XSModel
Definition XSModel.hpp:60
XSNamedMap
Definition XSNamedMap.hpp:41
XSNamespaceItem
Definition XSNamespaceItem.hpp:54
XSObject
Definition XSObject.hpp:43
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition XSTypeDefinition.hpp:40