Package com.sun.faces.application
Class ConverterPropertyEditorBase
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- com.sun.faces.application.ConverterPropertyEditorBase
-
- All Implemented Interfaces:
PropertyEditor
- Direct Known Subclasses:
ConverterPropertyEditorFor_XXXX
public abstract class ConverterPropertyEditorBase extends PropertyEditorSupport
Abstract base for aPropertyEditor
that delegates to a faces Converter that was registered by-type in a faces-config descriptor. Concrete implementations (such as generated byConverterPropertyEditorFactory
) will overridegetTargetClass()
. (This is based on the original ConverterPropertyEditor code).
-
-
Constructor Summary
Constructors Constructor Description ConverterPropertyEditorBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getAsText()
Convert an object of typegetTargetClass()
to text by delegating to a converter obtained from the Faces Application.protected abstract Class<?>
getTargetClass()
Return the target class of the objects that are being edited.void
setAsText(String textValue)
Convert thetextValue
to an object of typegetTargetClass()
by delegating to a converter in the faces Application.-
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
-
-
-
-
Method Detail
-
getTargetClass
protected abstract Class<?> getTargetClass()
Return the target class of the objects that are being edited. This is used as a key to find the appropriateConverter
from the Faces application.- Returns:
- the target class.
-
setAsText
public void setAsText(String textValue) throws IllegalArgumentException
Convert thetextValue
to an object of typegetTargetClass()
by delegating to a converter in the faces Application.- Specified by:
setAsText
in interfacePropertyEditor
- Overrides:
setAsText
in classPropertyEditorSupport
- Throws:
IllegalArgumentException
-
getAsText
public String getAsText()
Convert an object of typegetTargetClass()
to text by delegating to a converter obtained from the Faces Application.- Specified by:
getAsText
in interfacePropertyEditor
- Overrides:
getAsText
in classPropertyEditorSupport
-
-