Xerces-C++: XSComplexTypeDefinition.hpp Source File

| API Docs for SAX and DOM |
| Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages # XSComplexTypeDefinition.hpp Go to the documentation of this file.
    00001 /*
    00002  * Copyright 2003,2004 The Apache Software Foundation.
    00003  *
    00004  * Licensed under the Apache License, Version 2.0 (the "License");
    00005  * you may not use this file except in compliance with the License.
    00006  * You may obtain a copy of the License at
    00007  *
    00008  *      http://www.apache.org/licenses/LICENSE-2.0
    00009  *
    00010  * Unless required by applicable law or agreed to in writing, software
    00011  * distributed under the License is distributed on an "AS IS" BASIS,
    00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013  * See the License for the specific language governing permissions and
    00014  * limitations under the License.
    00015  */
    00016
    00017 /*
    00018  * $Id: XSComplexTypeDefinition.hpp 191054 2005-06-17 02:56:35Z jberry $
    00019  */
    00020
    00021 #if !defined(XSCOMPLEXTYPEDEFINITION_HPP)
    00022 #define XSCOMPLEXTYPEDEFINITION_HPP
    00023
    00024 #include <xercesc/framework/psvi/XSTypeDefinition.hpp>
    00025
    00026 XERCES_CPP_NAMESPACE_BEGIN
    00027
    00036 // forward declarations
    00037 class XSAnnotation;
    00038 class XSAttributeUse;
    00039 class XSSimpleTypeDefinition;
    00040 class XSParticle;
    00041 class XSWildcard;
    00042 class ComplexTypeInfo;
    00043
    00044 class  XSComplexTypeDefinition : public XSTypeDefinition
    00045 {
    00046 public:
    00047
    00048     // Content Model Types
    00049     enum CONTENT_TYPE {
    00055          CONTENTTYPE_EMPTY         = 0,
    00060          CONTENTTYPE_SIMPLE        = 1,
    00066          CONTENTTYPE_ELEMENT       = 2,
    00070          CONTENTTYPE_MIXED         = 3
    00071     };
    00072
    00073     //  Constructors and Destructor
    00074     // -----------------------------------------------------------------------
    00077
    00091     XSComplexTypeDefinition
    00092     (
    00093         ComplexTypeInfo* const          complexTypeInfo
    00094         , XSWildcard* const             xsWildcard
    00095         , XSSimpleTypeDefinition* const xsSimpleType
    00096         , XSAttributeUseList* const     xsAttList
    00097         , XSTypeDefinition* const       xsBaseType
    00098         , XSParticle* const             xsParticle
    00099         , XSAnnotation* const           headAnnot
    00100         , XSModel* const                xsModel
    00101         , MemoryManager* const          manager = XMLPlatformUtils::fgMemoryManager
    00102     );
    00103
    00105
    00108     ~XSComplexTypeDefinition();
    00110
    00111     //---------------------
    00115
    00121     XSConstants::DERIVATION_TYPE getDerivationMethod() const;
    00122
    00128     bool getAbstract() const;
    00129
    00133     XSAttributeUseList *getAttributeUses();
    00134
    00138     XSWildcard *getAttributeWildcard() const;
    00139
    00146     CONTENT_TYPE getContentType() const;
    00147
    00152     XSSimpleTypeDefinition *getSimpleType() const;
    00153
    00158     XSParticle *getParticle() const;
    00159
    00167     bool isProhibitedSubstitution(XSConstants::DERIVATION_TYPE toTest);
    00168
    00174     short getProhibitedSubstitutions() const;
    00175
    00179     XSAnnotationList *getAnnotations();
    00180
    00185     const XMLCh* getName();
    00186
    00191     const XMLCh* getNamespace();
    00192
    00198     XSNamespaceItem *getNamespaceItem();
    00199
    00204     bool getAnonymous() const;
    00205
    00210     XSTypeDefinition *getBaseType();
    00211
    00219     bool derivedFromType(const XSTypeDefinition* const ancestorType);
    00220
    00222
    00223     //----------------------------------
    00227
    00228
    00230
    00231 private:
    00232
    00236     void setBaseType(XSTypeDefinition* const xsBaseType);
    00237     friend class XSObjectFactory;
    00238
    00239     // -----------------------------------------------------------------------
    00240     //  Unimplemented constructors and operators
    00241     // -----------------------------------------------------------------------
    00242     XSComplexTypeDefinition(const XSComplexTypeDefinition&);
    00243     XSComplexTypeDefinition & operator=(const XSComplexTypeDefinition &);
    00244
    00245 protected:
    00246
    00247     // -----------------------------------------------------------------------
    00248     //  data members
    00249     // -----------------------------------------------------------------------
    00250     ComplexTypeInfo*        fComplexTypeInfo;
    00251     XSWildcard*             fXSWildcard;
    00252     XSAttributeUseList*     fXSAttributeUseList;
    00253     XSSimpleTypeDefinition* fXSSimpleTypeDefinition;
    00254     XSAnnotationList*       fXSAnnotationList;
    00255     XSParticle*             fParticle;
    00256     short                   fProhibitedSubstitution;
    00257 };
    00258
    00259
    00260 inline XSAttributeUseList* XSComplexTypeDefinition::getAttributeUses()
    00261 {
    00262     return fXSAttributeUseList;
    00263 }
    00264
    00265 inline XSWildcard* XSComplexTypeDefinition::getAttributeWildcard() const
    00266 {
    00267     return fXSWildcard;
    00268 }
    00269
    00270 inline XSSimpleTypeDefinition* XSComplexTypeDefinition::getSimpleType() const
    00271 {
    00272     return fXSSimpleTypeDefinition;
    00273 }
    00274
    00275 inline short XSComplexTypeDefinition::getProhibitedSubstitutions() const
    00276 {
    00277     return fProhibitedSubstitution;
    00278 }
    00279
    00280 inline XSParticle *XSComplexTypeDefinition::getParticle() const
    00281 {
    00282     return fParticle;
    00283 }
    00284
    00285 inline void
    00286 XSComplexTypeDefinition::setBaseType(XSTypeDefinition* const xsBaseType)
    00287 {
    00288     fBaseType = xsBaseType;
    00289 }
    00290
    00291 XERCES_CPP_NAMESPACE_END
    00292
    00293 #endif

Copyright © 1994-2004 The Apache Software Foundation. All Rights Reserved.