public final class Namespaces extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
XML_NAMESPACE
The reserved XML 1.0 Namespace URI
|
static String |
XML_NAMESPACE_PREFIX
The reserved XML Namespace Prefix
|
| Constructor and Description |
|---|
Namespaces() |
| Modifier and Type | Method and Description |
|---|---|
void |
addNamespace(String prefix,
String uri)
Adds the given namespace declaration to this Namespaces instance
|
void |
declareAsAttributes(org.xml.sax.helpers.AttributeListImpl atts)
Declare the namespaces of this stack in as attributes.
|
Enumeration<String> |
getLocalNamespacePrefixes()
Returns all namespace prefixes declared locally
|
Enumeration<String> |
getLocalNamespaces()
Returns an Enumeration of local namespace URIs for this Namespaces.
|
String |
getNamespacePrefix(String nsURI)
Returns the Namespace prefix associated with the given URI.
|
String[] |
getNamespacePrefixes(String nsURI)
Returns the Namespace prefixes associated with the given URI.
|
String |
getNamespaceURI(String prefix)
Returns the Namespace URI associated with the given prefix
|
String |
getNonDefaultNamespacePrefix(String nsURI)
Returns the Namespace prefix associated with the given URI.
|
boolean |
removeNamespace(String prefix)
Removes the namespace declaration for the given prefix.
|
void |
sendEndEvents(ContentHandler handler)
Calls the given ContentHandler's endPrefixMapping method for each locally declared namespace
|
void |
sendStartEvents(ContentHandler handler)
Calls the given ContentHandler's startPrefixMapping method for each locally declared namespace
|
public static final String XML_NAMESPACE_PREFIX
public static final String XML_NAMESPACE
public void addNamespace(String prefix, String uri)
prefix - the namespace prefixuri - the namespace URI to be associated with the given prefixIllegalArgumentException - if uri is nullpublic Enumeration<String> getLocalNamespaces()
public String getNamespaceURI(String prefix)
prefix - the namespace prefix to lookuppublic String getNamespacePrefix(String nsURI)
#getNamespacePrefixes.nsURI - the namespace URI to lookupIllegalArgumentException - if nsURI is nullpublic Enumeration<String> getLocalNamespacePrefixes()
public String[] getNamespacePrefixes(String nsURI)
nsURI - the namespace URI to lookuplocal - a boolean that when true indicates only the local scope is searched.IllegalArgumentException - if nsURI is nullpublic String getNonDefaultNamespacePrefix(String nsURI)
nsURI - the namespace URI to lookupIllegalArgumentException - if nsURI is nullpublic boolean removeNamespace(String prefix)
prefix - the namespace prefix to remove the binding ofpublic void sendEndEvents(ContentHandler handler) throws SAXException
handler - the ContentHandlerSAXExceptionpublic void sendStartEvents(ContentHandler handler) throws SAXException
handler - the ContentHandlerSAXExceptionpublic void declareAsAttributes(org.xml.sax.helpers.AttributeListImpl atts)
atts - the Attribute List to fill in.Copyright © 2016. All rights reserved.