XSTypeDefinition.hpp
Go to the documentation of this file.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id$
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSTYPEDEFINITION_HPP)
#define XERCESC_INCLUDE_GUARD_XSTYPEDEFINITION_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
XERCES_CPP_NAMESPACE_BEGIN
// forward declarations
class XSNamespaceItem;
class XMLPARSER_EXPORT XSTypeDefinition : public XSObject
{
public:
enum TYPE_CATEGORY {
COMPLEX_TYPE = 15,
SIMPLE_TYPE = 16
};
// Constructors and Destructor
// -----------------------------------------------------------------------
XSTypeDefinition
(
TYPE_CATEGORY typeCategory
, XSTypeDefinition* const xsBaseType
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
virtual ~XSTypeDefinition();
//---------------------
virtual const XMLCh* getName() const = 0;
virtual const XMLCh* getNamespace() const = 0;
virtual XSNamespaceItem *getNamespaceItem() = 0;
//---------------------
TYPE_CATEGORY getTypeCategory() const;
virtual XSTypeDefinition *getBaseType() = 0;
bool isFinal(short toTest);
short getFinal() const;
virtual bool getAnonymous() const = 0;
virtual bool derivedFromType(const XSTypeDefinition* const ancestorType) = 0;
bool derivedFrom(const XMLCh* typeNamespace,
const XMLCh* name);
//----------------------------------
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSTypeDefinition(const XSTypeDefinition&);
XSTypeDefinition & operator=(const XSTypeDefinition &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
// fTypeCategory
// whether this is a simpleType or complexType
// fFinal
// the final properties which is set by the derived class.
TYPE_CATEGORY fTypeCategory;
short fFinal;
XSTypeDefinition* fBaseType; // owned by XSModel
};
inline XSTypeDefinition::TYPE_CATEGORY XSTypeDefinition::getTypeCategory() const
{
return fTypeCategory;
}
inline short XSTypeDefinition::getFinal() const
{
return fFinal;
}
XERCES_CPP_NAMESPACE_END
#endif
XSObject.hpp
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:120
MemoryManager
Configurable memory manager.
Definition: MemoryManager.hpp:40
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition: PlatformUtils.hpp:121
XSModel
Definition: XSModel.hpp:60
XSNamespaceItem
Definition: XSNamespaceItem.hpp:54
XSObject
Definition: XSObject.hpp:43
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition: XSTypeDefinition.hpp:40
XSTypeDefinition::getName
virtual const XMLCh * getName() const =0
The name of type NCName of this declaration as defined in XML Namespaces.
XSTypeDefinition::isFinal
bool isFinal(short toTest)
{final}.
XSTypeDefinition::fFinal
short fFinal
Definition: XSTypeDefinition.hpp:197
XSTypeDefinition::derivedFromType
virtual bool derivedFromType(const XSTypeDefinition *const ancestorType)=0
Convenience method: check if this type is derived from the given ancestorType.
XSTypeDefinition::getNamespace
virtual const XMLCh * getNamespace() const =0
The [target namespace] of this object, or null if it is unspecified.
XSTypeDefinition::getBaseType
virtual XSTypeDefinition * getBaseType()=0
{base type definition}: either a simple type definition or a complex type definition.
XSTypeDefinition::XSTypeDefinition
XSTypeDefinition(TYPE_CATEGORY typeCategory, XSTypeDefinition *const xsBaseType, XSModel *const xsModel, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.
XSTypeDefinition::~XSTypeDefinition
virtual ~XSTypeDefinition()
XSTypeDefinition::fTypeCategory
TYPE_CATEGORY fTypeCategory
Definition: XSTypeDefinition.hpp:196
XSTypeDefinition::getFinal
short getFinal() const
For complex types the returned value is a bit combination of the subset of {DERIVATION_EXTENSION,...
Definition: XSTypeDefinition.hpp:206
XSTypeDefinition::TYPE_CATEGORY
TYPE_CATEGORY
Definition: XSTypeDefinition.hpp:43
XSTypeDefinition::getNamespaceItem
virtual XSNamespaceItem * getNamespaceItem()=0
A namespace schema information item corresponding to the target namespace of the component,...
XSTypeDefinition::fBaseType
XSTypeDefinition * fBaseType
Definition: XSTypeDefinition.hpp:198
XSTypeDefinition::getAnonymous
virtual bool getAnonymous() const =0
A boolean that specifies if the type definition is anonymous.
XSTypeDefinition::getTypeCategory
TYPE_CATEGORY getTypeCategory() const
Return whether this type definition is a simple type or complex type.
Definition: XSTypeDefinition.hpp:201
XSTypeDefinition::derivedFrom
bool derivedFrom(const XMLCh *typeNamespace, const XMLCh *name)
Convenience method: check if this type is derived from the given ancestor type.