2005/5/9

     
 

class Context

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

org::xml::sax::helpers::Context Class Reference

#include <NamespaceSupport.h>

Inheritance diagram for org::xml::sax::helpers::Context:

acdk::lang::Object acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

Internal class for a single Namespace context.

This module caches and reuses Namespace contexts, so the number allocated will be equal to the element depth of the document, not to the total number of elements (i.e. 5-10 rather than tens of thousands).


Public Member Functions

 Context ()
 Create the root-level Namespace context.

void setParent (IN(RContext) parent)
 (Re)set the parent of this Namespace context.

void declarePrefix (IN(RString) prefix, IN(RString) uri)
 Declare a Namespace prefix for this context.

RStringArray processName (IN(RString) qName, bool isAttribute)
 Process a raw XML 1.0 name in this context.

RString getURI (IN(RString) prefix)
 Look up the URI associated with a prefix in this context.

RString getPrefix (IN(RString) uri)
 Look up one of the prefixes associated with a URI in this context.

acdk::util::RIterator getDeclaredPrefixes ()
 Return an enumeration of prefixes declared in this context.

acdk::util::RIterator getPrefixes ()
 Return an enumeration of all prefixes currently in force.

void copyTables ()
 Copy on write for the internal tables in this context.


Protected Attributes

acdk::util::RHashMap prefixTable
acdk::util::RHashMap uriTable
acdk::util::RHashMap elementNameTable
acdk::util::RHashMap attributeNameTable
RString defaultNS

Private Attributes

RStringArray declarations
bool tablesDirty
RContext parent


Constructor & Destructor Documentation

org::xml::sax::helpers::Context::Context  )  [inline]
 

Create the root-level Namespace context.


Member Function Documentation

void org::xml::sax::helpers::Context::copyTables  ) 
 

Copy on write for the internal tables in this context.

This class is optimized for the normal case where most elements do not contain Namespace declarations.

void org::xml::sax::helpers::Context::declarePrefix IN(RString prefix,
IN(RString uri
 

Declare a Namespace prefix for this context.

Parameters:
prefix The prefix to declare.
uri The associated Namespace URI.
See also:
org::xml::sax::helpers::NamespaceSupport::declarePrefix

acdk::util::RIterator org::xml::sax::helpers::Context::getDeclaredPrefixes  )  [inline]
 

Return an enumeration of prefixes declared in this context.

Returns:
An enumeration of prefixes (possibly empty).
See also:
org::xml::sax::helpers::NamespaceSupport::getDeclaredPrefixes

RString org::xml::sax::helpers::Context::getPrefix IN(RString uri  )  [inline]
 

Look up one of the prefixes associated with a URI in this context.

Since many prefixes may be mapped to the same URI, the return value may be unreliable.

Parameters:
uri The URI to look up.
Returns:
The associated prefix, or null if none is declared.
See also:
org::xml::sax::helpers::NamespaceSupport::getPrefix

acdk::util::RIterator org::xml::sax::helpers::Context::getPrefixes  )  [inline]
 

Return an enumeration of all prefixes currently in force.

The default prefix, if in force, is not returned, and will have to be checked for separately.

Returns:
An enumeration of prefixes (never empty).
See also:
org::xml::sax::helpers::NamespaceSupport::getPrefixes

RString org::xml::sax::helpers::Context::getURI IN(RString prefix  ) 
 

Look up the URI associated with a prefix in this context.

Parameters:
prefix The prefix to look up.
Returns:
The associated Namespace URI, or null if none is declared.
See also:
org::xml::sax::helpers::NamespaceSupport::getURI

RStringArray org::xml::sax::helpers::Context::processName IN(RString qName,
bool  isAttribute
 

Process a raw XML 1.0 name in this context.

Parameters:
qName The raw XML 1.0 name.
isAttribute true if this is an attribute name.
Returns:
An array of three strings containing the URI part (or empty string), the local part, and the raw name, all internalized, or null if there is an undeclared prefix.
See also:
org::xml::sax::helpers::NamespaceSupport::processName

void org::xml::sax::helpers::Context::setParent IN(RContext parent  ) 
 

(Re)set the parent of this Namespace context.

Parameters:
context The parent Namespace context object.


Member Data Documentation

acdk::util::RHashMap org::xml::sax::helpers::Context::attributeNameTable [protected]
 

RStringArray org::xml::sax::helpers::Context::declarations [private]
 

RString org::xml::sax::helpers::Context::defaultNS [protected]
 

acdk::util::RHashMap org::xml::sax::helpers::Context::elementNameTable [protected]
 

RContext org::xml::sax::helpers::Context::parent [private]
 

acdk::util::RHashMap org::xml::sax::helpers::Context::prefixTable [protected]
 

bool org::xml::sax::helpers::Context::tablesDirty [private]
 

acdk::util::RHashMap org::xml::sax::helpers::Context::uriTable [protected]