|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.jcr.value.basic.SimpleNamespaceRegistry
org.modeshape.jcr.value.basic.LocalNamespaceRegistry
@NotThreadSafe public class LocalNamespaceRegistry
A special NamespaceRegistry
implementation that can be used to track transient registrations for another delegate
registry.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.modeshape.jcr.value.NamespaceRegistry |
---|
NamespaceRegistry.Namespace |
Field Summary |
---|
Fields inherited from class org.modeshape.jcr.value.basic.SimpleNamespaceRegistry |
---|
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. |
Set<NamespaceRegistry.Namespace> |
getLocalNamespaces()
Obtain the set of namespaces that are overridden within this LocalNamespaceRegistry instance. |
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. |
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.modeshape.jcr.value.basic.SimpleNamespaceRegistry |
---|
clear, generatePrefix, getGeneratedPrefixTemplate, register, setGeneratedPrefixTemplate, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LocalNamespaceRegistry(NamespaceRegistry delegate)
delegate
- the namespace registry that this registry should delegate to if not found locallypublic 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 prefixMethod Detail |
---|
public String getDefaultNamespaceUri()
NamespaceRegistry
getDefaultNamespaceUri
in interface NamespaceRegistry
getDefaultNamespaceUri
in class SimpleNamespaceRegistry
public String getNamespaceForPrefix(String prefix)
NamespaceRegistry
getNamespaceForPrefix
in interface NamespaceRegistry
getNamespaceForPrefix
in class SimpleNamespaceRegistry
prefix
- the namespace prefix
public Set<NamespaceRegistry.Namespace> getNamespaces()
NamespaceRegistry
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 NamespaceRegistry
getNamespaces
in class SimpleNamespaceRegistry
NamespaceRegistry.Namespace
objects reflecting a snapshot of the registry; never nullpublic Set<NamespaceRegistry.Namespace> getLocalNamespaces()
LocalNamespaceRegistry
instance.
public String getPrefixForNamespaceUri(String namespaceUri, boolean generateIfMissing)
NamespaceRegistry
getPrefixForNamespaceUri
in interface NamespaceRegistry
getPrefixForNamespaceUri
in class SimpleNamespaceRegistry
namespaceUri
- 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 false
NamespaceRegistry.isRegisteredNamespaceUri(String)
public Set<String> getRegisteredNamespaceUris()
NamespaceRegistry
getRegisteredNamespaceUris
in interface NamespaceRegistry
getRegisteredNamespaceUris
in class SimpleNamespaceRegistry
public boolean isRegisteredNamespaceUri(String namespaceUri)
NamespaceRegistry
isRegisteredNamespaceUri
in interface NamespaceRegistry
isRegisteredNamespaceUri
in class SimpleNamespaceRegistry
namespaceUri
- the namespace URI
public String register(String prefix, String namespaceUri)
NamespaceRegistry
register
in interface NamespaceRegistry
register
in class SimpleNamespaceRegistry
prefix
- the prefix for the namespace, or null if a namesapce prefix should be generated automaticallynamespaceUri
- the namespace URI
public boolean unregister(String namespaceUri)
NamespaceRegistry
unregister
in interface NamespaceRegistry
unregister
in class SimpleNamespaceRegistry
namespaceUri
- the namespace URI
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |