Class ConvertingPropertyEditorAdapter
- java.lang.Object
- java.beans.PropertyEditorSupport
- org.springframework.core.convert.support.ConvertingPropertyEditorAdapter
- All Implemented Interfaces:
PropertyEditor
public class ConvertingPropertyEditorAdapter extends PropertyEditorSupport
Adapter that exposes aPropertyEditor
for any givenConversionService
and specific target type.- Since:
- 3.0
- Author:
- Juergen Hoeller
Constructor Summary
Constructors Constructor Description ConvertingPropertyEditorAdapter(ConversionService conversionService, TypeDescriptor targetDescriptor)
Create a new ConvertingPropertyEditorAdapter for a givenConversionService
and the given target type.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAsText()
void
setAsText(String text)
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
Constructor Detail
ConvertingPropertyEditorAdapter
public ConvertingPropertyEditorAdapter(ConversionService conversionService, TypeDescriptor targetDescriptor)
Create a new ConvertingPropertyEditorAdapter for a givenConversionService
and the given target type.- Parameters:
conversionService
- the ConversionService to delegate totargetDescriptor
- the target type to convert to
Method Detail
setAsText
public void setAsText(@Nullable String text) throws IllegalArgumentException
- Specified by:
setAsText
in interfacePropertyEditor
- Overrides:
setAsText
in classPropertyEditorSupport
- Throws:
IllegalArgumentException
getAsText
@Nullable public String getAsText()
- Specified by:
getAsText
in interfacePropertyEditor
- Overrides:
getAsText
in classPropertyEditorSupport