|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.name.AbstractNamespaceResolver org.apache.jackrabbit.core.query.lucene.NamespaceMappings
The class NamespaceMappings
implements a org.apache.jackrabbit.core.NamespaceResolver
that holds a namespace
mapping that is used internally in the search index. Storing paths with the
full uri of a namespace would require too much space in the search index.
Constructor Summary | |
NamespaceMappings(File file)
Creates NamespaceMappings instance. |
Method Summary | |
String |
getPrefix(String uri)
Returns a prefix for the namespace uri . |
String |
getURI(String prefix)
Returns a namespace uri for a prefix . |
String |
translatePropertyName(String name,
NamespaceResolver resolver)
Translates a property name from a session local namespace mapping into a search index private namespace mapping. |
Methods inherited from class org.apache.jackrabbit.name.AbstractNamespaceResolver |
addListener, getJCRName, getQName, notifyNamespaceAdded, notifyNamespaceRemapped, removeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NamespaceMappings(File file) throws IOException
NamespaceMappings
instance. Initial mappings are
loaded from file
.
file
- the File
to load initial mappings.
IOException
- if an error occurs while reading initial namespace
mappings from file
.Method Detail |
public String getURI(String prefix) throws NamespaceException
prefix
.
prefix
- the namespace prefix.
NamespaceException
- if no namespace uri is registered for
prefix
.public String getPrefix(String uri) throws NamespaceException
uri
. If a namespace
mapping exists, the already known prefix is returned; otherwise a new
prefix is created and assigned to the namespace uri.
uri
- the namespace uri.
NamespaceException
- if an yet unknown namespace uri / prefix
mapping could not be stored.public String translatePropertyName(String name, NamespaceResolver resolver) throws IllegalNameException, UnknownPrefixException
name
- the property name to translateresolver
- the NamespaceResolver
of the local session.
IllegalNameException
UnknownPrefixException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |