Class AbstractCallableTransformer<T>

  • All Implemented Interfaces:
    adams.core.AdditionalInformationHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.flow.core.CallableActorUser, adams.flow.core.FlowContextHandler, RESTPlugin, Serializable
    Direct Known Subclasses:
    CallableJsonTransformer, CallableTextTransformer

    public abstract class AbstractCallableTransformer<T>
    extends AbstractRESTPluginWithFlowContext
    implements adams.flow.core.CallableActorUser
    Ancestor for plugins that process the data with a callable transformer.
    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.CallableActorHelper m_Helper
      the helper class.
      protected adams.flow.core.CallableActorReference m_Transformer
      the callable transformer to use for processing.
      protected adams.flow.core.Actor m_TransformerActor
      the actual actor.
      protected boolean m_TransformerActorInitialized
      whether the transformer actor has been set up.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected String checkCompatibility()
      Hook method to add compatibility checks.
      void defineOptions()
      Adds options to the internal list of options.
      protected Object doProcess​(Object input, adams.core.MessageCollection errors)
      Processes the incoming data.
      adams.flow.core.Actor getCallableActor()
      Returns the currently set callable actor.
      adams.flow.core.CallableActorReference getTransformer()
      Returns the name of the callable actor to use as transformer.
      protected String globalInfoBase()
      Returns a string describing the object.
      protected void initialize()
      Initializes the members.
      protected String initTransformer()
      Initializes the transformer.
      protected void reset()
      Resets the scheme.
      void setTransformer​(adams.flow.core.CallableActorReference value)
      Sets the name of the callable actor to use as transformer.
      String transformerTipText()
      Returns the tip text for this property.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.GlobalInfoSupporter

        globalInfo
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
      • Methods inherited from interface adams.core.logging.LoggingSupporter

        getLogger, isLoggingEnabled
    • Field Detail

      • m_Transformer

        protected adams.flow.core.CallableActorReference m_Transformer
        the callable transformer to use for processing.
      • m_TransformerActor

        protected transient adams.flow.core.Actor m_TransformerActor
        the actual actor.
      • m_TransformerActorInitialized

        protected boolean m_TransformerActorInitialized
        whether the transformer actor has been set up.
      • m_Helper

        protected adams.flow.core.CallableActorHelper m_Helper
        the helper class.
    • Constructor Detail

      • AbstractCallableTransformer

        public AbstractCallableTransformer()
    • Method Detail

      • globalInfoBase

        protected String globalInfoBase()
        Returns a string describing the object.
        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 interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.core.option.AbstractOptionHandler
      • reset

        protected void reset()
        Resets the scheme.
        Overrides:
        reset in class adams.core.option.AbstractOptionHandler
      • setTransformer

        public void setTransformer​(adams.flow.core.CallableActorReference value)
        Sets the name of the callable actor to use as transformer.
        Parameters:
        value - the callable name
      • getTransformer

        public adams.flow.core.CallableActorReference getTransformer()
        Returns the name of the callable actor to use as transformer.
        Returns:
        the callable name
      • transformerTipText

        public String transformerTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getCallableActor

        public adams.flow.core.Actor getCallableActor()
        Returns the currently set callable actor.
        Specified by:
        getCallableActor in interface adams.flow.core.CallableActorUser
        Returns:
        the actor, can be null
      • checkCompatibility

        protected String checkCompatibility()
        Hook method to add compatibility checks.
        Default implementation does nothing.
        Returns:
        null if compatible, otherwise error message
      • initTransformer

        protected String initTransformer()
        Initializes the transformer.
        Returns:
        null if successfully initialized
      • doProcess

        protected Object doProcess​(Object input,
                                   adams.core.MessageCollection errors)
        Processes the incoming data.
        Parameters:
        input - the input data
        errors - for collecting errors
        Returns:
        the generated output, null if none generated