|
||||||||||
| 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 |
getRegisteredPrefixes()
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. |
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. |
| 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 QName registerQName(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 getRegisteredPrefixes()
public int size()
public String getPrefix(String nsURI)
getPrefix in interface NamespaceContextpublic Iterator getPrefixes(String namespaceURI)
getPrefixes in interface NamespaceContextnamespaceURI - the URI to return prefixes for
public String getNamespaceURI(String prefix)
getNamespaceURI in interface NamespaceContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||