| java.lang.Object org.apache.cocoon.components.serializers.util.Namespaces
Namespaces | public class Namespaces (Code) | | The Namespaces class is an utility class implementing a
stack for XML namespaces declarations.
author: Pier Fumagalli, February 2003 version: CVS $Id: Namespaces.java 433543 2006-08-22 06:22:54Z crossley $ |
Field Summary | |
final public static int | NAMESPACE_PREFIX The index of the namespace prefix in for commit() . | final public static int | NAMESPACE_URI The index of the namespace uri in for commit() . |
Constructor Summary | |
public | Namespaces() Create a new Namespaces instance. |
Method Summary | |
public String[][] | commit() Checkpoint this stack, returning the list of all namespaces added since
the last commit() or pop(...) call. | public String | getPrefix(String nsuri) Return the namespace prefix associated with the specified URI. | public String | getUri(String prefix) Return the namespace URI associated with the specified prefix. | public synchronized void | pop(String prefix) Pop a new namespace declaration out of this stack. | public synchronized void | push(String prefix, String uri) Push a new namespace declaration into this stack. | public String | qualify(String nsuri, String local, String qualified) Qualify an XML name. |
NAMESPACE_PREFIX | final public static int NAMESPACE_PREFIX(Code) | | The index of the namespace prefix in for commit() .
|
NAMESPACE_URI | final public static int NAMESPACE_URI(Code) | | The index of the namespace uri in for commit() .
|
Namespaces | public Namespaces()(Code) | | Create a new Namespaces instance.
|
commit | public String[][] commit()(Code) | | Checkpoint this stack, returning the list of all namespaces added since
the last commit() or pop(...) call.
|
pop | public synchronized void pop(String prefix) throws SAXException(Code) | | Pop a new namespace declaration out of this stack.
If more than one namespace is associated with the specified namespace,
only the last pushed namespace will be popped out.
Parameters: prefix - The prefix to associate with the specified URI. throws: SAXException - If the prefix was not mapped in this stack. |
push | public synchronized void push(String prefix, String uri)(Code) | | Push a new namespace declaration into this stack.
Parameters: prefix - The prefix to associate with the specified URI. Parameters: uri - The URI associated with the namespace. |
qualify | public String qualify(String nsuri, String local, String qualified) throws SAXException(Code) | | Qualify an XML name.
Given a URI, local name and qualified name as passed to the SAX
ContentHandler interface in the startElement()
method, this method will always return a valid XML name token usable
for serialization (checking namespaces URIs and prefixes).
Parameters: nsuri - The Namespace URI, or the empty string if the element hasno namespace URI or if namespace processing is not beingperformed. Parameters: local - The local name (without prefix), or the empty string ifnamespace processing is not being performed. Parameters: qualified - The qualified name (with prefix), or the empty stringif qualified names are not available. throws: SAXException - If the specified URI is not mapped with a prefix. |
|
|