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 #if !defined(XSMODEL_HPP)
00094 #define XSMODEL_HPP
00095
00096 #include <xercesc/util/PlatformUtils.hpp>
00097 #include <xercesc/framework/psvi/XSObject.hpp>
00098 #include <xercesc/framework/psvi/XSNamedMap.hpp>
00099
00100 #include <xercesc/util/ValueVectorOf.hpp>
00101 #include <xercesc/validators/schema/SchemaElementDecl.hpp>
00102
00103 XERCES_CPP_NAMESPACE_BEGIN
00104
00117
00118 class Grammar;
00119 class XMLGrammarPool;
00120 class XSAnnotation;
00121 class XSAttributeDeclaration;
00122 class XSAttributeGroupDefinition;
00123 class XSElementDeclaration;
00124 class XSModelGroupDefinition;
00125 class XSNamespaceItem;
00126 class XSNotationDeclaration;
00127 class XSTypeDefinition;
00128 class XSObjectFactory;
00129
00130 class XSModel : public XMemory
00131 {
00132 public:
00133
00134
00135
00138
00144 XSModel( XMLGrammarPool *grammarPool
00145 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00146
00156 XSModel( XSModel *baseModel
00157 , GrammarResolver *grammarResolver
00158 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00159
00161
00164 ~XSModel();
00166
00167
00171
00178 StringList *getNamespaces();
00179
00188 XSNamespaceItemList *getNamespaceItems();
00189
00200 XSNamedMap<XSObject> *getComponents(XSConstants::COMPONENT_TYPE objectType);
00201
00214 XSNamedMap<XSObject> *getComponentsByNamespace(XSConstants::COMPONENT_TYPE objectType,
00215 const XMLCh *compNamespace);
00216
00220 XSAnnotationList *getAnnotations();
00221
00229 XSElementDeclaration *getElementDeclaration(const XMLCh *name
00230 , const XMLCh *compNamespace);
00231
00239 XSAttributeDeclaration *getAttributeDeclaration(const XMLCh *name
00240 , const XMLCh *compNamespace);
00241
00250 XSTypeDefinition *getTypeDefinition(const XMLCh *name
00251 , const XMLCh *compNamespace);
00252
00260 XSAttributeGroupDefinition *getAttributeGroup(const XMLCh *name
00261 , const XMLCh *compNamespace);
00262
00270 XSModelGroupDefinition *getModelGroupDefinition(const XMLCh *name
00271 , const XMLCh *compNamespace);
00272
00280 XSNotationDeclaration *getNotationDeclaration(const XMLCh *name
00281 , const XMLCh *compNamespace);
00282
00292 XSObject *getXSObjectById(unsigned int compId
00293 , XSConstants::COMPONENT_TYPE compType);
00294
00296
00297
00301 XMLStringPool* getURIStringPool();
00302
00303 XSNamespaceItem* getNamespaceItem(const XMLCh* const key);
00304
00312 XSObject* getXSObject(void* key);
00313
00315 private:
00316
00317 void addGrammarToXSModel(XSNamespaceItem* namespaceItem);
00318
00319
00320
00321
00322 XSModel(const XSModel&);
00323 XSModel & operator=(const XSModel &);
00324
00325 protected:
00326 friend class XSObjectFactory;
00327
00328
00329
00330
00331
00332
00333 MemoryManager* const fMemoryManager;
00334
00335 StringList* fNamespaceStringList;
00336 XSNamespaceItemList* fXSNamespaceItemList;
00337
00338 RefVectorOf<XSElementDeclaration>* fElementDeclarationVector;
00339 RefVectorOf<XSAttributeDeclaration>* fAttributeDeclarationVector;
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357 XSNamedMap<XSObject>* fComponentMap[XSConstants::MULTIVALUE_FACET];
00358
00359 XMLStringPool* fURIStringPool;
00360 XSAnnotationList* fXSAnnotationList;
00361 RefHashTableOf<XSNamespaceItem>* fHashNamespace;
00362 XSObjectFactory* fObjFactory;
00363 RefVectorOf<XSNamespaceItem>* fDeleteNamespace;
00364
00365 XSModel* fParent;
00366 bool fDeleteParent;
00367 bool fAddedBuiltinDatatypeValidators;
00368 };
00369
00370 inline XMLStringPool* XSModel::getURIStringPool()
00371 {
00372 return fURIStringPool;
00373 }
00374
00375 inline StringList *XSModel::getNamespaces()
00376 {
00377 return fNamespaceStringList;
00378 }
00379
00380 inline XSNamespaceItemList *XSModel::getNamespaceItems()
00381 {
00382 return fXSNamespaceItemList;
00383 }
00384
00385 XERCES_CPP_NAMESPACE_END
00386
00387 #endif