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
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 #if !defined(XSSIMPLETYPEDEFINITION_HPP)
00095 #define XSSIMPLETYPEDEFINITION_HPP
00096
00097 #include <xercesc/framework/psvi/XSTypeDefinition.hpp>
00098
00099 XERCES_CPP_NAMESPACE_BEGIN
00100
00109
00110 class XSAnnotation;
00111 class XSFacet;
00112 class XSMultiValueFacet;
00113 class DatatypeValidator;
00114
00115 class XSSimpleTypeDefinition : public XSTypeDefinition
00116 {
00117 public:
00118
00119
00120 enum VARIETY {
00124 VARIETY_ABSENT = 0,
00128 VARIETY_ATOMIC = 1,
00132 VARIETY_LIST = 2,
00136 VARIETY_UNION = 3
00137 };
00138
00139
00140 enum FACET {
00144 FACET_NONE = 0,
00148 FACET_LENGTH = 1,
00152 FACET_MINLENGTH = 2,
00156 FACET_MAXLENGTH = 4,
00160 FACET_PATTERN = 8,
00164 FACET_WHITESPACE = 16,
00168 FACET_MAXINCLUSIVE = 32,
00172 FACET_MAXEXCLUSIVE = 64,
00176 FACET_MINEXCLUSIVE = 128,
00180 FACET_MININCLUSIVE = 256,
00184 FACET_TOTALDIGITS = 512,
00188 FACET_FRACTIONDIGITS = 1024,
00192 FACET_ENUMERATION = 2048
00193 };
00194
00195
00196 enum ORDERING {
00200 ORDERED_FALSE = 0,
00205 ORDERED_PARTIAL = 1,
00209 ORDERED_TOTAL = 2
00210 };
00211
00212
00213
00216
00229 XSSimpleTypeDefinition
00230 (
00231 DatatypeValidator* const datatypeValidator
00232 , VARIETY stVariety
00233 , XSTypeDefinition* const xsBaseType
00234 , XSSimpleTypeDefinition* const primitiveOrItemType
00235 , XSSimpleTypeDefinitionList* const memberTypes
00236 , XSAnnotation* headAnnot
00237 , XSModel* const xsModel
00238 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00239 );
00240
00242
00245 ~XSSimpleTypeDefinition();
00247
00248
00252
00256 VARIETY getVariety() const;
00257
00263 XSSimpleTypeDefinition *getPrimitiveType();
00264
00270 XSSimpleTypeDefinition *getItemType();
00271
00277 XSSimpleTypeDefinitionList *getMemberTypes() const;
00278
00283 int getDefinedFacets() const;
00284
00291 bool isDefinedFacet(FACET facetName);
00292
00296 int getFixedFacets() const;
00297
00304 bool isFixedFacet(FACET facetName);
00305
00317 const XMLCh *getLexicalFacetValue(FACET facetName);
00318
00322 StringList *getLexicalEnumeration();
00323
00327 StringList *getLexicalPattern();
00328
00332 ORDERING getOrdered() const;
00333
00337 bool getFinite() const;
00338
00342 bool getBounded() const;
00343
00347 bool getNumeric() const;
00348
00352 XSAnnotationList *getAnnotations();
00358 XSFacetList *getFacets();
00359
00363 XSMultiValueFacetList *getMultiValueFacets();
00364
00369 const XMLCh* getName();
00370
00375 const XMLCh* getNamespace();
00376
00382 XSNamespaceItem *getNamespaceItem();
00383
00388 bool getAnonymous() const;
00389
00394 XSTypeDefinition *getBaseType();
00395
00403 bool derivedFromType(const XSTypeDefinition* const ancestorType);
00404
00406
00407
00411
00412
00414
00415 private:
00416
00417
00418
00419
00420 XSSimpleTypeDefinition(const XSSimpleTypeDefinition&);
00421 XSSimpleTypeDefinition & operator=(const XSSimpleTypeDefinition &);
00422
00426 void setFacetInfo
00427 (
00428 int definedFacets
00429 , int fixedFacets
00430 , XSFacetList* const xsFacetList
00431 , XSMultiValueFacetList* const xsMultiValueFacetList
00432 , StringList* const patternList
00433 );
00434 void setPrimitiveType(XSSimpleTypeDefinition* const toSet);
00435
00436 friend class XSObjectFactory;
00437
00438 protected:
00439
00440
00441
00442
00443 int fDefinedFacets;
00444 int fFixedFacets;
00445 VARIETY fVariety;
00446 DatatypeValidator* fDatatypeValidator;
00447 XSFacetList* fXSFacetList;
00448 XSMultiValueFacetList* fXSMultiValueFacetList;
00449 StringList* fPatternList;
00450 XSSimpleTypeDefinition* fPrimitiveOrItemType;
00451 XSSimpleTypeDefinitionList* fMemberTypes;
00452 XSAnnotationList* fXSAnnotationList;
00453 };
00454
00455 inline XSSimpleTypeDefinition::VARIETY XSSimpleTypeDefinition::getVariety() const
00456 {
00457 return fVariety;
00458 }
00459
00460 inline XSSimpleTypeDefinition* XSSimpleTypeDefinition::getPrimitiveType()
00461 {
00462 if (fVariety == VARIETY_ATOMIC)
00463 return fPrimitiveOrItemType;
00464
00465 return 0;
00466 }
00467
00468 inline XSSimpleTypeDefinition* XSSimpleTypeDefinition::getItemType()
00469 {
00470 if (fVariety == VARIETY_LIST)
00471 return fPrimitiveOrItemType;
00472
00473 return 0;
00474 }
00475
00476 inline XSSimpleTypeDefinitionList* XSSimpleTypeDefinition::getMemberTypes() const
00477 {
00478 return fMemberTypes;
00479 }
00480
00481 inline int XSSimpleTypeDefinition::getDefinedFacets() const
00482 {
00483 return fDefinedFacets;
00484 }
00485
00486 inline int XSSimpleTypeDefinition::getFixedFacets() const
00487 {
00488 return fFixedFacets;
00489 }
00490
00491 inline StringList* XSSimpleTypeDefinition::getLexicalPattern()
00492 {
00493 return fPatternList;
00494 }
00495
00496 inline XSFacetList* XSSimpleTypeDefinition::getFacets()
00497 {
00498 return fXSFacetList;
00499 }
00500
00501 inline XSMultiValueFacetList* XSSimpleTypeDefinition::getMultiValueFacets()
00502 {
00503 return fXSMultiValueFacetList;
00504 }
00505
00506 inline XSAnnotationList *XSSimpleTypeDefinition::getAnnotations()
00507 {
00508 return fXSAnnotationList;
00509 }
00510
00511 inline void
00512 XSSimpleTypeDefinition::setPrimitiveType(XSSimpleTypeDefinition* const toSet)
00513 {
00514 fPrimitiveOrItemType = toSet;
00515 }
00516
00517 XERCES_CPP_NAMESPACE_END
00518
00519 #endif