org.relaxng.datatype
Interface DatatypeStreamingValidator

All Known Implementing Classes:
StreamingValidatorImpl

public interface DatatypeStreamingValidator

Datatype streaming validator. The streaming validator is an optional feature that is useful for certain Datatypes. It allows the caller to incrementally provide the literal.

Author:
Kohsuke KAWAGUCHI

Method Summary
 void characters(char[] buf, int start, int len)
          let a streaming validator process additional literal fragment.
 void check()
          similar to the finish method, but this method throws Exception (with possibly diagnostic information), instad of returning false.
 boolean finish()
          gets if the accumulated literal is valid with respect to the underlying Datatype.
 

Method Detail

characters

public void characters(char[] buf,
                       int start,
                       int len)
let a streaming validator process additional literal fragment.

The application can call this method several times, then call the isValid method to check the validity.


finish

public boolean finish()
gets if the accumulated literal is valid with respect to the underlying Datatype. The application should call it when there is no more characters.

This method can be called only once, and this object should be discarded after that.

Returns:
True if it is valid. False if otherwise.

check

public void check()
           throws DatatypeException
similar to the finish method, but this method throws Exception (with possibly diagnostic information), instad of returning false.

If this method returns without any exception thrown, that means the accumulated string is valid.

Throws:
DatatypeException - If the callee supports the diagnosis and the accumulated literal is invalid, then this exception that possibly contains diagnosis information is thrown.