Xerces-C++ 3.2.4
XSSimpleTypeDefinition.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_XSSIMPLETYPEDEFINITION_HPP)
23#define XERCESC_INCLUDE_GUARD_XSSIMPLETYPEDEFINITION_HPP
24
26
28
36
37// forward declarations
38class XSAnnotation;
39class XSFacet;
41class DatatypeValidator;
42
44{
45public:
46
47 // Variety definitions
66
67 // Facets
122
123 // possible order relations
139
140 // Constructors and Destructor
141 // -----------------------------------------------------------------------
144
158 (
159 DatatypeValidator* const datatypeValidator
160 , VARIETY stVariety
161 , XSTypeDefinition* const xsBaseType
162 , XSSimpleTypeDefinition* const primitiveOrItemType
163 , XSSimpleTypeDefinitionList* const memberTypes
164 , XSAnnotation* headAnnot
165 , XSModel* const xsModel
167 );
168
170
175
176 //---------------------
178
180
184 VARIETY getVariety() const;
185
192
199
206
211 int getDefinedFacets() const;
212
219 bool isDefinedFacet(FACET facetName);
220
224 int getFixedFacets() const;
225
232 bool isFixedFacet(FACET facetName);
233
246
251
256
261
265 bool getFinite() const;
266
270 bool getBounded() const;
271
275 bool getNumeric() const;
276
287
292
297 const XMLCh* getName() const;
298
303 const XMLCh* getNamespace() const;
304
311
316 bool getAnonymous() const;
317
323
331 bool derivedFromType(const XSTypeDefinition* const ancestorType);
332
336 inline DatatypeValidator* getDatatypeValidator() const;
337
339
340 //----------------------------------
342
344
345
347
348private:
349
350 // -----------------------------------------------------------------------
351 // Unimplemented constructors and operators
352 // -----------------------------------------------------------------------
355
359 void setFacetInfo
360 (
361 int definedFacets
362 , int fixedFacets
363 , XSFacetList* const xsFacetList
364 , XSMultiValueFacetList* const xsMultiValueFacetList
365 , StringList* const patternList
366 );
367 void setPrimitiveType(XSSimpleTypeDefinition* const toSet);
368
369 friend class XSObjectFactory;
370
371protected:
372
373 // -----------------------------------------------------------------------
374 // data members
375 // -----------------------------------------------------------------------
379 DatatypeValidator* fDatatypeValidator;
386};
387
392
400
408
413
415{
416 return fDefinedFacets;
417}
418
420{
421 return fFixedFacets;
422}
423
428
433
438
443
444inline void
445XSSimpleTypeDefinition::setPrimitiveType(XSSimpleTypeDefinition* const toSet)
446{
447 fPrimitiveOrItemType = toSet;
448}
449
450inline DatatypeValidator*
455
457
458#endif
RefVectorOf< XSMultiValueFacet > XSMultiValueFacetList
Definition XSConstants.hpp:50
RefVectorOf< XSSimpleTypeDefinition > XSSimpleTypeDefinitionList
Definition XSConstants.hpp:53
RefVectorOf< XSAnnotation > XSAnnotationList
Definition XSConstants.hpp:47
RefArrayVectorOf< XMLCh > StringList
Definition XSConstants.hpp:54
RefVectorOf< XSFacet > XSFacetList
Definition XSConstants.hpp:49
#define XMLPARSER_EXPORT
Definition XercesDefs.hpp:163
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
char16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
Configurable memory manager.
Definition MemoryManager.hpp:40
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition PlatformUtils.hpp:121
Definition XSAnnotation.hpp:42
Definition XSFacet.hpp:41
Definition XSModel.hpp:60
Definition XSMultiValueFacet.hpp:41
Definition XSNamespaceItem.hpp:54
Definition XSSimpleTypeDefinition.hpp:44
XSAnnotationList * getAnnotations()
Optional.
Definition XSSimpleTypeDefinition.hpp:439
friend class XSObjectFactory
Definition XSSimpleTypeDefinition.hpp:369
bool isFixedFacet(FACET facetName)
Convenience method.
DatatypeValidator * getDatatypeValidator() const
Definition XSSimpleTypeDefinition.hpp:451
XSMultiValueFacetList * getMultiValueFacets()
Definition XSSimpleTypeDefinition.hpp:434
int fDefinedFacets
Definition XSSimpleTypeDefinition.hpp:376
XSSimpleTypeDefinition * getPrimitiveType()
If variety is atomic the primitive type definition (a built-in primitive datatype definition or the s...
Definition XSSimpleTypeDefinition.hpp:393
XSSimpleTypeDefinitionList * fMemberTypes
Definition XSSimpleTypeDefinition.hpp:384
XSSimpleTypeDefinition * fPrimitiveOrItemType
Definition XSSimpleTypeDefinition.hpp:383
VARIETY
Definition XSSimpleTypeDefinition.hpp:48
@ VARIETY_LIST
List type.
Definition XSSimpleTypeDefinition.hpp:60
@ VARIETY_UNION
Union type.
Definition XSSimpleTypeDefinition.hpp:64
@ VARIETY_ABSENT
The variety is absent for the anySimpleType definition.
Definition XSSimpleTypeDefinition.hpp:52
@ VARIETY_ATOMIC
Atomic type.
Definition XSSimpleTypeDefinition.hpp:56
bool isDefinedFacet(FACET facetName)
Convenience method.
ORDERING
Definition XSSimpleTypeDefinition.hpp:124
@ ORDERED_TOTAL
A constant defined for the 'ordered' fundamental facet: total ordered.
Definition XSSimpleTypeDefinition.hpp:137
@ ORDERED_PARTIAL
A constant defined for the 'ordered' fundamental facet: partially ordered.
Definition XSSimpleTypeDefinition.hpp:133
@ ORDERED_FALSE
A constant defined for the 'ordered' fundamental facet: Not ordered.
Definition XSSimpleTypeDefinition.hpp:128
int fFixedFacets
Definition XSSimpleTypeDefinition.hpp:377
bool getAnonymous() const
A boolean that specifies if the type definition is anonymous.
XSSimpleTypeDefinition(DatatypeValidator *const datatypeValidator, VARIETY stVariety, XSTypeDefinition *const xsBaseType, XSSimpleTypeDefinition *const primitiveOrItemType, XSSimpleTypeDefinitionList *const memberTypes, XSAnnotation *headAnnot, XSModel *const xsModel, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.
StringList * fPatternList
Definition XSSimpleTypeDefinition.hpp:382
bool getFinite() const
Fundamental Facet: cardinality.
XSFacetList * fXSFacetList
Definition XSSimpleTypeDefinition.hpp:380
XSMultiValueFacetList * fXSMultiValueFacetList
Definition XSSimpleTypeDefinition.hpp:381
bool getNumeric() const
Fundamental Facet: numeric.
XSNamespaceItem * getNamespaceItem()
A namespace schema information item corresponding to the target namespace of the component,...
int getDefinedFacets() const
[facets]: get all facets defined on this type.
Definition XSSimpleTypeDefinition.hpp:414
VARIETY getVariety() const
[variety]: one of {atomic, list, union} or absent
Definition XSSimpleTypeDefinition.hpp:388
XSFacetList * getFacets()
Definition XSSimpleTypeDefinition.hpp:429
const XMLCh * getNamespace() const
The [target namespace] of this object, or null if it is unspecified.
bool derivedFromType(const XSTypeDefinition *const ancestorType)
Convenience method: check if this type is derived from the given ancestorType.
StringList * getLexicalEnumeration()
Returns a list of enumeration values.
VARIETY fVariety
Definition XSSimpleTypeDefinition.hpp:378
FACET
Definition XSSimpleTypeDefinition.hpp:68
@ FACET_NONE
No facets defined.
Definition XSSimpleTypeDefinition.hpp:72
@ FACET_MAXLENGTH
4.3.3 maxLength.
Definition XSSimpleTypeDefinition.hpp:84
@ FACET_ENUMERATION
4.3.5 enumeration.
Definition XSSimpleTypeDefinition.hpp:120
@ FACET_MININCLUSIVE
4.3.10 minInclusive.
Definition XSSimpleTypeDefinition.hpp:108
@ FACET_WHITESPACE
4.3.5 whitespace.
Definition XSSimpleTypeDefinition.hpp:92
@ FACET_MINEXCLUSIVE
4.3.9 minExclusive.
Definition XSSimpleTypeDefinition.hpp:104
@ FACET_TOTALDIGITS
4.3.11 totalDigits .
Definition XSSimpleTypeDefinition.hpp:112
@ FACET_LENGTH
4.3.1 Length
Definition XSSimpleTypeDefinition.hpp:76
@ FACET_MAXEXCLUSIVE
4.3.9 maxExclusive.
Definition XSSimpleTypeDefinition.hpp:100
@ FACET_MINLENGTH
4.3.2 minLength.
Definition XSSimpleTypeDefinition.hpp:80
@ FACET_FRACTIONDIGITS
4.3.12 fractionDigits.
Definition XSSimpleTypeDefinition.hpp:116
@ FACET_PATTERN
4.3.4 pattern.
Definition XSSimpleTypeDefinition.hpp:88
@ FACET_MAXINCLUSIVE
4.3.7 maxInclusive.
Definition XSSimpleTypeDefinition.hpp:96
XSAnnotationList * fXSAnnotationList
Definition XSSimpleTypeDefinition.hpp:385
XSSimpleTypeDefinitionList * getMemberTypes() const
If variety is union the list of member type definitions (a non-empty sequence of simple type definiti...
Definition XSSimpleTypeDefinition.hpp:409
ORDERING getOrdered() const
Fundamental Facet: ordered.
XSTypeDefinition * getBaseType()
{base type definition}: either a simple type definition or a complex type definition.
int getFixedFacets() const
[facets]: get all facets defined and fixed on this type.
Definition XSSimpleTypeDefinition.hpp:419
XSSimpleTypeDefinition * getItemType()
If variety is list the item type definition (an atomic or union simple type definition) is available,...
Definition XSSimpleTypeDefinition.hpp:401
StringList * getLexicalPattern()
Returns a list of pattern values.
Definition XSSimpleTypeDefinition.hpp:424
const XMLCh * getLexicalFacetValue(FACET facetName)
Convenience method.
bool getBounded() const
Fundamental Facet: bounded.
const XMLCh * getName() const
The name of type NCName of this declaration as defined in XML Namespaces.
DatatypeValidator * fDatatypeValidator
Definition XSSimpleTypeDefinition.hpp:379
XSTypeDefinition(TYPE_CATEGORY typeCategory, XSTypeDefinition *const xsBaseType, XSModel *const xsModel, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.