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: XSTypeDefinition.hpp 1801237 2017-07-07 21:55:11Z scantor $
*/
#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
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition: PlatformUtils.hpp:121
XSObject::getName
virtual const XMLCh * getName() const
The name of type NCName of this declaration as defined in XML Namespaces.
XSObject::getNamespaceItem
virtual XSNamespaceItem * getNamespaceItem()
A namespace schema information item corresponding to the target namespace of the component, if it&#39;s globally declared; or null otherwise.
XSNamespaceItem
Definition: XSNamespaceItem.hpp:53
XSTypeDefinition::fBaseType
XSTypeDefinition * fBaseType
Definition: XSTypeDefinition.hpp:198
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
XSModel
Definition: XSModel.hpp:59
XSTypeDefinition::fTypeCategory
TYPE_CATEGORY fTypeCategory
Definition: XSTypeDefinition.hpp:196
MemoryManager
Configurable memory manager.
Definition: MemoryManager.hpp:39
XSObject::getNamespace
virtual const XMLCh * getNamespace() const
The [target namespace] of this object, or null if it is unspecified.
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:118
XSTypeDefinition::fFinal
short fFinal
Definition: XSTypeDefinition.hpp:197
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
XSTypeDefinition::TYPE_CATEGORY
TYPE_CATEGORY
Definition: XSTypeDefinition.hpp:43
XSObject
Definition: XSObject.hpp:42
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
XSTypeDefinition::getFinal
short getFinal() const
For complex types the returned value is a bit combination of the subset of {DERIVATION_EXTENSION, DERIVATION_RESTRICTION} corresponding to final set of this type or DERIVATION_NONE.
Definition: XSTypeDefinition.hpp:206
XSObject.hpp
XSTypeDefinition::getTypeCategory
TYPE_CATEGORY getTypeCategory() const
Return whether this type definition is a simple type or complex type.
Definition: XSTypeDefinition.hpp:201
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition: XSTypeDefinition.hpp:39