|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.dna.graph.properties.basic.BasicNamespaceRegistry
org.jboss.dna.graph.properties.basic.LocalNamespaceRegistry
@ThreadSafe public class LocalNamespaceRegistry

| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jboss.dna.graph.properties.NamespaceRegistry |
|---|
NamespaceRegistry.Namespace |
| Field Summary |
|---|
| Fields inherited from class org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry |
|---|
DEFAULT_NAMESPACE_URI, DEFAULT_PREFIX_NUMBER_FORMAT, DEFAULT_PREFIX_TEMPLATE |
| Constructor Summary | |
|---|---|
LocalNamespaceRegistry(NamespaceRegistry delegate)
|
|
LocalNamespaceRegistry(NamespaceRegistry delegate,
String defaultNamespaceUri)
|
|
| Method Summary | |
|---|---|
String |
getDefaultNamespaceUri()
Return the namespace URI that is currently mapped to the empty prefix, or null if there is no current default namespace. |
String |
getNamespaceForPrefix(String prefix)
Get the namespace URI for the supplied prefix. |
Set<NamespaceRegistry.Namespace> |
getNamespaces()
Obtain a snapshot of all of the namespaces registered at the time this method is called. The resulting
set is immutable, and will not reflect changes made to the registry. |
String |
getPrefixForNamespaceUri(String namespaceUri,
boolean generateIfMissing)
Return the prefix used for the supplied namespace URI. |
Set<String> |
getRegisteredNamespaceUris()
Obtain the set of namespaces that are registered. |
boolean |
isRegisteredNamespaceUri(String namespaceUri)
Return whether there is a registered prefix for the supplied namespace URI. |
String |
register(String prefix,
String namespaceUri)
Register a new namespace using the supplied prefix, returning the namespace URI previously registered under that prefix. |
boolean |
unregister(String namespaceUri)
Unregister the namespace with the supplied URI. |
| Methods inherited from class org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry |
|---|
getGeneratedPrefixTemplate, setGeneratedPrefixTemplate |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LocalNamespaceRegistry(NamespaceRegistry delegate)
delegate - the namespace registry that this registry should delegate to if not found locally
public LocalNamespaceRegistry(NamespaceRegistry delegate,
String defaultNamespaceUri)
delegate - the namespace registry that this registry should delegate to if not found locallydefaultNamespaceUri - the namespace URI to use for the default prefix| Method Detail |
|---|
public String getDefaultNamespaceUri()
getDefaultNamespaceUri in interface NamespaceRegistrygetDefaultNamespaceUri in class BasicNamespaceRegistryBasicNamespaceRegistry.getDefaultNamespaceUri()public String getNamespaceForPrefix(String prefix)
getNamespaceForPrefix in interface NamespaceRegistrygetNamespaceForPrefix in class BasicNamespaceRegistryprefix - the namespace prefix
BasicNamespaceRegistry.getNamespaceForPrefix(java.lang.String)public Set<NamespaceRegistry.Namespace> getNamespaces()
namespaces registered at the time this method is called. The resulting
set is immutable, and will not reflect changes made to the registry.
getNamespaces in interface NamespaceRegistrygetNamespaces in class BasicNamespaceRegistryNamespaceRegistry.Namespace objects reflecting a snapshot of the registry; never nullBasicNamespaceRegistry.getNamespaces()
public String getPrefixForNamespaceUri(String namespaceUri,
boolean generateIfMissing)
getPrefixForNamespaceUri in interface NamespaceRegistrygetPrefixForNamespaceUri in class BasicNamespaceRegistrynamespaceUri - the namespace URIgenerateIfMissing - true if the namespace URI has not already been registered and the method should auto-register the
namespace with a generated prefix, or false if the method should never auto-register the namespace
null if the namespace has not been registered
and generateIfMissing is falseBasicNamespaceRegistry.getPrefixForNamespaceUri(java.lang.String, boolean)public Set<String> getRegisteredNamespaceUris()
getRegisteredNamespaceUris in interface NamespaceRegistrygetRegisteredNamespaceUris in class BasicNamespaceRegistryBasicNamespaceRegistry.getRegisteredNamespaceUris()public boolean isRegisteredNamespaceUri(String namespaceUri)
isRegisteredNamespaceUri in interface NamespaceRegistryisRegisteredNamespaceUri in class BasicNamespaceRegistrynamespaceUri - the namespace URI
BasicNamespaceRegistry.isRegisteredNamespaceUri(java.lang.String)
public String register(String prefix,
String namespaceUri)
register in interface NamespaceRegistryregister in class BasicNamespaceRegistryprefix - the prefix for the namespace, or null if a namesapce prefix should be generated automaticallynamespaceUri - the namespace URI
BasicNamespaceRegistry.register(java.lang.String, java.lang.String)public boolean unregister(String namespaceUri)
unregister in interface NamespaceRegistryunregister in class BasicNamespaceRegistrynamespaceUri - the namespace URI
BasicNamespaceRegistry.unregister(java.lang.String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||