Package com.io7m.smfj.cmdline
Class CommandProbe
- java.lang.Object
-
- com.io7m.smfj.cmdline.CommandRoot
-
- com.io7m.smfj.cmdline.CommandProbe
-
- All Implemented Interfaces:
SMFParserEventsErrorType
,SMFParserEventsHeaderType
,SMFParserEventsType
,java.util.concurrent.Callable<java.lang.Integer>
public final class CommandProbe extends CommandRoot implements SMFParserEventsType, SMFParserEventsHeaderType
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Integer
call()
This method must be called by subclasses.void
onError(SMFErrorType e)
An error has occurred.void
onFinish()
Parsing has finished.java.util.Optional<SMFParserEventsBodyType>
onHeaderParsed(SMFHeader header)
Parsing of the header was successful.void
onStart()
Parsing has started.java.util.Optional<SMFParserEventsHeaderType>
onVersionReceived(SMFFormatVersion version)
The file format version has been successfully parsed.void
onWarning(SMFWarningType w)
An error has occurred of a severity low enough that it should just be considered a warning.
-
-
-
Method Detail
-
call
public java.lang.Integer call() throws java.lang.Exception
Description copied from class:CommandRoot
This method must be called by subclasses.- Specified by:
call
in interfacejava.util.concurrent.Callable<java.lang.Integer>
- Overrides:
call
in classCommandRoot
- Returns:
- 0
- Throws:
java.lang.Exception
- On errors
-
onStart
public void onStart()
Description copied from interface:SMFParserEventsType
Parsing has started.- Specified by:
onStart
in interfaceSMFParserEventsType
-
onVersionReceived
public java.util.Optional<SMFParserEventsHeaderType> onVersionReceived(SMFFormatVersion version)
Description copied from interface:SMFParserEventsType
The file format version has been successfully parsed. The functions should return a receiver for the header information if parsing should continue, orOptional.empty()
if parsing should stop.- Specified by:
onVersionReceived
in interfaceSMFParserEventsType
- Parameters:
version
- The file format version- Returns:
- A receiver for the header, if any
-
onFinish
public void onFinish()
Description copied from interface:SMFParserEventsType
Parsing has finished. This method will be called unconditionally when the parser is closed, regardless of any errors encountered.- Specified by:
onFinish
in interfaceSMFParserEventsType
-
onError
public void onError(SMFErrorType e)
Description copied from interface:SMFParserEventsErrorType
An error has occurred. Parsing will continue but the file as a whole must be considered invalid.- Specified by:
onError
in interfaceSMFParserEventsErrorType
- Parameters:
e
- The error
-
onWarning
public void onWarning(SMFWarningType w)
Description copied from interface:SMFParserEventsErrorType
An error has occurred of a severity low enough that it should just be considered a warning.- Specified by:
onWarning
in interfaceSMFParserEventsErrorType
- Parameters:
w
- The warning
-
onHeaderParsed
public java.util.Optional<SMFParserEventsBodyType> onHeaderParsed(SMFHeader header)
Description copied from interface:SMFParserEventsHeaderType
Parsing of the header was successful. The function must return an event receiver if it wishes parsing to continue.- Specified by:
onHeaderParsed
in interfaceSMFParserEventsHeaderType
- Parameters:
header
- The parsed header- Returns:
- An event receiver
-
-