Class ParsingNameResolver

  • All Implemented Interfaces:
    NameResolver

    public class ParsingNameResolver
    extends java.lang.Object
    implements NameResolver
    Name resolver that parsers and formats prefixed JCR names. A NamespaceResolver is used for resolving the namespace prefixes.
    • 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 given Name object.
      Name getQName​(java.lang.String jcrName)
      Parses the given JCR name and returns the resolved Name object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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,
                             javax.jcr.NamespaceException
        Parses the given JCR name and returns the resolved Name object.
        Specified by:
        getQName in interface NameResolver
        Parameters:
        jcrName - A JCR name String
        Returns:
        A Name object.
        Throws:
        IllegalNameException - if the JCR name format is invalid
        javax.jcr.NamespaceException - if the namespace prefix can not be resolved.
        See Also:
        NameResolver.getQName(String)
      • getJCRName

        public java.lang.String getJCRName​(Name name)
                                    throws javax.jcr.NamespaceException
        Returns the qualified JCR name for the given 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.
        Specified by:
        getJCRName in interface NameResolver
        Parameters:
        name - A Name object.
        Returns:
        A qualified JCR name string.
        Throws:
        javax.jcr.NamespaceException - if the namespace URI can not be resolved.
        See Also:
        NameResolver.getJCRName(org.apache.jackrabbit.spi.Name)