http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Charter
Release Info

Installation
Download
Build Instructions

FAQs
Samples
API Docs

DOM C++ Binding
Programming
Migration Guide

Feedback
Bug-Reporting
PDF Document

Source Repository
User Mail Archive
Devel Mail Archive

API Docs for SAX and DOM
 

XSTypeDefinition.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: XSTypeDefinition.hpp 191054 2005-06-17 02:56:35Z jberry $
00019  */
00020 
00021 #if !defined(XSTYPEDEFINITION_HPP)
00022 #define XSTYPEDEFINITION_HPP
00023 
00024 #include <xercesc/framework/psvi/XSObject.hpp>
00025 
00026 XERCES_CPP_NAMESPACE_BEGIN
00027 
00028 // forward declarations
00029 class XSNamespaceItem;
00030 
00038 class  XSTypeDefinition : public XSObject
00039 {
00040 public:
00041 
00042     enum TYPE_CATEGORY {
00046         COMPLEX_TYPE              = 15,
00050         SIMPLE_TYPE               = 16
00051     };
00052 
00053     //  Constructors and Destructor
00054     // -----------------------------------------------------------------------
00057 
00066     XSTypeDefinition
00067     (
00068         TYPE_CATEGORY             typeCategory
00069         , XSTypeDefinition* const xsBaseType
00070         , XSModel* const          xsModel
00071         , MemoryManager* const    manager = XMLPlatformUtils::fgMemoryManager
00072     );
00073 
00075 
00078     virtual ~XSTypeDefinition();
00080 
00081     //---------------------
00084 
00089     virtual const XMLCh* getName() = 0;
00090 
00095     virtual const XMLCh* getNamespace() = 0;
00096 
00102     virtual XSNamespaceItem *getNamespaceItem() = 0;
00103 
00105 
00106     //---------------------
00110 
00114     TYPE_CATEGORY getTypeCategory() const;
00115 
00120     virtual XSTypeDefinition *getBaseType() = 0;
00121 
00130     bool isFinal(short toTest);
00131 
00142     short getFinal() const;
00143 
00148     virtual bool getAnonymous() const = 0;
00149 
00157     virtual bool derivedFromType(const XSTypeDefinition* const ancestorType) = 0;
00158 
00167     bool derivedFrom(const XMLCh* typeNamespace, 
00168                                const XMLCh* name);
00169 
00171 
00172     //----------------------------------
00176 
00178 private:
00179 
00180     // -----------------------------------------------------------------------
00181     //  Unimplemented constructors and operators
00182     // -----------------------------------------------------------------------
00183     XSTypeDefinition(const XSTypeDefinition&);
00184     XSTypeDefinition & operator=(const XSTypeDefinition &);
00185 
00186 protected:
00187 
00188     // -----------------------------------------------------------------------
00189     //  data members
00190     // -----------------------------------------------------------------------
00191     // fTypeCategory
00192     //  whether this is a simpleType or complexType
00193     // fFinal
00194     //  the final properties which is set by the derived class.
00195     TYPE_CATEGORY     fTypeCategory;
00196     short             fFinal;
00197     XSTypeDefinition* fBaseType; // owned by XSModel
00198 };
00199 
00200 inline XSTypeDefinition::TYPE_CATEGORY XSTypeDefinition::getTypeCategory() const
00201 {
00202     return fTypeCategory;
00203 }
00204 
00205 inline short XSTypeDefinition::getFinal() const
00206 {
00207     return fFinal;
00208 }
00209 
00210 
00211 XERCES_CPP_NAMESPACE_END
00212 
00213 #endif


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