- java.lang.Object
- 
- org.omnifaces.component.SimpleParam<T>
 
- 
- Type Parameters:
- T- The type of the value.
 - All Implemented Interfaces:
- ValueHolder,- ParamHolder<T>
 
 public class SimpleParam<T> extends Object implements ParamHolder<T> This class provides a basic and default implementation of theParamHolderinterface. Ultimately, this class can be used as a simple key-value pair holder (parameter name-value) which uses an explicit/implicit Faces converter to convert the object value to string.- Since:
- 1.7
- Author:
- Bauke Scholtz
 
- 
- 
Constructor SummaryConstructors Constructor Description SimpleParam()Default constructor.SimpleParam(UIParameter param)Construct a simple param with name and value of givenUIParametercomponent.SimpleParam(String name, T value)Construct a simple param with name and value.SimpleParam(String name, T value, Converter<T> converter)Construct a simple param with name, value and converter.SimpleParam(ParamHolder<T> param)Construct a simple param with name, value and converter of givenParamHolderinstance.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Converter<T>getConverter()Returns the converter, if any.TgetLocalValue()Returns the original, unconverted value of the parameter.StringgetName()Returns the name of the parameter.StringgetValue()Returns the value of the parameter asString.voidsetConverter(Converter converter)voidsetName(String name)Sets the parameter name.voidsetValue(Object value)
 
- 
- 
- 
Constructor Detail- 
SimpleParampublic SimpleParam() Default constructor.
 - 
SimpleParampublic SimpleParam(String name, T value) Construct a simple param with name and value.- Parameters:
- name- The parameter name.
- value- The parameter value.
 
 - 
SimpleParampublic SimpleParam(String name, T value, Converter<T> converter) Construct a simple param with name, value and converter.- Parameters:
- name- The parameter name.
- value- The parameter value.
- converter- The converter.
 
 - 
SimpleParampublic SimpleParam(UIParameter param) Construct a simple param with name and value of givenUIParametercomponent.- Parameters:
- param- The- UIParameterto copy.
- Throws:
- ClassCastException- When actual parameter value is not- T.
- Since:
- 2.2
 
 - 
SimpleParampublic SimpleParam(ParamHolder<T> param) Construct a simple param with name, value and converter of givenParamHolderinstance.- Parameters:
- param- The- ParamHolderto copy.
- Since:
- 2.2
 
 
- 
 - 
Method Detail- 
getNamepublic String getName() Description copied from interface:ParamHolderReturns the name of the parameter.- Specified by:
- getNamein interface- ParamHolder<T>
- Returns:
- The name of the parameter.
 
 - 
setNamepublic void setName(String name) Sets the parameter name.- Parameters:
- name- The parameter name.
 
 - 
getLocalValuepublic T getLocalValue() Description copied from interface:ParamHolderReturns the original, unconverted value of the parameter.- Specified by:
- getLocalValuein interface- ParamHolder<T>
- Specified by:
- getLocalValuein interface- ValueHolder
- Returns:
- The original, unconverted value of the parameter.
 
 - 
getValuepublic String getValue() Description copied from interface:ParamHolderReturns the value of the parameter asString. If the converter is set, or if any converter is available byApplication.createConverter(Class), passing the value's class, then return the result ofConverter.getAsString(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent, Object), otherwise return theObject.toString()of the value.- Specified by:
- getValuein interface- ParamHolder<T>
- Specified by:
- getValuein interface- ValueHolder
- Returns:
- The value of the parameter as String.
- See Also:
- Converter.getAsString(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent, Object)
 
 - 
setValuepublic void setValue(Object value) - Specified by:
- setValuein interface- ValueHolder
- Throws:
- ClassCastException- When actual value is not- T.
 
 - 
getConverterpublic Converter<T> getConverter() Description copied from interface:ParamHolderReturns the converter, if any.- Specified by:
- getConverterin interface- ParamHolder<T>
- Specified by:
- getConverterin interface- ValueHolder
- Returns:
- The converter, if any.
 
 - 
setConverterpublic void setConverter(Converter converter) - Specified by:
- setConverterin interface- ValueHolder
 
 
- 
 
-