1 package org.relaxng.datatype;
\r
4 * Datatype streaming validator.
\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
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
14 public interface DatatypeStreamingValidator {
\r
17 * Passes an additional fragment of the literal.
\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
24 void addCharacters( char[] buf, int start, int len );
\r
27 * Tells if the accumulated literal is valid with respect to
\r
28 * the underlying Datatype.
\r
31 * True if it is valid. False if otherwise.
\r
36 * Similar to the isValid method, but this method throws
\r
37 * Exception (with possibly diagnostic information), instead of
\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
45 void checkValid() throws DatatypeException;
\r