XMLEntityDecl Class Referenceabstract

This class defines that core information that defines an XML entity, no matter what validator is used. More...

`#include <xercesc/framework/XMLEntityDecl.hpp>`

Inheritance diagram for XMLEntityDecl:

## Public Member Functions

Constructors
| XMLEntityDecl (MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
| Default Constructor.
| XMLEntityDecl (const XMLCh *const entName, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
| Constructor with a const entity name.
| XMLEntityDecl (const XMLCh *const entName, const XMLCh *const value, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
| Constructor with a const entity name and value.
| XMLEntityDecl (const XMLCh *const entName, const XMLCh value, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
| Constructor with a const entity name and single XMLCh value.
Destructor
virtual | ~XMLEntityDecl ()
| Default destructor.
The pure virtual methods in this interface.
virtual bool | getDeclaredInIntSubset () const =0
| Get the 'declared in internal subset' flag.
virtual bool | getIsParameter () const =0
| Get the 'is parameter entity' flag.
virtual bool | getIsSpecialChar () const =0
| Get the 'is special char entity' flag.
Getter methods
XMLSize_t | getId () const
| Gets the pool id of this entity.
const XMLCh * | getName () const
| Returns a const pointer to the name of this entity decl.
const XMLCh * | getNotationName () const
| Gets the notation name, if any, declared for this entity.
const XMLCh * | getPublicId () const
| Gets the public id declared for this entity.
const XMLCh * | getSystemId () const
| Gets the system id declared for this entity.
const XMLCh * | getBaseURI () const
| Gets the base URI for this entity.
const XMLCh * | getValue () const
| This method returns the value of an internal entity.
XMLSize_t | getValueLen () const
| This method returns the number of characters in the value returned by getValue().
bool | isExternal () const
| Indicates that this entity is an external entity.
bool | isUnparsed () const
| Indicates whether this entity is unparsed.
MemoryManager * | getMemoryManager () const
| Get the plugged-in memory manager.
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.

## Setter methods

void | setName (const XMLCh *const entName)
| This method will set the entity name.
void | setIsExternal (bool value)
| This method will mark whether the entity is external.
void | setNotationName (const XMLCh *const newName)
| This method will set the notation name for this entity.
void | setPublicId (const XMLCh *const newId)
| This method will set a new public id on this entity.
void | setSystemId (const XMLCh *const newId)
| This method will set a new sysetm id on this entity.
void | setBaseURI (const XMLCh *const newId)
| This method will set a new baseURI on this entity.
void | setValue (const XMLCh *const newValue)
| This method will set a new value for this entity.
void | setId (const XMLSize_t newId)
const XMLCh * | getKey () const
| This method allows objects of this class to be used within a standard keyed collection used commonly within the parser system.

## Additional Inherited Members

Protected Member Functions inherited from XMemory
| XMemory ()
| Protected default constructor.

## Detailed Description

This class defines that core information that defines an XML entity, no matter what validator is used.

Each validator will create a derivative of this class which adds any extra information it requires.

This class supports keyed collection semantics via the getKey() method which extracts the key field, the entity name in this case. The name will have whatever form is deemed appropriate for the type of validator in use.

When setting the fields of this class, you must make sure that you do not set conflicting values. For instance, an internal entity cannot have a notation name. And an external entity cannot have a value string. These rules are defined by the XML specification. In most cases, these objects are created by validator objects as they parse a DTD or Schema or whatever, at which time they confirm the correctness of the data before creating the entity decl object.

## Constructor & Destructor Documentation

## XMLEntityDecl() [1/4]

XMLEntityDecl::XMLEntityDecl | ( | MemoryManager *const | manager = XMLPlatformUtils::fgMemoryManager | ) |

Default Constructor.

## XMLEntityDecl() [2/4]

XMLEntityDecl::XMLEntityDecl | ( | const XMLCh *const | entName,
|  | MemoryManager *const | manager = XMLPlatformUtils::fgMemoryManager )

Constructor with a const entity name.

Parameters

  entName | The new name to give to this entity.
  manager | Pointer to the memory manager to be used to allocate objects.

## XMLEntityDecl() [3/4]

XMLEntityDecl::XMLEntityDecl | ( | const XMLCh *const | entName,
|  | const XMLCh *const | value,
|  | MemoryManager *const | manager = XMLPlatformUtils::fgMemoryManager )

Constructor with a const entity name and value.

Parameters

  entName | The new name to give to this entity.
  value | The new value to give to this entity name.
  manager | Pointer to the memory manager to be used to allocate objects.

## XMLEntityDecl() [4/4]

XMLEntityDecl::XMLEntityDecl | ( | const XMLCh *const | entName,
|  | const XMLCh | value,
|  | MemoryManager *const | manager = XMLPlatformUtils::fgMemoryManager )

Constructor with a const entity name and single XMLCh value.

Parameters

  entName | The new name to give to this entity.
  value | The new value to give to this entity name.
  manager | Pointer to the memory manager to be used to allocate objects.

## ~XMLEntityDecl()

virtual XMLEntityDecl::~XMLEntityDecl | ( |  | ) |

virtual

Default destructor.

## Member Function Documentation

## getBaseURI()

const XMLCh * XMLEntityDecl::getBaseURI | ( |  | ) | const

Gets the base URI for this entity.

## getDeclaredInIntSubset()

virtual bool XMLEntityDecl::getDeclaredInIntSubset | ( |  | ) | const

pure virtual

Get the 'declared in internal subset' flag.

Gets the state of the flag which indicates whether the entity was declared in the internal or external subset. Some structural description languages might not have an internal subset concept, in which case this will always return false.

## getId()

XMLSize_t XMLEntityDecl::getId | ( |  | ) | const

Gets the pool id of this entity.

Validators maintain all decls in pools, from which they can be quickly extracted via id.

## getIsParameter()

virtual bool XMLEntityDecl::getIsParameter | ( |  | ) | const

pure virtual

Get the 'is parameter entity' flag.

Gets the state of the flag which indicates whether this entity is a parameter entity. If not, then its a general entity.

## getIsSpecialChar()

virtual bool XMLEntityDecl::getIsSpecialChar | ( |  | ) | const

pure virtual

Get the 'is special char entity' flag.

Gets the state of the flag that indicates whether this entity is one of the special, intrinsically supported character entities.

## getKey()

const XMLCh * XMLEntityDecl::getKey | ( |  | ) | const

This method allows objects of this class to be used within a standard keyed collection used commonly within the parser system.

The collection calls this method to get the key (usually to hash it) by which the object is to be stored.

## getMemoryManager()

MemoryManager * XMLEntityDecl::getMemoryManager | ( |  | ) | const

Get the plugged-in memory manager.

This method returns the plugged-in memory manager user for dynamic memory allocation/deallocation.

Returns
  the plugged-in memory manager

## getName()

const XMLCh * XMLEntityDecl::getName | ( |  | ) | const

Returns a const pointer to the name of this entity decl.

This name will be in whatever format is appropriate for the type of validator in use.

## getNotationName()

const XMLCh * XMLEntityDecl::getNotationName | ( |  | ) | const

Gets the notation name, if any, declared for this entity.

If this entity is not a notation type entity, it will be a null pointer.

## getPublicId()

const XMLCh * XMLEntityDecl::getPublicId | ( |  | ) | const

Gets the public id declared for this entity.

Public ids are optional so it can be a null pointer.

## getSystemId()

const XMLCh * XMLEntityDecl::getSystemId | ( |  | ) | const

Gets the system id declared for this entity.

The system id is required so this method should never return a null pointers.

## getValue()

const XMLCh * XMLEntityDecl::getValue | ( |  | ) | const

This method returns the value of an internal entity.

If this is not an internal entity (i.e. its external), then this will be a null pointer.

## getValueLen()

XMLSize_t XMLEntityDecl::getValueLen | ( |  | ) | const

This method returns the number of characters in the value returned by getValue().

If this entity is external, this will be zero since an external entity has no internal value.

## isExternal()

bool XMLEntityDecl::isExternal | ( |  | ) | const

Indicates that this entity is an external entity.

If not, then it is assumed to be an internal entity, surprise.

## isUnparsed()

bool XMLEntityDecl::isUnparsed | ( |  | ) | const

Indicates whether this entity is unparsed.

This is meaningless for internal entities. Some external entities are unparsed in that they refer to something other than XML source.

## setBaseURI()

void XMLEntityDecl::setBaseURI | ( | const XMLCh *const | newId | ) |

This method will set a new baseURI on this entity.

This will then control the URI used to resolve the relative system Id.

Parameters

  newId | The new base URI to give to the entity.

References MemoryManager::deallocate(), and XMLString::replicate().

## setId()

void XMLEntityDecl::setId | ( | const XMLSize_t | newId | ) |

## setIsExternal()

void XMLEntityDecl::setIsExternal | ( | bool | value | ) |

This method will mark whether the entity is external.

Parameters

  value | The new value for the 'is external' flag.

## setName()

void XMLEntityDecl::setName | ( | const XMLCh *const | entName | ) |

This method will set the entity name.

The format of this name is defined by the particular validator in use, since it will be the one who creates entity definitions as it parses the DTD, Schema, ect...

Parameters

  entName | The new name to give to this entity.

## setNotationName()

void XMLEntityDecl::setNotationName | ( | const XMLCh *const | newName | ) |

This method will set the notation name for this entity.

By setting this, you are indicating that this is an unparsed external entity.

Parameters

  newName | The new notation name to give to this entity.

References MemoryManager::deallocate(), and XMLString::replicate().

## setPublicId()

void XMLEntityDecl::setPublicId | ( | const XMLCh *const | newId | ) |

This method will set a new public id on this entity.

The public id has no particular form and is purely for client consumption.

Parameters

  newId | The new public id to give to this entity.

References MemoryManager::deallocate(), and XMLString::replicate().

## setSystemId()

void XMLEntityDecl::setSystemId | ( | const XMLCh *const | newId | ) |

This method will set a new sysetm id on this entity.

This will then control where the source for this entity lives. If it is an internal entity, then the system id is only for bookkeeping purposes, and to allow any external entities referenced from within the entity to be correctly resolved.

Parameters

  newId | The new system id to give to the entity.

References MemoryManager::deallocate(), and XMLString::replicate().

## setValue()

void XMLEntityDecl::setValue | ( | const XMLCh *const | newValue | ) |

This method will set a new value for this entity.

This is only valid if the entity is to be an internal entity. By setting this field, you are indicating that the entity is internal.

Parameters

  newValue | The new value to give to this entity.

References MemoryManager::deallocate(), XMLString::replicate(), and XMLString::stringLen().

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

- XMLEntityDecl.hpp