|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.components.serializers.util.Namespaces
public class Namespaces
The Namespaces
class is an utility class implementing a
stack for XML namespaces declarations.
Field Summary | |
---|---|
static int |
NAMESPACE_PREFIX
The index of the namespace prefix in for commit() . |
static int |
NAMESPACE_URI
The index of the namespace uri in for commit() . |
Constructor Summary | |
---|---|
Namespaces()
Create a new Namespaces instance. |
Method Summary | |
---|---|
String[][] |
commit()
Checkpoint this stack, returning the list of all namespaces added since the last commit() or pop(...) |
String |
getPrefix(String nsuri)
Return the namespace prefix associated with the specified URI. |
String |
getUri(String prefix)
Return the namespace URI associated with the specified prefix. |
void |
pop(String prefix)
Pop a new namespace declaration out of this stack. |
void |
push(String prefix,
String uri)
Push a new namespace declaration into this stack. |
String |
qualify(String nsuri,
String local,
String qualified)
Qualify an XML name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NAMESPACE_PREFIX
commit()
.
public static final int NAMESPACE_URI
commit()
.
Constructor Detail |
---|
public Namespaces()
Namespaces
instance.
Method Detail |
---|
public void push(String prefix, String uri)
prefix
- The prefix to associate with the specified URI.uri
- The URI associated with the namespace.public void pop(String prefix) throws SAXException
prefix
- The prefix to associate with the specified URI.
SAXException
- If the prefix was not mapped in this stack.public String qualify(String nsuri, String local, String qualified) throws SAXException
ContentHandler
interface in the startElement()
method, this method will always return a valid XML name token usable
for serialization (checking namespaces URIs and prefixes).
nsuri
- The Namespace URI, or the empty string if the element has
no namespace URI or if namespace processing is not being
performed.local
- The local name (without prefix), or the empty string if
namespace processing is not being performed.qualified
- The qualified name (with prefix), or the empty string
if qualified names are not available.
SAXException
- If the specified URI is not mapped with a prefix.public String[][] commit()
commit()
or pop(...)
call.
public String getUri(String prefix) throws SAXException
SAXException
- If the prefix cannot be mapped.public String getPrefix(String nsuri) throws SAXException
SAXException
- If the URI cannot be mapped.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |