File indexing completed on 2025-01-18 10:14:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #if !defined(XERCESC_INCLUDE_GUARD_XSSIMPLETYPEDEFINITION_HPP)
0023 #define XERCESC_INCLUDE_GUARD_XSSIMPLETYPEDEFINITION_HPP
0024
0025 #include <xercesc/framework/psvi/XSTypeDefinition.hpp>
0026
0027 XERCES_CPP_NAMESPACE_BEGIN
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 class XSAnnotation;
0039 class XSFacet;
0040 class XSMultiValueFacet;
0041 class DatatypeValidator;
0042
0043 class XMLPARSER_EXPORT XSSimpleTypeDefinition : public XSTypeDefinition
0044 {
0045 public:
0046
0047
0048 enum VARIETY {
0049
0050
0051
0052 VARIETY_ABSENT = 0,
0053
0054
0055
0056 VARIETY_ATOMIC = 1,
0057
0058
0059
0060 VARIETY_LIST = 2,
0061
0062
0063
0064 VARIETY_UNION = 3
0065 };
0066
0067
0068 enum FACET {
0069
0070
0071
0072 FACET_NONE = 0,
0073
0074
0075
0076 FACET_LENGTH = 1,
0077
0078
0079
0080 FACET_MINLENGTH = 2,
0081
0082
0083
0084 FACET_MAXLENGTH = 4,
0085
0086
0087
0088 FACET_PATTERN = 8,
0089
0090
0091
0092 FACET_WHITESPACE = 16,
0093
0094
0095
0096 FACET_MAXINCLUSIVE = 32,
0097
0098
0099
0100 FACET_MAXEXCLUSIVE = 64,
0101
0102
0103
0104 FACET_MINEXCLUSIVE = 128,
0105
0106
0107
0108 FACET_MININCLUSIVE = 256,
0109
0110
0111
0112 FACET_TOTALDIGITS = 512,
0113
0114
0115
0116 FACET_FRACTIONDIGITS = 1024,
0117
0118
0119
0120 FACET_ENUMERATION = 2048
0121 };
0122
0123
0124 enum ORDERING {
0125
0126
0127
0128 ORDERED_FALSE = 0,
0129
0130
0131
0132
0133 ORDERED_PARTIAL = 1,
0134
0135
0136
0137 ORDERED_TOTAL = 2
0138 };
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157 XSSimpleTypeDefinition
0158 (
0159 DatatypeValidator* const datatypeValidator
0160 , VARIETY stVariety
0161 , XSTypeDefinition* const xsBaseType
0162 , XSSimpleTypeDefinition* const primitiveOrItemType
0163 , XSSimpleTypeDefinitionList* const memberTypes
0164 , XSAnnotation* headAnnot
0165 , XSModel* const xsModel
0166 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0167 );
0168
0169
0170
0171
0172
0173 ~XSSimpleTypeDefinition();
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184 VARIETY getVariety() const;
0185
0186
0187
0188
0189
0190
0191 XSSimpleTypeDefinition *getPrimitiveType();
0192
0193
0194
0195
0196
0197
0198 XSSimpleTypeDefinition *getItemType();
0199
0200
0201
0202
0203
0204
0205 XSSimpleTypeDefinitionList *getMemberTypes() const;
0206
0207
0208
0209
0210
0211 int getDefinedFacets() const;
0212
0213
0214
0215
0216
0217
0218
0219 bool isDefinedFacet(FACET facetName);
0220
0221
0222
0223
0224 int getFixedFacets() const;
0225
0226
0227
0228
0229
0230
0231
0232 bool isFixedFacet(FACET facetName);
0233
0234
0235
0236
0237
0238
0239
0240
0241
0242
0243
0244
0245 const XMLCh *getLexicalFacetValue(FACET facetName);
0246
0247
0248
0249
0250 StringList *getLexicalEnumeration();
0251
0252
0253
0254
0255 StringList *getLexicalPattern();
0256
0257
0258
0259
0260 ORDERING getOrdered() const;
0261
0262
0263
0264
0265 bool getFinite() const;
0266
0267
0268
0269
0270 bool getBounded() const;
0271
0272
0273
0274
0275 bool getNumeric() const;
0276
0277
0278
0279
0280 XSAnnotationList *getAnnotations();
0281
0282
0283
0284
0285
0286 XSFacetList *getFacets();
0287
0288
0289
0290
0291 XSMultiValueFacetList *getMultiValueFacets();
0292
0293
0294
0295
0296
0297 const XMLCh* getName() const;
0298
0299
0300
0301
0302
0303 const XMLCh* getNamespace() const;
0304
0305
0306
0307
0308
0309
0310 XSNamespaceItem *getNamespaceItem();
0311
0312
0313
0314
0315
0316 bool getAnonymous() const;
0317
0318
0319
0320
0321
0322 XSTypeDefinition *getBaseType();
0323
0324
0325
0326
0327
0328
0329
0330
0331 bool derivedFromType(const XSTypeDefinition* const ancestorType);
0332
0333
0334
0335
0336 inline DatatypeValidator* getDatatypeValidator() const;
0337
0338
0339
0340
0341
0342
0343
0344
0345
0346
0347
0348 private:
0349
0350
0351
0352
0353 XSSimpleTypeDefinition(const XSSimpleTypeDefinition&);
0354 XSSimpleTypeDefinition & operator=(const XSSimpleTypeDefinition &);
0355
0356
0357
0358
0359 void setFacetInfo
0360 (
0361 int definedFacets
0362 , int fixedFacets
0363 , XSFacetList* const xsFacetList
0364 , XSMultiValueFacetList* const xsMultiValueFacetList
0365 , StringList* const patternList
0366 );
0367 void setPrimitiveType(XSSimpleTypeDefinition* const toSet);
0368
0369 friend class XSObjectFactory;
0370
0371 protected:
0372
0373
0374
0375
0376 int fDefinedFacets;
0377 int fFixedFacets;
0378 VARIETY fVariety;
0379 DatatypeValidator* fDatatypeValidator;
0380 XSFacetList* fXSFacetList;
0381 XSMultiValueFacetList* fXSMultiValueFacetList;
0382 StringList* fPatternList;
0383 XSSimpleTypeDefinition* fPrimitiveOrItemType;
0384 XSSimpleTypeDefinitionList* fMemberTypes;
0385 XSAnnotationList* fXSAnnotationList;
0386 };
0387
0388 inline XSSimpleTypeDefinition::VARIETY XSSimpleTypeDefinition::getVariety() const
0389 {
0390 return fVariety;
0391 }
0392
0393 inline XSSimpleTypeDefinition* XSSimpleTypeDefinition::getPrimitiveType()
0394 {
0395 if (fVariety == VARIETY_ATOMIC)
0396 return fPrimitiveOrItemType;
0397
0398 return 0;
0399 }
0400
0401 inline XSSimpleTypeDefinition* XSSimpleTypeDefinition::getItemType()
0402 {
0403 if (fVariety == VARIETY_LIST)
0404 return fPrimitiveOrItemType;
0405
0406 return 0;
0407 }
0408
0409 inline XSSimpleTypeDefinitionList* XSSimpleTypeDefinition::getMemberTypes() const
0410 {
0411 return fMemberTypes;
0412 }
0413
0414 inline int XSSimpleTypeDefinition::getDefinedFacets() const
0415 {
0416 return fDefinedFacets;
0417 }
0418
0419 inline int XSSimpleTypeDefinition::getFixedFacets() const
0420 {
0421 return fFixedFacets;
0422 }
0423
0424 inline StringList* XSSimpleTypeDefinition::getLexicalPattern()
0425 {
0426 return fPatternList;
0427 }
0428
0429 inline XSFacetList* XSSimpleTypeDefinition::getFacets()
0430 {
0431 return fXSFacetList;
0432 }
0433
0434 inline XSMultiValueFacetList* XSSimpleTypeDefinition::getMultiValueFacets()
0435 {
0436 return fXSMultiValueFacetList;
0437 }
0438
0439 inline XSAnnotationList *XSSimpleTypeDefinition::getAnnotations()
0440 {
0441 return fXSAnnotationList;
0442 }
0443
0444 inline void
0445 XSSimpleTypeDefinition::setPrimitiveType(XSSimpleTypeDefinition* const toSet)
0446 {
0447 fPrimitiveOrItemType = toSet;
0448 }
0449
0450 inline DatatypeValidator*
0451 XSSimpleTypeDefinition::getDatatypeValidator() const
0452 {
0453 return fDatatypeValidator;
0454 }
0455
0456 XERCES_CPP_NAMESPACE_END
0457
0458 #endif