Top Description Fields Constructors Methods
com.sun.faces.application

public Class PropertyEditorHelper

extends Object
Class Inheritance
Imports
com.sun.faces.util.MessageFactory, .RequestStateManager, jakarta.faces.FacesException, jakarta.faces.application.Application, .FacesMessage, jakarta.faces.component.UIComponent, .UIInput, jakarta.faces.context.FacesContext, jakarta.faces.convert.Converter, .ConverterException

Helper class to aid the ConverterPropertyEditorBase in converting properties.
Author
Mike Youngstrom

Field Summary

Modifier and TypeField and Description
private Application

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
addConversionErrorMessage(FacesContext
the involved faces context
context
,
UIComponent
the involved component
component
,
ConverterException
the converter exception
ce
)

Add a conversion error message in the case of a PropertyEditor based conversion error.

public Object

Returns:

the conversion result
convertToObject
(Class<?>
the target class
targetClass
,
String
the text value
textValue
)

Convert the textValue to an object of type targetClass by delegating to a converter.

public String

Returns:

the conversion result
convertToString
(Class<?>
the target class
targetClass
,
Object
the value
value
)

Convert an object of type targetClass to text by delegating to a converter obtained from the Faces application.

protected UIComponent

Returns:

the current component, or null.
getComponent
()

Return the jakarta.faces.component.UIComponent that is currently being processed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

appback to summary
private Application app

Constructor Detail

PropertyEditorHelperback to summary
public PropertyEditorHelper(Application app)

Method Detail

addConversionErrorMessageback to summary
protected void addConversionErrorMessage(FacesContext context, UIComponent component, ConverterException ce)

Add a conversion error message in the case of a PropertyEditor based conversion error.

Parameters
context:FacesContext

the involved faces context

component:UIComponent

the involved component

ce:ConverterException

the converter exception

convertToObjectback to summary
public Object convertToObject(Class<?> targetClass, String textValue)

Convert the textValue to an object of type targetClass by delegating to a converter.

Parameters
targetClass:Class<?>

the target class

textValue:String

the text value

Returns:Object

the conversion result

convertToStringback to summary
public String convertToString(Class<?> targetClass, Object value)

Convert an object of type targetClass to text by delegating to a converter obtained from the Faces application.

Parameters
targetClass:Class<?>

the target class

value:Object

the value

Returns:String

the conversion result

getComponentback to summary
protected UIComponent getComponent()

Return the jakarta.faces.component.UIComponent that is currently being processed.

Returns:UIComponent

the current component, or null.