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 StringgetName()Get the parameter name.StringgetType()Get the parameter type.TgetValue()Get the parameter value "undecoded".ObjectgetValue(ContentDeliveryConfig deliveryConfig)Get the parameter value "decoded" into an Object.ElementgetXml()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.StringtoString()
-
-
-
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 theParameterDecoderto 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 supplieddeliveryConfigto get theParameterDecoderimplementation to be used to decode the parameter value. Looks up theParameterDecoderusing the parameter type - selector="decoder-<type>".- Specified by:
getValuein 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.
-
-