org.genepattern.io
Class OdfParser
java.lang.Object
org.genepattern.io.OdfParser
- public class OdfParser
- extends java.lang.Object
Class for reading an ODF document using callbacks.
|
Method Summary |
boolean |
canDecode(java.io.InputStream is)
Returns true if this parser can claims to be able to
decode the given stream upon brief examination, false
otherwise |
void |
parse(java.io.InputStream is)
Parse an ODF document. |
void |
setHandler(IOdfHandler handler)
Allow an application to register an event handler. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OdfParser
public OdfParser()
parse
public void parse(java.io.InputStream is)
throws ParseException,
java.io.IOException
- Parse an ODF document. The application can use this method to instruct
the ODF reader to begin parsing an ODF document from any valid input
source. Applications may not invoke this method while a parse is in
progress (they should create a new ODFParser instead ). Once a parse is
complete, an application may reuse the same ODFParser object, possibly
with a different input source. During the parse, the ODFParser will
provide information about the ODF document through the registered ODF
event handler. This method is synchronous: it will not return until
parsing has ended. If a client application wants to terminate parsing
early, it should throw an exception.
- Parameters:
is - The input stream
- Throws:
ParseException - -
Any parse exception, possibly wrapping another exception.
java.io.IOException - -
An IO exception from the parser, possibly from a byte stream
or character stream supplied by the application.
canDecode
public boolean canDecode(java.io.InputStream is)
throws java.io.IOException
- Returns
true if this parser can claims to be able to
decode the given stream upon brief examination, false
otherwise
- Parameters:
is - The input stream
- Returns:
- Whether this parser can decode the given stream
- Throws:
java.io.IOException - If an error occurs while reading from the stream
setHandler
public void setHandler(IOdfHandler handler)
- Allow an application to register an event handler. If the application
does not register a handler, all content events reported by the ODF
parser will be silently ignored. Applications may register a new or
different handler in the middle of a parse, and the ODF parser must begin
using the new handler immediately.
- Parameters:
handler - The new handler value
|
|