Top Description Fields Constructors Methods
org.springframework.core.convert.support

public Class ConvertingPropertyEditorAdapter

extends PropertyEditorSupport
Class Inheritance
Imports
java.beans.PropertyEditorSupport, org.springframework.core.convert.ConversionService, .TypeDescriptor, org.springframework.lang.Nullable, org.springframework.util.Assert

Adapter that exposes a java.beans.PropertyEditor for any given org.springframework.core.convert.ConversionService and specific target type.
Author
Juergen Hoeller
Since
3.0

Field Summary

Modifier and TypeField and Description
private final boolean
private final ConversionService
private final TypeDescriptor

Constructor Summary

AccessConstructor and Description
public
ConvertingPropertyEditorAdapter(ConversionService
the ConversionService to delegate to
conversionService
,
TypeDescriptor
the target type to convert to
targetDescriptor
)

Create a new ConvertingPropertyEditorAdapter for a given org.springframework.core.convert.ConversionService and the given target type.

Method Summary

Modifier and TypeMethod and Description
public String
getAsText()

Overrides java.beans.PropertyEditorSupport.getAsText.

Implements java.beans.PropertyEditor.getAsText.

Gets the property value as a string suitable for presentation to a human to edit.

public void
setAsText(String
The string to be parsed.
text
)

Overrides java.beans.PropertyEditorSupport.setAsText.

Implements java.beans.PropertyEditor.setAsText.

Sets the property value by parsing a given String.

Inherited from java.beans.PropertyEditorSupport:
addPropertyChangeListenerfirePropertyChangegetCustomEditorgetJavaInitializationStringgetSourcegetTagsgetValueisPaintablepaintValueremovePropertyChangeListenersetSourcesetValuesupportsCustomEditor

Field Detail

canConvertToStringback to summary
private final boolean canConvertToString
conversionServiceback to summary
private final ConversionService conversionService
targetDescriptorback to summary
private final TypeDescriptor targetDescriptor

Constructor Detail

ConvertingPropertyEditorAdapterback to summary
public ConvertingPropertyEditorAdapter(ConversionService conversionService, TypeDescriptor targetDescriptor)

Create a new ConvertingPropertyEditorAdapter for a given org.springframework.core.convert.ConversionService and the given target type.

Parameters
conversionService:ConversionService

the ConversionService to delegate to

targetDescriptor:TypeDescriptor

the target type to convert to

Method Detail

getAsTextback to summary
public String getAsText()

Overrides java.beans.PropertyEditorSupport.getAsText.

Implements java.beans.PropertyEditor.getAsText.

Doc from java.beans.PropertyEditorSupport.getAsText.

Gets the property value as a string suitable for presentation to a human to edit.

Returns:String

The property value as a string suitable for presentation to a human to edit.

Returns null if the value can't be expressed as a string.

If a non-null value is returned, then the PropertyEditor should be prepared to parse that string back in setAsText().

Annotations
@Override
@Nullable
setAsTextback to summary
public void setAsText(String text) throws IllegalArgumentException

Overrides java.beans.PropertyEditorSupport.setAsText.

Implements java.beans.PropertyEditor.setAsText.

Doc from java.beans.PropertyEditorSupport.setAsText.

Sets the property value by parsing a given String. May raise java.lang.IllegalArgumentException if either the String is badly formatted or if this kind of property can't be expressed as text.

Parameters
text:String

The string to be parsed.

Annotations
@Override