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