org.springframework.core.convert.support
Class ConvertingPropertyEditorAdapter

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by org.springframework.core.convert.support.ConvertingPropertyEditorAdapter
All Implemented Interfaces:
java.beans.PropertyEditor

public class ConvertingPropertyEditorAdapter
extends java.beans.PropertyEditorSupport

Adapter that exposes a PropertyEditor for any given ConversionService and specific target type.

Since:
3.0
Author:
Juergen Hoeller

Field Summary
private  boolean canConvertToString
           
private  ConversionService conversionService
           
private  TypeDescriptor targetDescriptor
           
 
Constructor Summary
ConvertingPropertyEditorAdapter(ConversionService conversionService, TypeDescriptor targetDescriptor)
          Create a new ConvertingPropertyEditorAdapter for a given ConversionService and the given target type.
 
Method Summary
 java.lang.String getAsText()
           
 void setAsText(java.lang.String text)
           
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conversionService

private final ConversionService conversionService

targetDescriptor

private final TypeDescriptor targetDescriptor

canConvertToString

private final boolean canConvertToString
Constructor Detail

ConvertingPropertyEditorAdapter

public ConvertingPropertyEditorAdapter(ConversionService conversionService,
                                       TypeDescriptor targetDescriptor)
Create a new ConvertingPropertyEditorAdapter for a given ConversionService and the given target type.

Parameters:
conversionService - the ConversionService to delegate to
targetDescriptor - the target type to convert to
Method Detail

setAsText

public void setAsText(java.lang.String text)
               throws java.lang.IllegalArgumentException
Specified by:
setAsText in interface java.beans.PropertyEditor
Overrides:
setAsText in class java.beans.PropertyEditorSupport
Throws:
java.lang.IllegalArgumentException

getAsText

public java.lang.String getAsText()
Specified by:
getAsText in interface java.beans.PropertyEditor
Overrides:
getAsText in class java.beans.PropertyEditorSupport