Class GetPropertyValue

  • All Implemented Interfaces:
    AdditionalInformationHandler, ArrayProvider, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ArrayProvider, ErrorHandler, InputConsumer, OutputProducer, Serializable, Comparable

    public class GetPropertyValue
    extends AbstractArrayProvider
    Obtains the value(s) associated with the keys that match the specified regular expression from the Properties object passing through.
    Null values are only forwarded if requested.

    Input/output:
    - accepts:
       java.util.Properties
    - generates:
       java.lang.String


    Valid options are:

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: GetPropertyValue
     
    -annotation <adams.core.base.BaseText> (property: annotations)
        The annotations to attach to this actor.
        default: 
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
        default: false
     
    -output-array <boolean> (property: outputArray)
        Whether to output the values as array or one-by-one.
        default: false
     
    -key <adams.core.base.BaseRegExp> (property: key)
        The regular expression to match the keys against.
        default: .*
     
    -data-type <PROPERTY|PATH|BOOLEAN|INTEGER|LONG|DOUBLE|COLOR|FONT|TIME|DATE|DATETIME|PASSWORD> (property: dataType)
        The type of the data that is output.
        default: PROPERTY
     
    -forward-null <boolean> (property: forwardNull)
        If enabled, null values are forward as well.
        default: false
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Key

        protected BaseRegExp m_Key
        the regular expression for the keys to obtain the values for.
      • m_ForwardNull

        protected boolean m_ForwardNull
        whether to forward null values.
    • Constructor Detail

      • GetPropertyValue

        public GetPropertyValue()
    • Method Detail

      • setKey

        public void setKey​(BaseRegExp value)
        Sets the regular expression to match the keys against.
        Parameters:
        value - the expression
      • getKey

        public BaseRegExp getKey()
        Returns the regular expression to match the keys against.
        Returns:
        the expression
      • keyTipText

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

        public void setDataType​(PropertiesDataType value)
        Sets the type of the value(s).
        Parameters:
        value - the type
      • getDataType

        public PropertiesDataType getDataType()
        Returns the type of the value(s).
        Returns:
        the type
      • dataTypeTipText

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

        public void setForwardNull​(boolean value)
        Sets whether to forward null values.
        Parameters:
        value - true if to forward
      • getForwardNull

        public boolean getForwardNull()
        Returns whether to forward null values.
        Returns:
        true if to forward
      • forwardNullTipText

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

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Returns:
        the Class of objects that can be processed
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message