public class SimpleParam extends Object implements ParamHolder
ParamHolder
interface. Ultimately, this class
can be used as a simple key-value pair holder (parameter name-value) which uses an explicit/implicit JSF converter
to convert the object value to string.Constructor and Description |
---|
SimpleParam()
Default constructor.
|
SimpleParam(ParamHolder param)
Construct a simple param with name, value and converter of given
ParamHolder instance. |
SimpleParam(String name,
Object value)
Construct a simple param with name and value.
|
SimpleParam(String name,
Object value,
Converter converter)
Construct a simple param with name, value and converter.
|
SimpleParam(UIParameter param)
Construct a simple param with name and value of given
UIParameter component. |
Modifier and Type | Method and Description |
---|---|
Converter |
getConverter() |
Object |
getLocalValue()
Returns the original, unconverted value of the parameter.
|
String |
getName()
Returns the name of the parameter.
|
Object |
getValue()
Returns the converted value of the parameter.
|
void |
setConverter(Converter converter) |
void |
setName(String name)
Sets the parameter name.
|
void |
setValue(Object value) |
public SimpleParam()
public SimpleParam(String name, Object value)
name
- The parameter name.value
- The parameter value.public SimpleParam(String name, Object value, Converter converter)
name
- The parameter name.value
- The parameter value.converter
- The converter.public SimpleParam(UIParameter param)
UIParameter
component.param
- The UIParameter
to copy.public SimpleParam(ParamHolder param)
ParamHolder
instance.param
- The ParamHolder
to copy.public String getName()
ParamHolder
getName
in interface ParamHolder
public void setName(String name)
name
- The parameter name.public Object getLocalValue()
ParamHolder
getLocalValue
in interface ValueHolder
getLocalValue
in interface ParamHolder
public Object getValue()
ParamHolder
Application.createConverter(Class)
, passing the value's class, then return the result of
Converter.getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, Object)
,
otherwise return the original value of the parameter.getValue
in interface ValueHolder
getValue
in interface ParamHolder
Converter.getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, Object)
public void setValue(Object value)
setValue
in interface ValueHolder
public Converter getConverter()
getConverter
in interface ValueHolder
public void setConverter(Converter converter)
setConverter
in interface ValueHolder
Copyright © 2012–2016 OmniFaces. All rights reserved.