Package adams.core.net.rabbitmq.receive
Class AbstractConverter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.core.net.rabbitmq.receive.AbstractConverter
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.QuickInfoSupporter
,adams.core.SizeOfHandler
,adams.flow.core.FlowContextHandler
,Serializable
- Direct Known Subclasses:
BinaryConverter
,DataExchangeServerBasedConverter
,FileBasedConverter
,StringConverter
public abstract class AbstractConverter extends adams.core.option.AbstractOptionHandler implements adams.core.QuickInfoSupporter, adams.flow.core.FlowContextHandler
Ancestor for converters that convert the data to was received.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.flow.core.Actor
m_FlowContext
the flow context.
-
Constructor Summary
Constructors Constructor Description AbstractConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
check(byte[] payload)
Hook method for checks.Object
convert(byte[] payload, adams.core.MessageCollection errors)
Converts the payload.protected abstract Object
doConvert(byte[] payload, adams.core.MessageCollection errors)
Converts the payload.abstract Class
generates()
Returns the class that the converter generates.adams.flow.core.Actor
getFlowContext()
Returns the flow context.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.void
setFlowContext(adams.flow.core.Actor value)
Sets the flow context.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
setFlowContext
public void setFlowContext(adams.flow.core.Actor value)
Sets the flow context.- Specified by:
setFlowContext
in interfaceadams.flow.core.FlowContextHandler
- Parameters:
value
- the context
-
getFlowContext
public adams.flow.core.Actor getFlowContext()
Returns the flow context.- Specified by:
getFlowContext
in interfaceadams.flow.core.FlowContextHandler
- Returns:
- the context, null if not available
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.
Default implementation returns null.- Specified by:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Returns:
- null if no info available, otherwise short string
-
generates
public abstract Class generates()
Returns the class that the converter generates.- Returns:
- the class
-
check
public String check(byte[] payload)
Hook method for checks.- Parameters:
payload
- the payload to check- Returns:
- null if sucessfully checked, otherwise error message
-
doConvert
protected abstract Object doConvert(byte[] payload, adams.core.MessageCollection errors)
Converts the payload.- Parameters:
payload
- the payloaderrors
- for recording errors- Returns:
- null if failed to convert, otherwise byte array
-
convert
public Object convert(byte[] payload, adams.core.MessageCollection errors)
Converts the payload.- Parameters:
payload
- the payloaderrors
- for recording errors- Returns:
- null if failed to convert, otherwise byte array
-
-