| API Docs for SAX and DOM |
| Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members # 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  * $Log: XSComplexTypeDefinition.hpp,v $
    00019  * Revision 1.9  2004/09/08 13:56:08  peiyongz
    00020  * Apache License Version 2.0
    00021  *
    00022  * Revision 1.8  2003/12/24 17:42:02  knoaman
    00023  * Misc. PSVI updates
    00024  *
    00025  * Revision 1.7  2003/12/01 23:23:26  neilg
    00026  * fix for bug 25118; thanks to Jeroen Witmond
    00027  *
    00028  * Revision 1.6  2003/11/25 18:08:31  knoaman
    00029  * Misc. PSVI updates. Thanks to David Cargill.
    00030  *
    00031  * Revision 1.5  2003/11/21 17:19:30  knoaman
    00032  * PSVI update.
    00033  *
    00034  * Revision 1.4  2003/11/14 22:47:53  neilg
    00035  * fix bogus log message from previous commit...
    00036  *
    00037  * Revision 1.3  2003/11/14 22:33:30  neilg
    00038  * Second phase of schema component model implementation.
    00039  * Implement XSModel, XSNamespaceItem, and the plumbing necessary
    00040  * to connect them to the other components.
    00041  * Thanks to David Cargill.
    00042  *
    00043  * Revision 1.2  2003/11/06 15:30:04  neilg
    00044  * first part of PSVI/schema component model implementation, thanks to David Cargill.  This covers setting the PSVIHandler on parser objects, as well as implementing XSNotation, XSSimpleTypeDefinition, XSIDCDefinition, and most of XSWildcard, XSComplexTypeDefinition, XSElementDeclaration, XSAttributeDeclaration and XSAttributeUse.
    00045  *
    00046  * Revision 1.1  2003/09/16 14:33:36  neilg
    00047  * PSVI/schema component model classes, with Makefile/configuration changes necessary to build them
    00048  *
    00049  */
    00050
    00051 #if !defined(XSCOMPLEXTYPEDEFINITION_HPP)
    00052 #define XSCOMPLEXTYPEDEFINITION_HPP
    00053
    00054 #include <xercesc/framework/psvi/XSTypeDefinition.hpp>
    00055
    00056 XERCES_CPP_NAMESPACE_BEGIN
    00057
    00066 // forward declarations
    00067 class XSAnnotation;
    00068 class XSAttributeUse;
    00069 class XSSimpleTypeDefinition;
    00070 class XSParticle;
    00071 class XSWildcard;
    00072 class ComplexTypeInfo;
    00073
    00074 class  XSComplexTypeDefinition : public XSTypeDefinition
    00075 {
    00076 public:
    00077
    00078     // Content Model Types
    00079     enum CONTENT_TYPE {
    00085          CONTENTTYPE_EMPTY         = 0,
    00090          CONTENTTYPE_SIMPLE        = 1,
    00096          CONTENTTYPE_ELEMENT       = 2,
    00100          CONTENTTYPE_MIXED         = 3
    00101     };
    00102
    00103     //  Constructors and Destructor
    00104     // -----------------------------------------------------------------------
    00107
    00121     XSComplexTypeDefinition
    00122     (
    00123         ComplexTypeInfo* const          complexTypeInfo
    00124         , XSWildcard* const             xsWildcard
    00125         , XSSimpleTypeDefinition* const xsSimpleType
    00126         , XSAttributeUseList* const     xsAttList
    00127         , XSTypeDefinition* const       xsBaseType
    00128         , XSParticle* const             xsParticle
    00129         , XSAnnotation* const           headAnnot
    00130         , XSModel* const                xsModel
    00131         , MemoryManager* const          manager = XMLPlatformUtils::fgMemoryManager
    00132     );
    00133
    00135
    00138     ~XSComplexTypeDefinition();
    00140
    00141     //---------------------
    00145
    00151     XSConstants::DERIVATION_TYPE getDerivationMethod() const;
    00152
    00158     bool getAbstract() const;
    00159
    00163     XSAttributeUseList *getAttributeUses();
    00164
    00168     XSWildcard *getAttributeWildcard() const;
    00169
    00176     CONTENT_TYPE getContentType() const;
    00177
    00182     XSSimpleTypeDefinition *getSimpleType() const;
    00183
    00188     XSParticle *getParticle() const;
    00189
    00197     bool isProhibitedSubstitution(XSConstants::DERIVATION_TYPE toTest);
    00198
    00204     short getProhibitedSubstitutions() const;
    00205
    00209     XSAnnotationList *getAnnotations();
    00210
    00215     const XMLCh* getName();
    00216
    00221     const XMLCh* getNamespace();
    00222
    00228     XSNamespaceItem *getNamespaceItem();
    00229
    00234     bool getAnonymous() const;
    00235
    00240     XSTypeDefinition *getBaseType();
    00241
    00249     bool derivedFromType(const XSTypeDefinition* const ancestorType);
    00250
    00252
    00253     //----------------------------------
    00257
    00258
    00260
    00261 private:
    00262
    00266     void setBaseType(XSTypeDefinition* const xsBaseType);
    00267     friend class XSObjectFactory;
    00268
    00269     // -----------------------------------------------------------------------
    00270     //  Unimplemented constructors and operators
    00271     // -----------------------------------------------------------------------
    00272     XSComplexTypeDefinition(const XSComplexTypeDefinition&);
    00273     XSComplexTypeDefinition & operator=(const XSComplexTypeDefinition &);
    00274
    00275 protected:
    00276
    00277     // -----------------------------------------------------------------------
    00278     //  data members
    00279     // -----------------------------------------------------------------------
    00280     ComplexTypeInfo*        fComplexTypeInfo;
    00281     XSWildcard*             fXSWildcard;
    00282     XSAttributeUseList*     fXSAttributeUseList;
    00283     XSSimpleTypeDefinition* fXSSimpleTypeDefinition;
    00284     XSAnnotationList*       fXSAnnotationList;
    00285     XSParticle*             fParticle;
    00286     short                   fProhibitedSubstitution;
    00287 };
    00288
    00289
    00290 inline XSAttributeUseList* XSComplexTypeDefinition::getAttributeUses()
    00291 {
    00292     return fXSAttributeUseList;
    00293 }
    00294
    00295 inline XSWildcard* XSComplexTypeDefinition::getAttributeWildcard() const
    00296 {
    00297     return fXSWildcard;
    00298 }
    00299
    00300 inline XSSimpleTypeDefinition* XSComplexTypeDefinition::getSimpleType() const
    00301 {
    00302     return fXSSimpleTypeDefinition;
    00303 }
    00304
    00305 inline short XSComplexTypeDefinition::getProhibitedSubstitutions() const
    00306 {
    00307     return fProhibitedSubstitution;
    00308 }
    00309
    00310 inline XSParticle *XSComplexTypeDefinition::getParticle() const
    00311 {
    00312     return fParticle;
    00313 }
    00314
    00315 inline void
    00316 XSComplexTypeDefinition::setBaseType(XSTypeDefinition* const xsBaseType)
    00317 {
    00318     fBaseType = xsBaseType;
    00319 }
    00320
    00321 XERCES_CPP_NAMESPACE_END
    00322
    00323 #endif

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