File tree Expand file tree Collapse file tree
jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public class NameParser {
4444 * @param jcrName the name to be parsed. The jcrName may either be in the
4545 * qualified or in the expanded form.
4646 * @param resolver <code>NamespaceResolver</code> use to retrieve the
47- * namespace URI from the prefix contained in the given JCR name.
47+ * namespace URI from the prefix contained in the given JCR name. Must resolve the empty prefix "" as well.
4848 * @return qName the new <code>Name</code>
4949 * @throws IllegalNameException If <code>jcrName</code> is not a valid
5050 * JCR-style name.
Original file line number Diff line number Diff line change 1818
1919import javax .jcr .NamespaceException ;
2020
21+ import org .apache .jackrabbit .spi .commons .conversion .NameParser ;
22+
2123/**
2224 * Interface for resolving namespace URIs and prefixes. Unlike the JCR
2325 * {@link javax.jcr.NamespaceRegistry} interface, this interface contains
@@ -30,9 +32,10 @@ public interface NamespaceResolver {
3032
3133 /**
3234 * Returns the URI to which the given prefix is mapped.
35+ * For the empty prefix the default namespace uri should be returned as the {@link NameParser} relies on that.
3336 *
3437 * @param prefix namespace prefix
35- * @return the namespace URI to which the given prefix is mapped.
38+ * @return the namespace URI to which the given prefix is mapped (never {@code null}) .
3639 * @throws NamespaceException if the prefix is unknown.
3740 */
3841 String getURI (String prefix ) throws NamespaceException ;
@@ -41,7 +44,7 @@ public interface NamespaceResolver {
4144 * Returns the prefix which is mapped to the given URI.
4245 *
4346 * @param uri namespace URI
44- * @return the prefix mapped to the given URI.
47+ * @return the prefix mapped to the given URI (never {@code null}) .
4548 * @throws NamespaceException if the URI is unknown.
4649 */
4750 String getPrefix (String uri ) throws NamespaceException ;
You can’t perform that action at this time.
0 commit comments