public final class Namespaces
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
(package private) class |
Namespaces.Namespace |
An internal class used to represent a namespace
|
(package private) static class |
Namespaces.NamespaceEnumerator |
A simple Enumeration for Namespace objects
|
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
XML_NAMESPACE |
The reserved XML 1.0 Namespace URI
|
static java.lang.String |
XML_NAMESPACE_PREFIX |
The reserved XML Namespace Prefix
|
Constructor | Description |
---|---|
Namespaces() |
Creates a new Namespaces instance
|
Namespaces(Namespaces parent) |
Creates a new Namespaces instance
|
Modifier and Type | Method | Description |
---|---|---|
void |
addNamespace(java.lang.String prefix,
java.lang.String uri) |
Adds the given namespace declaration to this Namespaces
|
Namespaces |
createNamespaces() |
Creates a new Namespaces instance with this Namespaces as the parent
|
void |
declareAsAttributes(org.xml.sax.helpers.AttributeListImpl atts,
boolean localOnly) |
Declare the namespaces of this stack in as attributes.
|
java.util.Enumeration |
getLocalNamespacePrefixes() |
Returns all namespace prefixes declared locally
|
java.util.Enumeration |
getLocalNamespaces() |
Returns an Enumeration of local namespace URIs for this Namespaces.
|
java.lang.String |
getNamespacePrefix(java.lang.String nsURI) |
Returns the Namespace prefix associated with the given URI.
|
java.lang.String[] |
getNamespacePrefixes(java.lang.String nsURI) |
Returns all namespace prefixes associated with the given URI,
including those from parent scopes.
|
java.lang.String[] |
getNamespacePrefixes(java.lang.String nsURI,
boolean local) |
Returns the Namespace prefixes associated with the given URI.
|
java.lang.String |
getNamespaceURI(java.lang.String prefix) |
Returns the Namespace URI associated with the given prefix
|
java.lang.String |
getNonDefaultNamespacePrefix(java.lang.String nsURI) |
Returns the Namespace prefix associated with the given URI.
|
Namespaces |
getParent() |
Returns the parent Namespaces for this Namespaces instance.
|
boolean |
removeNamespace(java.lang.String prefix) |
Removes the namespace declaration for the given prefix.
|
void |
sendEndEvents(org.xml.sax.ContentHandler handler) |
Calls the given ContentHandler's endPrefixMapping method
for each locally declared namespace
|
void |
sendStartEvents(org.xml.sax.ContentHandler handler) |
Calls the given ContentHandler's startPrefixMapping method
for each locally declared namespace
|
void |
setParent(Namespaces namespaces) |
Sets the parent Namespaces for this Namespaces instance.
|
public static final java.lang.String XML_NAMESPACE_PREFIX
public static final java.lang.String XML_NAMESPACE
public Namespaces()
public Namespaces(Namespaces parent)
public void addNamespace(java.lang.String prefix, java.lang.String uri)
prefix
- the namespace prefixuri
- the namespace URI to be associated with the given prefixpublic Namespaces createNamespaces()
public java.util.Enumeration getLocalNamespaces()
public java.lang.String getNamespaceURI(java.lang.String prefix)
prefix
- the namespace prefix to lookuppublic java.lang.String getNamespacePrefix(java.lang.String nsURI)
#getNamespacePrefixes
.nsURI
- the namespace URI to lookuppublic java.util.Enumeration getLocalNamespacePrefixes()
public java.lang.String[] getNamespacePrefixes(java.lang.String nsURI)
nsURI
- the namespace URI to lookuppublic java.lang.String[] getNamespacePrefixes(java.lang.String nsURI, boolean local)
nsURI
- the namespace URI to lookuplocal
- a boolean that when true indicates only the local
scope is searched.public java.lang.String getNonDefaultNamespacePrefix(java.lang.String nsURI)
nsURI
- the namespace URI to lookuppublic Namespaces getParent()
public boolean removeNamespace(java.lang.String prefix)
prefix
- the namespace prefix to remove the binding ofpublic void setParent(Namespaces namespaces)
namespaces
- the parent Namespacespublic void sendEndEvents(org.xml.sax.ContentHandler handler) throws org.xml.sax.SAXException
handler
- the ContentHandlerorg.xml.sax.SAXException
public void sendStartEvents(org.xml.sax.ContentHandler handler) throws org.xml.sax.SAXException
handler
- the ContentHandlerorg.xml.sax.SAXException
public void declareAsAttributes(org.xml.sax.helpers.AttributeListImpl atts, boolean localOnly)
atts
- the Attribute List to fill in.Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com