Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » beans » [javadoc | source]
org.springframework.beans
public interface: TypeConverter [javadoc | source]

All Known Implementing Classes:
    SimpleTypeConverter, ServletRequestDataBinder, BeanWrapper, PortletRequestDataBinder, DataBinder, WebRequestDataBinder, BeanWrapperImpl, AbstractPropertyAccessor, ConfigurablePropertyAccessor, WebDataBinder, DirectFieldAccessor

Interface that defines type conversion methods. Typically (but not necessarily) implemented in conjunction with the PropertyEditorRegistry interface.
Method from org.springframework.beans.TypeConverter Summary:
convertIfNecessary,   convertIfNecessary
Method from org.springframework.beans.TypeConverter Detail:
 public Object convertIfNecessary(Object value,
    Class requiredType) throws TypeMismatchException
    Convert the value to the required type (if necessary from a String).

    Conversions from String to any type will typically use the setAsText method of the PropertyEditor class. Note that a PropertyEditor must be registered for the given class for this to work; this is a standard JavaBeans API. A number of PropertyEditors are automatically registered.

 public Object convertIfNecessary(Object value,
    Class requiredType,
    MethodParameter methodParam) throws TypeMismatchException
    Convert the value to the required type (if necessary from a String).

    Conversions from String to any type will typically use the setAsText method of the PropertyEditor class. Note that a PropertyEditor must be registered for the given class for this to work; this is a standard JavaBeans API. A number of PropertyEditors are automatically registered.