|
1 /** |
|
2 * Copyright (c) 2001, Thai Open Source Software Center Ltd |
|
3 * All rights reserved. |
|
4 * |
|
5 * Redistribution and use in source and binary forms, with or without |
|
6 * modification, are permitted provided that the following conditions are |
|
7 * met: |
|
8 * |
|
9 * Redistributions of source code must retain the above copyright |
|
10 * notice, this list of conditions and the following disclaimer. |
|
11 * |
|
12 * Redistributions in binary form must reproduce the above copyright |
|
13 * notice, this list of conditions and the following disclaimer in |
|
14 * the documentation and/or other materials provided with the |
|
15 * distribution. |
|
16 * |
|
17 * Neither the name of the Thai Open Source Software Center Ltd nor |
|
18 * the names of its contributors may be used to endorse or promote |
|
19 * products derived from this software without specific prior written |
|
20 * permission. |
|
21 * |
|
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR |
|
26 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
|
27 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
|
28 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
|
29 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
|
30 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
|
31 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
33 */ |
|
34 package org.relaxng.datatype; |
|
35 |
|
36 /** |
|
37 * An interface that must be implemented by caller to |
|
38 * provide context information that is necessary to |
|
39 * perform validation of some Datatypes. |
|
40 * |
|
41 * @author <a href="mailto:jjc@jclark.com">James Clark</a> |
|
42 * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a> |
|
43 */ |
|
44 public interface ValidationContext { |
|
45 |
|
46 /** |
|
47 * Resolves a namespace prefix to the corresponding namespace URI. |
|
48 * |
|
49 * This method is used for validating the QName type, for example. |
|
50 * |
|
51 * <p> |
|
52 * If the prefix is "" (empty string), it indicates |
|
53 * an unprefixed value. The callee |
|
54 * should resolve it as for an unprefixed |
|
55 * element, rather than for an unprefixed attribute. |
|
56 * |
|
57 * <p> |
|
58 * If the prefix is "xml", then the callee must resolve |
|
59 * this prefix into "http://www.w3.org/XML/1998/namespace", |
|
60 * as defined in the XML Namespaces Recommendation. |
|
61 * |
|
62 * @return |
|
63 * namespace URI of this prefix. |
|
64 * If the specified prefix is not declared, |
|
65 * the implementation must return null. |
|
66 */ |
|
67 String resolveNamespacePrefix( String prefix ); |
|
68 |
|
69 /** |
|
70 * Returns the base URI of the context. The null string may be returned |
|
71 * if no base URI is known. |
|
72 */ |
|
73 String getBaseUri(); |
|
74 |
|
75 /** |
|
76 * Checks if an unparsed entity is declared with the |
|
77 * specified name. |
|
78 * |
|
79 * @return |
|
80 * true |
|
81 * if the DTD has an unparsed entity declaration for |
|
82 * the specified name. |
|
83 * false |
|
84 * otherwise. |
|
85 */ |
|
86 boolean isUnparsedEntity( String entityName ); |
|
87 |
|
88 /** |
|
89 * Checks if a notation is declared with the |
|
90 * specified name. |
|
91 * |
|
92 * @return |
|
93 * true |
|
94 * if the DTD has a notation declaration for the specified name. |
|
95 * false |
|
96 * otherwise. |
|
97 */ |
|
98 boolean isNotation( String notationName ); |
|
99 } |