OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / lib / classpath / external / relaxngDatatype / org / relaxng / datatype / DatatypeStreamingValidator.java
1 package org.relaxng.datatype;\r
2 \r
3 /**\r
4  * Datatype streaming validator.\r
5  * \r
6  * <p>\r
7  * The streaming validator is an optional feature that is useful for\r
8  * certain Datatypes. It allows the caller to incrementally provide\r
9  * the literal.\r
10  * \r
11  * @author <a href="mailto:jjc@jclark.com">James Clark</a>\r
12  * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>\r
13  */\r
14 public interface DatatypeStreamingValidator {\r
15         \r
16         /**\r
17          * Passes an additional fragment of the literal.\r
18          * \r
19          * <p>\r
20          * The application can call this method several times, then call\r
21          * the isValid method (or the checkValid method) to check the validity\r
22          * of the accumulated characters.\r
23          */\r
24         void addCharacters( char[] buf, int start, int len );\r
25         \r
26         /**\r
27          * Tells if the accumulated literal is valid with respect to\r
28          * the underlying Datatype.\r
29          * \r
30          * @return\r
31          *              True if it is valid. False if otherwise.\r
32          */\r
33         boolean isValid();\r
34         \r
35         /**\r
36          * Similar to the isValid method, but this method throws\r
37          * Exception (with possibly diagnostic information), instead of\r
38          * returning false.\r
39          * \r
40          * @exception DatatypeException\r
41          *              If the callee supports the diagnosis and the accumulated\r
42          *              literal is invalid, then this exception that possibly\r
43          *              contains diagnosis information is thrown.\r
44          */\r
45         void checkValid() throws DatatypeException;\r
46 }\r