00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #if !defined(XSSIMPLETYPEDEFINITION_HPP)
00061 #define XSSIMPLETYPEDEFINITION_HPP
00062
00063 #include <xercesc/framework/psvi/XSTypeDefinition.hpp>
00064
00065 XERCES_CPP_NAMESPACE_BEGIN
00066
00075
00076 class XSAnnotation;
00077 class XSFacet;
00078 class XSMultiValueFacet;
00079 class DatatypeValidator;
00080
00081 class XSSimpleTypeDefinition : public XSTypeDefinition
00082 {
00083 public:
00084
00085
00086 enum VARIETY {
00090 VARIETY_ABSENT = 0,
00094 VARIETY_ATOMIC = 1,
00098 VARIETY_LIST = 2,
00102 VARIETY_UNION = 3
00103 };
00104
00105
00106 enum FACET {
00110 FACET_NONE = 0,
00114 FACET_LENGTH = 1,
00118 FACET_MINLENGTH = 2,
00122 FACET_MAXLENGTH = 4,
00126 FACET_PATTERN = 8,
00130 FACET_WHITESPACE = 16,
00134 FACET_MAXINCLUSIVE = 32,
00138 FACET_MAXEXCLUSIVE = 64,
00142 FACET_MINEXCLUSIVE = 128,
00146 FACET_MININCLUSIVE = 256,
00150 FACET_TOTALDIGITS = 512,
00154 FACET_FRACTIONDIGITS = 1024,
00158 FACET_ENUMERATION = 2048
00159 };
00160
00161
00162 enum ORDERING {
00166 ORDERED_FALSE = 0,
00171 ORDERED_PARTIAL = 1,
00175 ORDERED_TOTAL = 2
00176 };
00177
00178
00179
00182
00195 XSSimpleTypeDefinition
00196 (
00197 DatatypeValidator* const datatypeValidator
00198 , VARIETY stVariety
00199 , XSTypeDefinition* const xsBaseType
00200 , XSSimpleTypeDefinition* const primitiveOrItemType
00201 , XSSimpleTypeDefinitionList* const memberTypes
00202 , XSAnnotation* headAnnot
00203 , XSModel* const xsModel
00204 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00205 );
00206
00208
00211 ~XSSimpleTypeDefinition();
00213
00214
00218
00222 VARIETY getVariety() const;
00223
00229 XSSimpleTypeDefinition *getPrimitiveType();
00230
00236 XSSimpleTypeDefinition *getItemType();
00237
00243 XSSimpleTypeDefinitionList *getMemberTypes() const;
00244
00249 int getDefinedFacets() const;
00250
00257 bool isDefinedFacet(FACET facetName);
00258
00262 int getFixedFacets() const;
00263
00270 bool isFixedFacet(FACET facetName);
00271
00283 const XMLCh *getLexicalFacetValue(FACET facetName);
00284
00288 StringList *getLexicalEnumeration();
00289
00293 StringList *getLexicalPattern();
00294
00298 ORDERING getOrdered() const;
00299
00303 bool getFinite() const;
00304
00308 bool getBounded() const;
00309
00313 bool getNumeric() const;
00314
00318 XSAnnotationList *getAnnotations();
00324 XSFacetList *getFacets();
00325
00329 XSMultiValueFacetList *getMultiValueFacets();
00330
00335 const XMLCh* getName();
00336
00341 const XMLCh* getNamespace();
00342
00348 XSNamespaceItem *getNamespaceItem();
00349
00354 bool getAnonymous() const;
00355
00360 XSTypeDefinition *getBaseType();
00361
00369 bool derivedFromType(const XSTypeDefinition* const ancestorType);
00370
00374 inline DatatypeValidator* getDatatypeValidator() const;
00375
00377
00378
00382
00383
00385
00386 private:
00387
00388
00389
00390
00391 XSSimpleTypeDefinition(const XSSimpleTypeDefinition&);
00392 XSSimpleTypeDefinition & operator=(const XSSimpleTypeDefinition &);
00393
00397 void setFacetInfo
00398 (
00399 int definedFacets
00400 , int fixedFacets
00401 , XSFacetList* const xsFacetList
00402 , XSMultiValueFacetList* const xsMultiValueFacetList
00403 , StringList* const patternList
00404 );
00405 void setPrimitiveType(XSSimpleTypeDefinition* const toSet);
00406
00407 friend class XSObjectFactory;
00408
00409 protected:
00410
00411
00412
00413
00414 int fDefinedFacets;
00415 int fFixedFacets;
00416 VARIETY fVariety;
00417 DatatypeValidator* fDatatypeValidator;
00418 XSFacetList* fXSFacetList;
00419 XSMultiValueFacetList* fXSMultiValueFacetList;
00420 StringList* fPatternList;
00421 XSSimpleTypeDefinition* fPrimitiveOrItemType;
00422 XSSimpleTypeDefinitionList* fMemberTypes;
00423 XSAnnotationList* fXSAnnotationList;
00424 };
00425
00426 inline XSSimpleTypeDefinition::VARIETY XSSimpleTypeDefinition::getVariety() const
00427 {
00428 return fVariety;
00429 }
00430
00431 inline XSSimpleTypeDefinition* XSSimpleTypeDefinition::getPrimitiveType()
00432 {
00433 if (fVariety == VARIETY_ATOMIC)
00434 return fPrimitiveOrItemType;
00435
00436 return 0;
00437 }
00438
00439 inline XSSimpleTypeDefinition* XSSimpleTypeDefinition::getItemType()
00440 {
00441 if (fVariety == VARIETY_LIST)
00442 return fPrimitiveOrItemType;
00443
00444 return 0;
00445 }
00446
00447 inline XSSimpleTypeDefinitionList* XSSimpleTypeDefinition::getMemberTypes() const
00448 {
00449 return fMemberTypes;
00450 }
00451
00452 inline int XSSimpleTypeDefinition::getDefinedFacets() const
00453 {
00454 return fDefinedFacets;
00455 }
00456
00457 inline int XSSimpleTypeDefinition::getFixedFacets() const
00458 {
00459 return fFixedFacets;
00460 }
00461
00462 inline StringList* XSSimpleTypeDefinition::getLexicalPattern()
00463 {
00464 return fPatternList;
00465 }
00466
00467 inline XSFacetList* XSSimpleTypeDefinition::getFacets()
00468 {
00469 return fXSFacetList;
00470 }
00471
00472 inline XSMultiValueFacetList* XSSimpleTypeDefinition::getMultiValueFacets()
00473 {
00474 return fXSMultiValueFacetList;
00475 }
00476
00477 inline XSAnnotationList *XSSimpleTypeDefinition::getAnnotations()
00478 {
00479 return fXSAnnotationList;
00480 }
00481
00482 inline void
00483 XSSimpleTypeDefinition::setPrimitiveType(XSSimpleTypeDefinition* const toSet)
00484 {
00485 fPrimitiveOrItemType = toSet;
00486 }
00487
00488 inline DatatypeValidator*
00489 XSSimpleTypeDefinition::getDatatypeValidator() const
00490 {
00491 return fDatatypeValidator;
00492 }
00493
00494 XERCES_CPP_NAMESPACE_END
00495
00496 #endif