Class NameParser

    • Constructor Detail

      • NameParser

        public NameParser()
    • Method Detail

      • parse

        public static org.apache.jackrabbit.spi.Name parse​(String jcrName,
                                                           NamespaceResolver resolver,
                                                           org.apache.jackrabbit.spi.NameFactory factory)
                                                    throws IllegalNameException,
                                                           NamespaceException
        Parses the jcrName (either qualified or expanded) and returns a new Name.
        Parameters:
        jcrName - the name to be parsed. The jcrName may either be in the qualified or in the expanded form.
        resolver - NamespaceResolver use to retrieve the namespace URI from the prefix contained in the given JCR name.
        Returns:
        qName the new Name
        Throws:
        IllegalNameException - If jcrName is not a valid JCR-style name.
        NamespaceException - If the jcr name contains an unknown prefix.
      • parse

        public static org.apache.jackrabbit.spi.Name[] parse​(String[] jcrNames,
                                                             NamespaceResolver resolver,
                                                             org.apache.jackrabbit.spi.NameFactory factory)
                                                      throws NameException,
                                                             NamespaceException
        Parses an array of jcrName and returns the respective array of Name.
        Parameters:
        jcrNames - the array of names to be parsed
        resolver - NamespaceResolver use to retrieve the namespace URI from the prefix contained in the given JCR name.
        factory -
        Returns:
        the new array of Name
        Throws:
        IllegalNameException - If jcrName is not a valid JCR-style name.
        NamespaceException - If the jcr name contains an unknown prefix.
        NameException
      • checkFormat

        public static void checkFormat​(String jcrName)
                                throws IllegalNameException
        Check the format of the jcr name. Note that the prefix is not resolved and therefore namespace violations (unknown prefix) will not be detected.
        Parameters:
        jcrName -
        Throws:
        IllegalNameException - If the jcrName contains an invalid format.