Class DefaultParameter<T>
- java.lang.Object
-
- org.smooks.engine.resource.config.DefaultParameter<T>
-
-
Field Summary
-
Fields inherited from interface org.smooks.api.resource.config.Parameter
PARAM_TYPE_PREFIX
-
-
Constructor Summary
Constructors Constructor Description DefaultParameter(String name, T value)
Public constructor.DefaultParameter(String name, T value, String type)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
Get the parameter name.String
getType()
Get the parameter type.T
getValue()
Get the parameter value "undecoded".Object
getValue(ContentDeliveryConfig deliveryConfig)
Get the parameter value "decoded" into an Object.Element
getXml()
Get the DOM element node associated with the parameter definition.Parameter<T>
setXml(Element xml)
Set the DOM element node associated with the parameter definition.String
toString()
-
-
-
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 theParameterDecoder
to use for decoding the param value.
-
-
Method Detail
-
getName
public String getName()
Get the parameter name.
-
getType
public String getType()
Get the parameter type.
-
getValue
public T getValue()
Get the parameter value "undecoded".
-
getValue
public Object getValue(ContentDeliveryConfig deliveryConfig) throws ParameterDecodeException
Get the parameter value "decoded" into an Object. Uses the supplieddeliveryConfig
to get theParameterDecoder
implementation to be used to decode the parameter value. Looks up theParameterDecoder
using the parameter type - selector="decoder-<type>".- Specified by:
getValue
in interfaceParameter<T>
- Parameters:
deliveryConfig
- Requesting deviceContentDeliveryConfig
.- Returns:
- Decoded value.
- Throws:
ParameterDecodeException
- Unable to decode parameter value.
-
setXml
public Parameter<T> setXml(Element xml)
Set the DOM element node associated with the parameter definition. Only relevant for XML based configs.
-
-