Class DefaultParameter<T>

  • All Implemented Interfaces:
    org.smooks.api.resource.config.Parameter<T>

    public class DefaultParameter<T>
    extends Object
    implements org.smooks.api.resource.config.Parameter<T>
    • Constructor Detail

      • DefaultParameter

        public DefaultParameter​(String name,
                                T value)
        Public constructor.
        Parameters:
        name - Parameter name.
        value - Parameter value.
      • DefaultParameter

        public DefaultParameter​(String name,
                                T value,
                                String type)
        Public constructor.
        Parameters:
        name - Parameter name.
        value - Parameter value.
        type - Parameter type. This argument identifies the ParameterDecoder to use for decoding the param value.
    • Method Detail

      • getName

        public String getName()
        Get the parameter name.
        Specified by:
        getName in interface org.smooks.api.resource.config.Parameter<T>
        Returns:
        The parameter name.
      • getType

        public String getType()
        Get the parameter type.
        Specified by:
        getType in interface org.smooks.api.resource.config.Parameter<T>
        Returns:
        The parameter type.
      • getValue

        public T getValue()
        Get the parameter value "undecoded".
        Specified by:
        getValue in interface org.smooks.api.resource.config.Parameter<T>
        Returns:
        Parameter value.
      • getValue

        public Object getValue​(org.smooks.api.delivery.ContentDeliveryConfig deliveryConfig)
                        throws org.smooks.api.resource.config.ParameterDecodeException
        Get the parameter value "decoded" into an Object.

        Uses the supplied deliveryConfig to get the ParameterDecoder implementation to be used to decode the parameter value. Looks up the ParameterDecoder using the parameter type - selector="decoder-<type>".

        Specified by:
        getValue in interface org.smooks.api.resource.config.Parameter<T>
        Parameters:
        deliveryConfig - Requesting device ContentDeliveryConfig.
        Returns:
        Decoded value.
        Throws:
        org.smooks.api.resource.config.ParameterDecodeException - Unable to decode parameter value.
      • setXml

        public org.smooks.api.resource.config.Parameter<T> setXml​(Element xml)
        Set the DOM element node associated with the parameter definition.

        Only relevant for XML based configs.

        Specified by:
        setXml in interface org.smooks.api.resource.config.Parameter<T>
        Parameters:
        xml - Parameter configuration xml.
      • getXml

        public Element getXml()
        Get the DOM element node associated with the parameter definition.

        Only relevant for XML based configs.

        Specified by:
        getXml in interface org.smooks.api.resource.config.Parameter<T>
        Returns:
        Parameter configuration xml.