class XMLAttDef

Represents the core information of an atribute definition This class defines the basic characteristics of an attribute, no matter what type of validator is used

Inheritance:


Public Methods

static const XMLCh* getAttTypeString (const AttTypes attrType)
Get a string representation of the passed attribute type enum This method allows you to get a textual representation of an attriubte type, mostly for debug or display
static const XMLCh* getDefAttTypeString (const DefAttTypes attrType)
Get a string representation of the passed def attribute type enum This method allows you to get a textual representation of an default attributetype, mostly for debug or display
DefAttTypes getDefaultType () const
Get the default type of this attribute type This method returns the 'default type' of the attribute
const XMLCh* getEnumeration () const
Get the enumeration value (if any) of this attribute type If the attribute is of an enumeration or notatin type, then this method will return a const reference to a string that contains the space separated values that can the attribute can have
virtual const XMLCh* getFullName () const
Get the full name of this attribute type The derived class should return a const pointer to the full name of this attribute
unsigned int getId () const
Get the pool id of this attribute type This method will return the id of this attribute in the validator's attribute pool
const XMLCh* getKey () const
Support keyed collections for attribute types This method allows this class to meet the standard semantics for some commnly used internal hashed or keyed collection classes
bool getProvided () const
Query whether the attribute was explicitly provided
AttTypes getType () const
Get the type of this attribute Gets the type of this attribute
const XMLCh* getValue () const
Get the default/fixed value of this attribute (if any
void setDefaultType (const XMLAttDef::DefAttTypes newValue)
Set the default attribute type This method sets the default attribute type for this attribute
void setEnumeration (const XMLCh* const newValue)
Set the enumerated value of this attribute type
void setId (const unsigned int newId)
Set the pool id for this attribute type
void setProvided (const bool newValue)
Set or clear the 'provided' flag
void setType (const XMLAttDef::AttTypes newValue)
Set the type of this attribute type
void setValue (const XMLCh* const newValue)
Set the default/fixed value of this attribute type

Public

Destructor
virtual ~XMLAttDef ()
Destructor
Getter methods
Public, static methods
Setter methods
Virtual interface

Documentation

Represents the core information of an atribute definition This class defines the basic characteristics of an attribute, no matter what type of validator is used. If a particular schema associates more information with an attribute it will create a derivative of this class. So this class provides an abstract way to get basic information on attributes from any type of validator. This class supports keyed collection semantics on the fully qualified attribute name, by providing a getKey() method to extract the key string. getKey(), in this case, just calls the virtual method getFullName() to get the fully qualified name, as defined by the derived class. Note that the 'value' of an attribute type definition is the default or of fixed value given to it in its definition. If the attribute is of the enumerated or notation type, it will have an 'enumeration value' as well which is a space separated list of its possible vlaues.
Public, static methods

static const XMLCh* getAttTypeString(const AttTypes attrType)
Get a string representation of the passed attribute type enum This method allows you to get a textual representation of an attriubte type, mostly for debug or display.
Returns:
A const pointer to the static string that holds the text description of the passed type.
Parameters:
attrType - The attribute type value to get the string for.

static const XMLCh* getDefAttTypeString(const DefAttTypes attrType)
Get a string representation of the passed def attribute type enum This method allows you to get a textual representation of an default attributetype, mostly for debug or display.
Returns:
A const pointer to the static string that holds the text description of the passed default type.
Parameters:
attrType - The default attribute type value to get the string for.

Destructor

virtual ~XMLAttDef()
Destructor

Virtual interface

virtual const XMLCh* getFullName() const
Get the full name of this attribute type The derived class should return a const pointer to the full name of this attribute. This will vary depending on the type of validator in use.
Returns:
A const pointer to the full name of this attribute type.

Getter methods

DefAttTypes getDefaultType() const
Get the default type of this attribute type This method returns the 'default type' of the attribute. Default type in this case refers to the XML concept of a default type for an attribute, i.e. #FIXED, #IMPLIED, etc...
Returns:
The default type enum for this attribute type.

const XMLCh* getEnumeration() const
Get the enumeration value (if any) of this attribute type If the attribute is of an enumeration or notatin type, then this method will return a const reference to a string that contains the space separated values that can the attribute can have.
Returns:
A const pointer to a string that contains the space separated legal values for this attribute.

unsigned int getId() const
Get the pool id of this attribute type This method will return the id of this attribute in the validator's attribute pool. It was set by the validator when this attribute was created.
Returns:
The pool id of this attribute type.

const XMLCh* getKey() const
Support keyed collections for attribute types This method allows this class to meet the standard semantics for some commnly used internal hashed or keyed collection classes. What it returns depends upon the derived class because it is just an inline passthrough to getFullName().
Returns:
A const pointer to the string that makes up the collection key for instances of this object.

bool getProvided() const
Query whether the attribute was explicitly provided. When the scanner scans a start tag, it will ask the element decl object of the element type of that start tag to clear the 'provided' flag on all its attributes. As the scanner sees explicitly provided attributes, its turns on this flag to indicate that this attribute has been provided. In this way, the scanner can catch duplicated attributes and required attributes that aren't provided, and default in fixed/default valued attributes that are not explicitly provided.
Returns:
Returns a boolean value that indicates whether this attribute was explicitly provided.

AttTypes getType() const
Get the type of this attribute Gets the type of this attribute. This type is represented by an enum that convers the types of attributes allowed by XML, e.g. CDATA, NMTOKEN, NOTATION, etc...
Returns:
The attribute type enumeration value for this type of attribute.

const XMLCh* getValue() const
Get the default/fixed value of this attribute (if any.) If the attribute defined a default/fixed value, then it is stored and this method will retrieve it. If it has non, then a null pointer is returned.
Returns:
A const pointer to the default/fixed value for this attribute type.

Setter methods

void setDefaultType(const XMLAttDef::DefAttTypes newValue)
Set the default attribute type This method sets the default attribute type for this attribute. This setting controls whether the attribute is required, fixed, implied, etc...
Parameters:
The - new default attribute to set

void setId(const unsigned int newId)
Set the pool id for this attribute type. This method sets the pool id of this attribute type. This is usually called by the validator that creates the actual instance (which is of a derived type known only by the validator.)
Parameters:
The - new pool id to set.

void setProvided(const bool newValue)
Set or clear the 'provided' flag. This method will set or clear the 'provided' flag. This is called by the scanner as it is scanning a start tag and marking off the attributes that have been explicitly provided.
Parameters:
The - new provided state to set

void setType(const XMLAttDef::AttTypes newValue)
Set the type of this attribute type. This method will set the type of the attribute. The type of an attribute controls how it is normalized and what kinds of characters it can hold.
Parameters:
The - new attribute type to set

void setValue(const XMLCh* const newValue)
Set the default/fixed value of this attribute type. This method set the fixed/default value for the attribute. This value will be used when instances of this attribute type are faulted in. It must be a valid value for the type set by setType(). If the type is enumeration or notation, this must be one of the valid values set in the setEnumeration() call.
Parameters:
The - new fixed/default value to set.

void setEnumeration(const XMLCh* const newValue)
Set the enumerated value of this attribute type. This method sets the enumerated/notation value list for this attribute type. It is a space separated set of possible values. These values must meet the constrains of the XML spec for such values of this type of attribute. This should only be set if the setType() method is used to set the type to the enumeration or notation types.
Parameters:
The - new enumerated/notation value list to set.


This class has no child classes.

alphabetic index hierarchy of classes


Xerces-C XML Parser for C++ Version 1.1
Copyright © 2000 The Apache Software Foundation. All Rights Reserved.

generated by doc++