public class NamespaceRegistry extends Object implements NamespaceContext, Serializable
registerURI(String,String)
[TODO] cleanup the apiConstructor and Description |
---|
NamespaceRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
addPrefixMapping(String prefix,
String nsURI)
Adds prefix mapping.
|
String |
getNamespaceURI(String prefix)
Get the nsURI for a given prefix, maybe null.
|
String |
getPrefix(String nsURI)
Returns the last mapping for the prefix or null if the prefix was not mapped.
|
Iterator<String> |
getPrefixes(String namespaceURI)
Returns all prefixes for the given URI.
|
Iterator<String> |
getRegisteredPrefixes()
Return an iterator over all registered nsURIs.
|
Iterator<String> |
getRegisteredURIs()
Return an iterator over all registered nsURIs.
|
boolean |
isRegistered(String nsURI)
True if the given nsURI is registered.
|
QName |
registerQName(QName qname)
Register a QName and return a QName that is guarantied to have a prefix
|
String |
registerURI(String nsURI,
String prefix)
Register the given nsURI/prefix combination.
|
void |
removePrefixMapping(String prefix)
Removes the last mapping for the given prefix.
|
int |
size() |
void |
unregisterURI(String nsURI)
Unregisters all prefix mappings for the given URI, not just the last one added.
|
public QName registerQName(QName qname)
public String registerURI(String nsURI, String prefix)
nsURI
- The nsURIprefix
- The corresponding prefix, maybe nullpublic void addPrefixMapping(String prefix, String nsURI)
prefix
- prefix to mapnsURI
- the URI to prefix topublic void removePrefixMapping(String prefix)
prefix
- the prefix to remove mapping forpublic void unregisterURI(String nsURI)
nsURI
- the URI to unregisterpublic boolean isRegistered(String nsURI)
public Iterator<String> getRegisteredURIs()
public Iterator<String> getRegisteredPrefixes()
public int size()
public String getPrefix(String nsURI)
getPrefix
in interface NamespaceContext
public Iterator<String> getPrefixes(String namespaceURI)
getPrefixes
in interface NamespaceContext
namespaceURI
- the URI to return prefixes forpublic String getNamespaceURI(String prefix)
getNamespaceURI
in interface NamespaceContext
Copyright © 2014 JBoss by Red Hat. All rights reserved.