All Packages Class Hierarchy This Package Previous Next Index
All OpenMath parsers must implement this basic interface: it allows applications to register handlers for different types of events and to initiate a parse from a character stream.
All OpenMath parsers must also implement a zero-argument constructor for Beans support. (though other constructors are also allowed).
OpenMath parsers are reusable but not re-entrant: the application may reuse a parser object (possibly with a different input source) once the first parse has completed successfully, but it may not invoke the parse() methods recursively within a parse.
public abstract void setParserHandler(ParserHandler handler)
If the application does not register an parse handler, all events reported by the OpenMath parser will be silently ignored (this is the default behaviour implemented by ParserAdapter).
Applications may register a new or different handler in the middle of a parse, and the OpenMath parser must begin using the new handler immediately.
public abstract ParserHandler getParserHandler()
public abstract void setParserErrorHandler(ParserErrorHandler handler)
If the application does not register an error event handler, all error events reported by the OpenMath parser will be silently ignored, except for fatalError, which will throw a OMException (this is the default behaviour implemented by ParserAdapter).
Applications may register a new or different handler in the middle of a parse, and the OpenMath parser must begin using the new handler immediately.
public abstract ParserErrorHandler getParserErrorHandler()
public abstract void initParse(InputStream source) throws OMException
The application must use this method to instruct the OpenMath parser to reset its state. Each time you change input source you need to call this function before using parse* methods.
public abstract void parseElement(InputStream source) throws OMException
The application can use this method to instruct the OpenMath parser to begin parsing an OpenMath element from any valid input source (a character stream, a byte stream...).
Applications may not invoke this method while a parse is in progress (they should create a new Parser for each additional input source). Once a parse is complete, an application may reuse the same Parser object to parse another OpenMath object on the same input source or possibly with a completly different input source.
public abstract void parseObject(InputStream source) throws OMException
The application can use this method to instruct the OpenMath parser to begin parsing an OpenMath Object from any valid input source (a character stream, a byte stream...).
Applications may not invoke this method while a parse is in progress (they should create a new Parser for each additional input source). Once a parse is complete, an application may reuse the same Parser object to parse another OpenMath object on the same input source or possibly with a completly different input source.
public abstract void parse(InputStream source) throws OMException
The application can use this method to instruct the OpenMath parser to begin parsing OpenMath Objects from any valid input source (a character stream, a byte stream...).
Applications may not invoke this method while a parse is in progress (they should create a new Parser for each additional input source). Once a parse is complete, an application may reuse the same Parser object to parse another OpenMath object on the same input source or possibly with a completly different input source.
All Packages Class Hierarchy This Package Previous Next Index