public class ParsingNameResolver extends Object implements NameResolver
NamespaceResolver
is used for resolving the namespace prefixes.Constructor and Description |
---|
ParsingNameResolver(NameFactory nameFactory,
NamespaceResolver resolver)
Creates a parsing name resolver.
|
Modifier and Type | Method and Description |
---|---|
String |
getJCRName(Name name)
Returns the qualified JCR name for the given
Name object. |
Name |
getQName(String jcrName)
Parses the given JCR name and returns the resolved
Name object. |
public ParsingNameResolver(NameFactory nameFactory, NamespaceResolver resolver)
nameFactory
- the name factory.resolver
- namespace resolverpublic Name getQName(String jcrName) throws IllegalNameException, NamespaceException
Name
object.getQName
in interface NameResolver
jcrName
- A JCR name StringName
object.IllegalNameException
- if the JCR name format is invalidNamespaceException
- if the namespace prefix can not be resolved.NameResolver.getQName(String)
public String getJCRName(Name name) throws NamespaceException
Name
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.getJCRName
in interface NameResolver
name
- A Name
object.NamespaceException
- if the namespace URI can not be resolved.NameResolver.getJCRName(org.apache.jackrabbit.spi.Name)
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.