Package adams.core.net.rabbitmq.send
Class StringConverter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.core.net.rabbitmq.send.AbstractConverter
-
- adams.core.net.rabbitmq.send.StringConverter
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.io.EncodingSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.QuickInfoSupporter
,adams.core.SizeOfHandler
,adams.flow.core.FlowContextHandler
,Serializable
public class StringConverter extends AbstractConverter implements adams.core.io.EncodingSupporter
For converting strings into byte arrays.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.core.base.BaseCharset
m_Encoding
the encoding to use.-
Fields inherited from class adams.core.net.rabbitmq.send.AbstractConverter
m_FlowContext
-
-
Constructor Summary
Constructors Constructor Description StringConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]
accepts()
Returns the classes that the converter accepts.void
defineOptions()
Adds options to the internal list of options.protected byte[]
doConvert(Object payload, adams.core.MessageCollection errors)
Converts the payload.String
encodingTipText()
Returns the tip text for this property.adams.core.base.BaseCharset
getEncoding()
Returns the encoding to use.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.String
globalInfo()
Returns a string describing the object.void
setEncoding(adams.core.base.BaseCharset value)
Sets the encoding to use.-
Methods inherited from class adams.core.net.rabbitmq.send.AbstractConverter
check, convert, getFlowContext, setFlowContext
-
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
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
setEncoding
public void setEncoding(adams.core.base.BaseCharset value)
Sets the encoding to use.- Specified by:
setEncoding
in interfaceadams.core.io.EncodingSupporter
- Parameters:
value
- the encoding, e.g. "UTF-8" or "UTF-16", empty string for default
-
getEncoding
public adams.core.base.BaseCharset getEncoding()
Returns the encoding to use.- Specified by:
getEncoding
in interfaceadams.core.io.EncodingSupporter
- Returns:
- the encoding, e.g. "UTF-8" or "UTF-16", empty string for default
-
encodingTipText
public String encodingTipText()
Returns the tip text for this property.- Specified by:
encodingTipText
in interfaceadams.core.io.EncodingSupporter
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractConverter
- Returns:
- null if no info available, otherwise short string
-
accepts
public Class[] accepts()
Returns the classes that the converter accepts.- Specified by:
accepts
in classAbstractConverter
- Returns:
- the classes
-
doConvert
protected byte[] doConvert(Object payload, adams.core.MessageCollection errors)
Converts the payload.- Specified by:
doConvert
in classAbstractConverter
- Parameters:
payload
- the payloaderrors
- for recording errors- Returns:
- null if failed to convert, otherwise byte array
-
-