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.Integercall()This method must be called by subclasses.voidonError(SMFErrorType e)An error has occurred.voidonFinish()Parsing has finished.java.util.Optional<SMFParserEventsBodyType>onHeaderParsed(SMFHeader header)Parsing of the header was successful.voidonStart()Parsing has started.java.util.Optional<SMFParserEventsHeaderType>onVersionReceived(SMFFormatVersion version)The file format version has been successfully parsed.voidonWarning(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.ExceptionDescription copied from class:CommandRootThis method must be called by subclasses.- Specified by:
callin interfacejava.util.concurrent.Callable<java.lang.Integer>- Overrides:
callin classCommandRoot- Returns:
- 0
- Throws:
java.lang.Exception- On errors
-
onStart
public void onStart()
Description copied from interface:SMFParserEventsTypeParsing has started.- Specified by:
onStartin interfaceSMFParserEventsType
-
onVersionReceived
public java.util.Optional<SMFParserEventsHeaderType> onVersionReceived(SMFFormatVersion version)
Description copied from interface:SMFParserEventsTypeThe 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:
onVersionReceivedin interfaceSMFParserEventsType- Parameters:
version- The file format version- Returns:
- A receiver for the header, if any
-
onFinish
public void onFinish()
Description copied from interface:SMFParserEventsTypeParsing has finished. This method will be called unconditionally when the parser is closed, regardless of any errors encountered.- Specified by:
onFinishin interfaceSMFParserEventsType
-
onError
public void onError(SMFErrorType e)
Description copied from interface:SMFParserEventsErrorTypeAn error has occurred. Parsing will continue but the file as a whole must be considered invalid.- Specified by:
onErrorin interfaceSMFParserEventsErrorType- Parameters:
e- The error
-
onWarning
public void onWarning(SMFWarningType w)
Description copied from interface:SMFParserEventsErrorTypeAn error has occurred of a severity low enough that it should just be considered a warning.- Specified by:
onWarningin interfaceSMFParserEventsErrorType- Parameters:
w- The warning
-
onHeaderParsed
public java.util.Optional<SMFParserEventsBodyType> onHeaderParsed(SMFHeader header)
Description copied from interface:SMFParserEventsHeaderTypeParsing of the header was successful. The function must return an event receiver if it wishes parsing to continue.- Specified by:
onHeaderParsedin interfaceSMFParserEventsHeaderType- Parameters:
header- The parsed header- Returns:
- An event receiver
-
-