public interface ParserCallback
If a ParserCallback is specified in calling Parser.parse
, the
Parser will invoke ParserCallback methods as parsing is performed, allowing
limited well-defined interaction between the application and the Parser.
Modifier and Type | Method and Description |
---|---|
void |
postOperation(LibraryObject libobj)
Invoked immediately after performing an operation on a LibraryObject.
|
LibraryObjectDefinition |
preOperation(LibraryObject libobj,
LibraryObjectDefinition lodef)
Invoked immediately prior to performing an operation on a LibraryObject.
|
void |
signalException(IfsException exception)
Signals a parsing-related exception.
|
LibraryObjectDefinition preOperation(LibraryObject libobj, LibraryObjectDefinition lodef) throws IfsException
libobj
- the LibraryObject on which the operation will be
performed; null if the operation will create a new
LibraryObjectlodef
- the operation proposed by the Parserdef
. To specify a different
operation, either return an altered def
or construct and return a different definition.
Return null to cancel the operation altogether.IfsException
- if the operation fails; this will abort parsingvoid postOperation(LibraryObject libobj) throws IfsException
libobj
- the LibraryObjectIfsException
- if the operation fails; this will abort parsingvoid signalException(IfsException exception) throws IfsException
The ParserCallback implementation can either throw the exception, or simply return, in which case parsing continues.
exception
- the potential exceptionIfsException
- this will abort parsingCopyright © 2023. All rights reserved.