Class ParsingNameResolver
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.conversion.ParsingNameResolver
-
- All Implemented Interfaces:
NameResolver
public class ParsingNameResolver extends java.lang.Object implements NameResolver
Name resolver that parsers and formats prefixed JCR names. ANamespaceResolver
is used for resolving the namespace prefixes.
-
-
Constructor Summary
Constructors Constructor Description ParsingNameResolver(NameFactory nameFactory, NamespaceResolver resolver)
Creates a parsing name resolver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getJCRName(Name name)
Returns the qualified JCR name for the givenName
object.Name
getQName(java.lang.String jcrName)
Parses the given JCR name and returns the resolvedName
object.
-
-
-
Constructor Detail
-
ParsingNameResolver
public ParsingNameResolver(NameFactory nameFactory, NamespaceResolver resolver)
Creates a parsing name resolver.- Parameters:
nameFactory
- the name factory.resolver
- namespace resolver
-
-
Method Detail
-
getQName
public Name getQName(java.lang.String jcrName) throws IllegalNameException, NamespaceException
Parses the given JCR name and returns the resolvedName
object.- Specified by:
getQName
in interfaceNameResolver
- Parameters:
jcrName
- A JCR name String- Returns:
- A
Name
object. - Throws:
IllegalNameException
- if the JCR name format is invalidNamespaceException
- if the namespace prefix can not be resolved.- See Also:
NameResolver.getQName(String)
-
getJCRName
public java.lang.String getJCRName(Name name) throws NamespaceException
Returns the qualified JCR name for the givenName
object. If the name is in the default namespace, then the local name is returned without a prefix. Otherwise the prefix for the namespace is resolved and used to construct the JCR name.- Specified by:
getJCRName
in interfaceNameResolver
- Parameters:
name
- AName
object.- Returns:
- A qualified JCR name string.
- Throws:
NamespaceException
- if the namespace URI can not be resolved.- See Also:
NameResolver.getJCRName(org.apache.jackrabbit.spi.Name)
-
-