File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public class NameParser {
44
44
* @param jcrName the name to be parsed. The jcrName may either be in the
45
45
* qualified or in the expanded form.
46
46
* @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.
48
48
* @return qName the new <code>Name</code>
49
49
* @throws IllegalNameException If <code>jcrName</code> is not a valid
50
50
* JCR-style name.
Original file line number Diff line number Diff line change 18
18
19
19
import javax .jcr .NamespaceException ;
20
20
21
+ import org .apache .jackrabbit .spi .commons .conversion .NameParser ;
22
+
21
23
/**
22
24
* Interface for resolving namespace URIs and prefixes. Unlike the JCR
23
25
* {@link javax.jcr.NamespaceRegistry} interface, this interface contains
@@ -30,9 +32,10 @@ public interface NamespaceResolver {
30
32
31
33
/**
32
34
* 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.
33
36
*
34
37
* @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}) .
36
39
* @throws NamespaceException if the prefix is unknown.
37
40
*/
38
41
String getURI (String prefix ) throws NamespaceException ;
@@ -41,7 +44,7 @@ public interface NamespaceResolver {
41
44
* Returns the prefix which is mapped to the given URI.
42
45
*
43
46
* @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}) .
45
48
* @throws NamespaceException if the URI is unknown.
46
49
*/
47
50
String getPrefix (String uri ) throws NamespaceException ;
You can’t perform that action at this time.
0 commit comments