Xerces-C++ 3.3.0
XSTypeDefinition.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id$
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_XSTYPEDEFINITION_HPP)
23#define XERCESC_INCLUDE_GUARD_XSTYPEDEFINITION_HPP
24
26
28
29// forward declarations
30class XSNamespaceItem;
31
40{
41public:
42
47 COMPLEX_TYPE = 15,
51 SIMPLE_TYPE = 16
52 };
53
54 // Constructors and Destructor
55 // -----------------------------------------------------------------------
58
68 (
69 TYPE_CATEGORY typeCategory
70 , XSTypeDefinition* const xsBaseType
71 , XSModel* const xsModel
73 );
74
76
81
82 //---------------------
85
90 virtual const XMLCh* getName() const = 0;
91
96 virtual const XMLCh* getNamespace() const = 0;
97
104
106
107 //---------------------
111
115 TYPE_CATEGORY getTypeCategory() const;
116
122
131 bool isFinal(short toTest);
132
143 short getFinal() const;
144
149 virtual bool getAnonymous() const = 0;
150
158 virtual bool derivedFromType(const XSTypeDefinition* const ancestorType) = 0;
159
168 bool derivedFrom(const XMLCh* typeNamespace,
169 const XMLCh* name);
170
172
173 //----------------------------------
177
179private:
180
181 // -----------------------------------------------------------------------
182 // Unimplemented constructors and operators
183 // -----------------------------------------------------------------------
185 XSTypeDefinition & operator=(const XSTypeDefinition &);
186
187protected:
188
189 // -----------------------------------------------------------------------
190 // data members
191 // -----------------------------------------------------------------------
192 // fTypeCategory
193 // whether this is a simpleType or complexType
194 // fFinal
195 // the final properties which is set by the derived class.
197 short fFinal;
198 XSTypeDefinition* fBaseType; // owned by XSModel
199};
200
205
206inline short XSTypeDefinition::getFinal() const
207{
208 return fFinal;
209}
210
211
213
214#endif
#define XMLPARSER_EXPORT
Definition XercesDefs.hpp:163
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
char16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
Configurable memory manager.
Definition MemoryManager.hpp:40
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition PlatformUtils.hpp:121
Definition XSModel.hpp:60
Definition XSNamespaceItem.hpp:54
Definition XSObject.hpp:43
This class represents a complexType or simpleType definition.
Definition XSTypeDefinition.hpp:40
virtual const XMLCh * getName() const =0
The name of type NCName of this declaration as defined in XML Namespaces.
bool isFinal(short toTest)
{final}.
short fFinal
Definition XSTypeDefinition.hpp:197
virtual bool derivedFromType(const XSTypeDefinition *const ancestorType)=0
Convenience method: check if this type is derived from the given ancestorType.
virtual const XMLCh * getNamespace() const =0
The [target namespace] of this object, or null if it is unspecified.
virtual XSTypeDefinition * getBaseType()=0
{base type definition}: either a simple type definition or a complex type definition.
XSTypeDefinition(TYPE_CATEGORY typeCategory, XSTypeDefinition *const xsBaseType, XSModel *const xsModel, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.
virtual ~XSTypeDefinition()
TYPE_CATEGORY fTypeCategory
Definition XSTypeDefinition.hpp:196
short getFinal() const
For complex types the returned value is a bit combination of the subset of {DERIVATION_EXTENSION,...
Definition XSTypeDefinition.hpp:206
TYPE_CATEGORY
Definition XSTypeDefinition.hpp:43
virtual XSNamespaceItem * getNamespaceItem()=0
A namespace schema information item corresponding to the target namespace of the component,...
XSTypeDefinition * fBaseType
Definition XSTypeDefinition.hpp:198
virtual bool getAnonymous() const =0
A boolean that specifies if the type definition is anonymous.
TYPE_CATEGORY getTypeCategory() const
Return whether this type definition is a simple type or complex type.
Definition XSTypeDefinition.hpp:201
bool derivedFrom(const XMLCh *typeNamespace, const XMLCh *name)
Convenience method: check if this type is derived from the given ancestor type.