Class AbstractNamespaceResolver
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.namespace.AbstractNamespaceResolver
-
- All Implemented Interfaces:
NamespaceResolver
@Deprecated public abstract class AbstractNamespaceResolver extends Object implements NamespaceResolver
Deprecated.https://issues.apache.org/jira/browse/JCR-1700Provides default implementations for the methods: Subclasses may overwrite those methods with more efficient implementations e.g. using caching. This class also adds optional support forNamespaceListener
s. To enable listener support call the constructor withsupportListeners
set totrue
. The default constructor will not enable listener support and all listener related methods will throw anUnsupportedOperationException
in that case.
-
-
Constructor Summary
Constructors Constructor Description AbstractNamespaceResolver()
Deprecated.Creates aAbstractNamespaceResolver
without listener support.AbstractNamespaceResolver(boolean supportListeners)
Deprecated.Creates aAbstractNamespaceResolver
with listener support ifsupportListeners
is set totrue
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addListener(NamespaceListener listener)
Deprecated.Registerslistener
to get notifications when namespace mappings change.protected void
notifyNamespaceAdded(String prefix, String uri)
Deprecated.Notifies the listeners that a new namespaceuri
has been added and mapped toprefix
.protected void
notifyNamespaceRemapped(String oldPrefix, String newPrefix, String uri)
Deprecated.Notifies listeners that an existing namespace uri has been remapped to a new prefix.protected void
notifyNamespaceRemoved(String uri)
Deprecated.Notifies the listeners that the namespace with the givenuri
has been removed from the mapping.void
removeListener(NamespaceListener listener)
Deprecated.Removes thelistener
from thisNamespaceRegistery
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver
getPrefix, getURI
-
-
-
-
Constructor Detail
-
AbstractNamespaceResolver
public AbstractNamespaceResolver()
Deprecated.Creates aAbstractNamespaceResolver
without listener support.
-
AbstractNamespaceResolver
public AbstractNamespaceResolver(boolean supportListeners)
Deprecated.Creates aAbstractNamespaceResolver
with listener support ifsupportListeners
is set totrue
.- Parameters:
supportListeners
- iftrue
listener are supported by this instance.
-
-
Method Detail
-
addListener
public void addListener(NamespaceListener listener)
Deprecated.Registerslistener
to get notifications when namespace mappings change.- Parameters:
listener
- the listener to register.- Throws:
UnsupportedOperationException
- if listener support is not enabled for thisAbstractNamespaceResolver
.
-
removeListener
public void removeListener(NamespaceListener listener)
Deprecated.Removes thelistener
from thisNamespaceRegistery
.- Parameters:
listener
- the listener to remove.- Throws:
UnsupportedOperationException
- if listener support is not enabled for thisAbstractNamespaceResolver
.
-
notifyNamespaceAdded
protected void notifyNamespaceAdded(String prefix, String uri)
Deprecated.Notifies the listeners that a new namespaceuri
has been added and mapped toprefix
.- Parameters:
prefix
- the prefix.uri
- the namespace uri.
-
notifyNamespaceRemapped
protected void notifyNamespaceRemapped(String oldPrefix, String newPrefix, String uri)
Deprecated.Notifies listeners that an existing namespace uri has been remapped to a new prefix.- Parameters:
oldPrefix
- the old prefix.newPrefix
- the new prefix.uri
- the associated namespace uri.
-
notifyNamespaceRemoved
protected void notifyNamespaceRemoved(String uri)
Deprecated.Notifies the listeners that the namespace with the givenuri
has been removed from the mapping.- Parameters:
uri
- the namespace uri.- See Also:
NamespaceListener.namespaceRemoved(String)
-
-