Class DefaultParameter<T>
- java.lang.Object
-
- org.smooks.engine.resource.config.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 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(org.smooks.api.delivery.ContentDeliveryConfig deliveryConfig)Get the parameter value "decoded" into an Object.ElementgetXml()Get the DOM element node associated with the parameter definition.org.smooks.api.resource.config.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.- Specified by:
getNamein interfaceorg.smooks.api.resource.config.Parameter<T>- Returns:
- The parameter name.
-
getType
public String getType()
Get the parameter type.- Specified by:
getTypein interfaceorg.smooks.api.resource.config.Parameter<T>- Returns:
- The parameter type.
-
getValue
public T getValue()
Get the parameter value "undecoded".- Specified by:
getValuein interfaceorg.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 supplieddeliveryConfigto get theParameterDecoderimplementation to be used to decode the parameter value. Looks up theParameterDecoderusing the parameter type - selector="decoder-<type>".- Specified by:
getValuein interfaceorg.smooks.api.resource.config.Parameter<T>- Parameters:
deliveryConfig- Requesting deviceContentDeliveryConfig.- 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:
setXmlin interfaceorg.smooks.api.resource.config.Parameter<T>- Parameters:
xml- Parameter configuration xml.
-
-