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 #if !defined(XSSIMPLETYPEDEFINITION_HPP)
00092 #define XSSIMPLETYPEDEFINITION_HPP
00093
00094 #include <xercesc/framework/psvi/XSTypeDefinition.hpp>
00095
00096 XERCES_CPP_NAMESPACE_BEGIN
00097
00106
00107 class XSAnnotation;
00108 class XSFacet;
00109 class XSMultiValueFacet;
00110 class DatatypeValidator;
00111
00112 class XSSimpleTypeDefinition : public XSTypeDefinition
00113 {
00114 public:
00115
00116
00117 enum VARIETY {
00121 VARIETY_ABSENT = 0,
00125 VARIETY_ATOMIC = 1,
00129 VARIETY_LIST = 2,
00133 VARIETY_UNION = 3
00134 };
00135
00136
00137 enum FACET {
00141 FACET_NONE = 0,
00145 FACET_LENGTH = 1,
00149 FACET_MINLENGTH = 2,
00153 FACET_MAXLENGTH = 4,
00157 FACET_PATTERN = 8,
00161 FACET_WHITESPACE = 16,
00165 FACET_MAXINCLUSIVE = 32,
00169 FACET_MAXEXCLUSIVE = 64,
00173 FACET_MINEXCLUSIVE = 128,
00177 FACET_MININCLUSIVE = 256,
00181 FACET_TOTALDIGITS = 512,
00185 FACET_FRACTIONDIGITS = 1024,
00189 FACET_ENUMERATION = 2048
00190 };
00191
00192
00193 enum ORDERING {
00197 ORDERED_FALSE = 0,
00202 ORDERED_PARTIAL = 1,
00206 ORDERED_TOTAL = 2
00207 };
00208
00209
00210
00213
00226 XSSimpleTypeDefinition
00227 (
00228 DatatypeValidator* const datatypeValidator
00229 , VARIETY stVariety
00230 , XSTypeDefinition* const xsBaseType
00231 , XSSimpleTypeDefinition* const primitiveOrItemType
00232 , XSSimpleTypeDefinitionList* const memberTypes
00233 , XSAnnotation* headAnnot
00234 , XSModel* const xsModel
00235 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00236 );
00237
00239
00242 ~XSSimpleTypeDefinition();
00244
00245
00249
00253 VARIETY getVariety() const;
00254
00260 XSSimpleTypeDefinition *getPrimitiveType();
00261
00267 XSSimpleTypeDefinition *getItemType();
00268
00274 XSSimpleTypeDefinitionList *getMemberTypes() const;
00275
00280 int getDefinedFacets() const;
00281
00288 bool isDefinedFacet(FACET facetName);
00289
00293 int getFixedFacets() const;
00294
00301 bool isFixedFacet(FACET facetName);
00302
00314 const XMLCh *getLexicalFacetValue(FACET facetName);
00315
00319 StringList *getLexicalEnumeration();
00320
00324 StringList *getLexicalPattern();
00325
00329 ORDERING getOrdered() const;
00330
00334 bool getFinite() const;
00335
00339 bool getBounded() const;
00340
00344 bool getNumeric() const;
00345
00349 XSAnnotationList *getAnnotations();
00355 XSFacetList *getFacets();
00356
00360 XSMultiValueFacetList *getMultiValueFacets();
00361
00366 const XMLCh* getName();
00367
00372 const XMLCh* getNamespace();
00373
00379 XSNamespaceItem *getNamespaceItem();
00380
00385 bool getAnonymous() const;
00386
00391 XSTypeDefinition *getBaseType();
00392
00400 bool derivedFromType(const XSTypeDefinition* const ancestorType);
00401
00403
00404
00408
00409
00411
00412 private:
00413
00414
00415
00416
00417 XSSimpleTypeDefinition(const XSSimpleTypeDefinition&);
00418 XSSimpleTypeDefinition & operator=(const XSSimpleTypeDefinition &);
00419
00423 void setFacetInfo
00424 (
00425 int definedFacets
00426 , int fixedFacets
00427 , XSFacetList* const xsFacetList
00428 , XSMultiValueFacetList* const xsMultiValueFacetList
00429 , StringList* const patternList
00430 );
00431
00432 friend class XSObjectFactory;
00433
00434 protected:
00435
00436
00437
00438
00439 int fDefinedFacets;
00440 int fFixedFacets;
00441 VARIETY fVariety;
00442 DatatypeValidator* fDatatypeValidator;
00443 XSFacetList* fXSFacetList;
00444 XSMultiValueFacetList* fXSMultiValueFacetList;
00445 StringList* fPatternList;
00446 XSSimpleTypeDefinition* fPrimitiveOrItemType;
00447 XSSimpleTypeDefinitionList* fMemberTypes;
00448 XSAnnotationList* fXSAnnotationList;
00449 };
00450
00451 inline XSSimpleTypeDefinition::VARIETY XSSimpleTypeDefinition::getVariety() const
00452 {
00453 return fVariety;
00454 }
00455
00456 inline XSSimpleTypeDefinition* XSSimpleTypeDefinition::getPrimitiveType()
00457 {
00458 if (fVariety == VARIETY_ATOMIC)
00459 return fPrimitiveOrItemType;
00460
00461 return 0;
00462 }
00463
00464 inline XSSimpleTypeDefinition* XSSimpleTypeDefinition::getItemType()
00465 {
00466 if (fVariety == VARIETY_LIST)
00467 return fPrimitiveOrItemType;
00468
00469 return 0;
00470 }
00471
00472 inline XSSimpleTypeDefinitionList* XSSimpleTypeDefinition::getMemberTypes() const
00473 {
00474 return fMemberTypes;
00475 }
00476
00477 inline int XSSimpleTypeDefinition::getDefinedFacets() const
00478 {
00479 return fDefinedFacets;
00480 }
00481
00482 inline int XSSimpleTypeDefinition::getFixedFacets() const
00483 {
00484 return fFixedFacets;
00485 }
00486
00487 inline StringList* XSSimpleTypeDefinition::getLexicalPattern()
00488 {
00489 return fPatternList;
00490 }
00491
00492 inline XSFacetList* XSSimpleTypeDefinition::getFacets()
00493 {
00494 return fXSFacetList;
00495 }
00496
00497 inline XSMultiValueFacetList* XSSimpleTypeDefinition::getMultiValueFacets()
00498 {
00499 return fXSMultiValueFacetList;
00500 }
00501
00502 inline XSAnnotationList *XSSimpleTypeDefinition::getAnnotations()
00503 {
00504 return fXSAnnotationList;
00505 }
00506
00507 XERCES_CPP_NAMESPACE_END
00508
00509 #endif