XSTypeDefinition Class Referenceabstract

This class represents a complexType or simpleType definition. More...

`#include <xercesc/framework/psvi/XSTypeDefinition.hpp>`

Inheritance diagram for XSTypeDefinition:

## Public Types

enum | TYPE_CATEGORY { COMPLEX_TYPE = 15 , SIMPLE_TYPE = 16 }

## Public Member Functions

Constructors
| XSTypeDefinition (TYPE_CATEGORY typeCategory, XSTypeDefinition *const xsBaseType, XSModel *const xsModel, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
| The default constructor.
Destructor
virtual | ~XSTypeDefinition ()
overloaded XSObject methods
virtual const XMLCh * | getName () const =0
| The name of type `NCName` of this declaration as defined in XML Namespaces.
virtual const XMLCh * | getNamespace () const =0
| The [target namespace] of this object, or `null` if it is unspecified.
virtual XSNamespaceItem * | getNamespaceItem ()=0
| A namespace schema information item corresponding to the target namespace of the component, if it's globally declared; or null otherwise.
Public Member Functions inherited from XSObject
| XSObject (XSConstants::COMPONENT_TYPE compType, XSModel *const xsModel, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
| The default constructor.
virtual | ~XSObject ()
XSConstants::COMPONENT_TYPE | getType () const
| The `type` of this object, i.e.
virtual XMLSize_t | getId () const
| Optional.
void | setId (XMLSize_t id)
| methods needed by implementation
Public Member Functions inherited from XMemory
void * | operator new (size_t size)
| This method overrides operator new.
void * | operator new (size_t size, MemoryManager *memMgr)
| This method defines a custom operator new, that will use the provided memory manager to perform the allocation.
void * | operator new (size_t size, void *ptr)
| This method overrides placement operator new.
void | operator delete (void *p)
| This method overrides operator delete.
void | operator delete (void *p, MemoryManager *memMgr)
| This method provides a matching delete for the custom operator new.
void | operator delete (void *p, void *ptr)
| This method provides a matching delete for the placement new.

## XSTypeDefinition methods

TYPE_CATEGORY | fTypeCategory
short | fFinal
XSTypeDefinition * | fBaseType
TYPE_CATEGORY | getTypeCategory () const
| Return whether this type definition is a simple type or complex type.
virtual XSTypeDefinition * | getBaseType ()=0
| {base type definition}: either a simple type definition or a complex type definition.
bool | isFinal (short toTest)
| {final}.
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`.
virtual bool | getAnonymous () const =0
| A boolean that specifies if the type definition is anonymous.
virtual bool | derivedFromType (const XSTypeDefinition *const ancestorType)=0
| Convenience method: check if this type is derived from the given `ancestorType`.
bool | derivedFrom (const XMLCh *typeNamespace, const XMLCh *name)
| Convenience method: check if this type is derived from the given ancestor type.

## Additional Inherited Members

Protected Member Functions inherited from XMemory
| XMemory ()
| Protected default constructor.
Protected Attributes inherited from XSObject
XSConstants::COMPONENT_TYPE | fComponentType
XSModel * | fXSModel
MemoryManager * | fMemoryManager
XMLSize_t | fId

## Detailed Description

This class represents a complexType or simpleType definition.

This is always owned by the validator /parser object from which it is obtained.

## Member Enumeration Documentation

## TYPE_CATEGORY

enum XSTypeDefinition::TYPE_CATEGORY

Enumerator
COMPLEX_TYPE | This constant value signifies a complex type.
SIMPLE_TYPE | This constant value signifies a simple type.

## Constructor & Destructor Documentation

## XSTypeDefinition()

XSTypeDefinition::XSTypeDefinition | ( | TYPE_CATEGORY | typeCategory,
|  | XSTypeDefinition *const | xsBaseType,
|  | XSModel *const | xsModel,
|  | MemoryManager *const | manager = XMLPlatformUtils::fgMemoryManager )

The default constructor.

Parameters

  typeCategory |
  xsBaseType |
  xsModel |
  manager | The configurable memory manager

## ~XSTypeDefinition()

virtual XSTypeDefinition::~XSTypeDefinition | ( |  | ) |

virtual

## Member Function Documentation

## derivedFrom()

bool XSTypeDefinition::derivedFrom | ( | const XMLCh * | typeNamespace,
|  | const XMLCh * | name )

Convenience method: check if this type is derived from the given ancestor type.

Parameters

  typeNamespace | An ancestor type namespace.
  name | An ancestor type name.

Returns
  Return true if this type is derived from the ancestor defined by `typeNamespace` and `name`.

## derivedFromType()

virtual bool XSTypeDefinition::derivedFromType | ( | const XSTypeDefinition *const | ancestorType | ) |

pure virtual

Convenience method: check if this type is derived from the given `ancestorType`.

Parameters

  ancestorType | An ancestor type definition.

Returns
  Return true if this type is derived from `ancestorType`.

Implemented in XSComplexTypeDefinition, and XSSimpleTypeDefinition.

## getAnonymous()

virtual bool XSTypeDefinition::getAnonymous | ( |  | ) | const

pure virtual

A boolean that specifies if the type definition is anonymous.

Convenience attribute.

Implemented in XSComplexTypeDefinition, and XSSimpleTypeDefinition.

## getBaseType()

virtual XSTypeDefinition * XSTypeDefinition::getBaseType | ( |  | ) |

pure virtual

{base type definition}: either a simple type definition or a complex type definition.

Implemented in XSComplexTypeDefinition, and XSSimpleTypeDefinition.

## getFinal()

short XSTypeDefinition::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`.

For simple types the returned value is a bit combination of the subset of { `DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST` } corresponding to `final` set of this type or `DERIVATION_NONE`.

References fFinal.

## getName()

virtual const XMLCh * XSTypeDefinition::getName | ( |  | ) | const

pure virtual

The name of type `NCName` of this declaration as defined in XML Namespaces.

Reimplemented from XSObject.

Implemented in XSComplexTypeDefinition, and XSSimpleTypeDefinition.

## getNamespace()

virtual const XMLCh * XSTypeDefinition::getNamespace | ( |  | ) | const

pure virtual

The [target namespace] of this object, or `null` if it is unspecified.

Reimplemented from XSObject.

Implemented in XSComplexTypeDefinition, and XSSimpleTypeDefinition.

## getNamespaceItem()

virtual XSNamespaceItem * XSTypeDefinition::getNamespaceItem | ( |  | ) |

pure virtual

A namespace schema information item corresponding to the target namespace of the component, if it's globally declared; or null otherwise.

Reimplemented from XSObject.

Implemented in XSComplexTypeDefinition, and XSSimpleTypeDefinition.

## getTypeCategory()

XSTypeDefinition::TYPE_CATEGORY XSTypeDefinition::getTypeCategory | ( |  | ) | const

Return whether this type definition is a simple type or complex type.

References fTypeCategory.

## isFinal()

bool XSTypeDefinition::isFinal | ( | short | toTest | ) |

{final}.

For complex type definition it is a subset of {extension, restriction}. For simple type definition it is a subset of {extension, list, restriction, union}.

Parameters

  toTest | Extension, restriction, list, union constants (defined in `XSObject`).

Returns
  True if toTest is in the final set, otherwise false.

## Member Data Documentation

## fBaseType

XSTypeDefinition* XSTypeDefinition::fBaseType

protected

## fFinal

short XSTypeDefinition::fFinal

protected

Referenced by getFinal().

## fTypeCategory

TYPE_CATEGORY XSTypeDefinition::fTypeCategory

protected

Referenced by getTypeCategory().

The documentation for this class was generated from the following file:

- XSTypeDefinition.hpp