|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.xb.binding.NamespaceRegistry
public class NamespaceRegistry
A simple namespace registry.
It assignes namespace prefixes of the form 'ns?' where ? is an incrementing integer.
registerURI(String,String)
[TODO] cleanup the api
Constructor Summary | |
---|---|
NamespaceRegistry()
|
Method Summary | |
---|---|
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 |
getPrefixes(String namespaceURI)
Returns all prefixes for the given URI. |
Iterator |
getRegisteredPrefix()
Return an iterator over all registered nsURIs. |
Iterator |
getRegisteredURIs()
Return an iterator over all registered nsURIs. |
boolean |
isRegistered(String nsURI)
True if the given nsURI is registered. |
javax.xml.namespace.QName |
registerQName(javax.xml.namespace.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. |
void |
unregisterURI(String nsURI)
Unregisters all prefix mappings for the given URI, not just the last one added. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NamespaceRegistry()
Method Detail |
---|
public javax.xml.namespace.QName registerQName(javax.xml.namespace.QName qname)
public String registerURI(String nsURI, String prefix)
nsURI
- The nsURIprefix
- The corresponding prefix, maybe null
public 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 getRegisteredURIs()
public Iterator getRegisteredPrefix()
public String getPrefix(String nsURI)
getPrefix
in interface javax.xml.namespace.NamespaceContext
public Iterator getPrefixes(String namespaceURI)
getPrefixes
in interface javax.xml.namespace.NamespaceContext
namespaceURI
- the URI to return prefixes for
public String getNamespaceURI(String prefix)
getNamespaceURI
in interface javax.xml.namespace.NamespaceContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |