| org.springframework.beans.TypeConverter
All known Subclasses: org.springframework.beans.SimpleTypeConverter,
TypeConverter | public interface TypeConverter (Code) | | Interface that defines type conversion methods. Typically (but not necessarily)
implemented in conjunction with the PropertyEditorRegistry interface.
author: Juergen Hoeller since: 2.0 See Also: PropertyEditorRegistry See Also: SimpleTypeConverter See Also: BeanWrapperImpl |
Method Summary | |
Object | convertIfNecessary(Object value, Class requiredType) 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. | Object | convertIfNecessary(Object value, Class requiredType, MethodParameter methodParam) 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. |
convertIfNecessary | Object convertIfNecessary(Object value, Class requiredType) throws TypeMismatchException(Code) | | 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.
Parameters: value - the value to convert Parameters: requiredType - the type we must convert to(or null if not known, for example in case of a collection element) the new value, possibly the result of type conversion throws: TypeMismatchException - if type conversion failed See Also: java.beans.PropertyEditor.setAsText(String) See Also: java.beans.PropertyEditor.getValue |
convertIfNecessary | Object convertIfNecessary(Object value, Class requiredType, MethodParameter methodParam) throws TypeMismatchException(Code) | | 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.
Parameters: value - the value to convert Parameters: requiredType - the type we must convert to(or null if not known, for example in case of a collection element) Parameters: methodParam - the method parameter that is the target of the conversion(for analysis of generic types; may be null ) the new value, possibly the result of type conversion throws: TypeMismatchException - if type conversion failed See Also: java.beans.PropertyEditor.setAsText(String) See Also: java.beans.PropertyEditor.getValue |
|
|