public class ConverterHelper extends Object
Helper class to provide access to by-type JavaServer Faces
Converter
capabilities. This implementation is stateless
and maintains no cached information, so instances may be freely created
and destroyed with no side effects.
Constructor and Description |
---|
ConverterHelper() |
Modifier and Type | Method and Description |
---|---|
Object |
asObject(javax.faces.context.FacesContext context,
Class type,
String value)
Use the registered by-type
Converter to convert the
specified String value to a corresponding Object value. |
String |
asString(javax.faces.context.FacesContext context,
Class type,
Object value)
Use the registered by-type
Converter to convert the
specified Object value to a corresponding String value. |
public Object asObject(javax.faces.context.FacesContext context, Class type, String value)
Use the registered by-type Converter
to convert the
specified String value to a corresponding Object value.
context
- FacesContext
for the current requesttype
- Type to which this value should be converted
(used to select the appropriate by-type converter)value
- Value to be convertedjavax.faces.convert.ConverterException
- if a conversion error occurspublic String asString(javax.faces.context.FacesContext context, Class type, Object value)
Use the registered by-type Converter
to convert the
specified Object value to a corresponding String value.
context
- FacesContext
for the current requesttype
- Type from which this value should be converted
(used to select the appropriate by-type converter)value
- Value to be convertedjavax.faces.convert.ConverterException
- if a conversion error occursCopyright © 2004-2013 Apache Software Foundation. All Rights Reserved.