Class NameParser
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.conversion.NameParser
-
public class NameParser extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description NameParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkFormat(java.lang.String jcrName)
Check the format of the jcr name.static Name[]
parse(java.lang.String[] jcrNames, NamespaceResolver resolver, NameFactory factory)
Parses an array ofjcrName
and returns the respective array ofName
.static Name
parse(java.lang.String jcrName, NamespaceResolver resolver, NameFactory factory)
Parses thejcrName
(either qualified or expanded) and returns a newName
.
-
-
-
Method Detail
-
parse
public static Name parse(java.lang.String jcrName, NamespaceResolver resolver, NameFactory factory) throws IllegalNameException, NamespaceException
Parses thejcrName
(either qualified or expanded) and returns a newName
.- 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
- IfjcrName
is not a valid JCR-style name.NamespaceException
- If the jcr name contains an unknown prefix.
-
parse
public static Name[] parse(java.lang.String[] jcrNames, NamespaceResolver resolver, NameFactory factory) throws NameException, NamespaceException
Parses an array ofjcrName
and returns the respective array ofName
.- Parameters:
jcrNames
- the array of names to be parsedresolver
-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
- IfjcrName
is not a valid JCR-style name.NamespaceException
- If the jcr name contains an unknown prefix.NameException
-
checkFormat
public static void checkFormat(java.lang.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.
-
-