Home » xml-commons-external-1.4.01-src » org.xml » sax » helpers » [javadoc | source]
final class: NamespaceSupport.Context [javadoc | source]
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). Also, data structures used to represent contexts are shared when possible (child contexts without declarations) to further reduce the amount of memory that's consumed.

Field Summary
 Hashtable prefixTable     
 Hashtable uriTable     
 Hashtable elementNameTable     
 Hashtable attributeNameTable     
 String defaultNS     
Method from org.xml.sax.helpers.NamespaceSupport$Context Summary:
clear,   declarePrefix,   getDeclaredPrefixes,   getPrefix,   getPrefixes,   getURI,   processName,   setParent
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.xml.sax.helpers.NamespaceSupport$Context Detail:
  void clear() 
    Makes associated state become collectible, invalidating this context. #setParent must be called before this context may be used again.
  void declarePrefix(String prefix,
    String uri) 
    Declare a Namespace prefix for this context.
 Enumeration getDeclaredPrefixes() 
    Return an enumeration of prefixes declared in this context.
 String getPrefix(String uri) 
    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.

 Enumeration getPrefixes() 
    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.

 String getURI(String prefix) 
    Look up the URI associated with a prefix in this context.
 String[] processName(String qName,
    boolean isAttribute) 
    Process an XML qualified name in this context.
  void setParent(Context parent) 
    (Re)set the parent of this Namespace context. The context must either have been freshly constructed, or must have been cleared.