Package adams.core.command.output
Class LineSplit
-
- All Implemented Interfaces:
CleanUpHandler,OutputFormatter,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,Serializable
public class LineSplit extends AbstractOutputFormatter
Splits the incoming data on the new line character and forwards string arrays.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_Invertwhether to invert the matching sense.protected BaseRegExpm_RegExpthe regular expression to match.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description LineSplit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected voiddoFormatOutput(ExternalCommand command, boolean stdout, boolean blocking, String output)Formats the output received from the command.Classgenerates(boolean blocking)Returns what output type the formatter generates.booleangetInvert()Returns whether to invert the matching sense.BaseRegExpgetRegExp()Returns the regular expression to match the strings against.StringglobalInfo()Returns a string describing the object.StringinvertTipText()Returns the tip text for this property.StringregExpTipText()Returns the tip text for this property.voidsetInvert(boolean value)Sets whether to invert the matching sense.voidsetRegExp(BaseRegExp value)Sets the regular expression to match the strings against.-
Methods inherited from class adams.core.command.output.AbstractOutputFormatter
canFormatOutput, cleanUp, formatOutput
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_RegExp
protected BaseRegExp m_RegExp
the regular expression to match.
-
m_Invert
protected boolean m_Invert
whether to invert the matching sense.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setRegExp
public void setRegExp(BaseRegExp value)
Sets the regular expression to match the strings against.- Parameters:
value- the regular expression
-
getRegExp
public BaseRegExp getRegExp()
Returns the regular expression to match the strings against.- Returns:
- the regular expression
-
regExpTipText
public String regExpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setInvert
public void setInvert(boolean value)
Sets whether to invert the matching sense.- Parameters:
value- true if inverting matching sense
-
getInvert
public boolean getInvert()
Returns whether to invert the matching sense.- Returns:
- true if matching sense is inverted
-
invertTipText
public String invertTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
generates
public Class generates(boolean blocking)
Returns what output type the formatter generates.- Parameters:
blocking- returns the type when used on blocking mode output- Returns:
- the type
-
doFormatOutput
protected void doFormatOutput(ExternalCommand command, boolean stdout, boolean blocking, String output)
Formats the output received from the command. Feeds the formatted data back into the ExternalCommand instance.- Specified by:
doFormatOutputin classAbstractOutputFormatter- Parameters:
command- the external command to feed the output back intostdout- whether the output was from stdout or stderrblocking- whether the output was received via blocking or async executionoutput- the output to format
-
-