|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.binding.convert.support.AbstractConverter
public abstract class AbstractConverter
Base class for converters provided as a convenience to implementors.
Constructor Summary | |
---|---|
AbstractConverter()
|
Method Summary | |
---|---|
java.lang.Object |
convert(java.lang.Object source)
Convenience convert method that converts the provided source to the first target object supported by this converter. |
java.lang.Object |
convert(java.lang.Object source,
java.lang.Class targetClass)
Convenience convert method that converts the provided source to the target class specified with an empty conversion context. |
java.lang.Object |
convert(java.lang.Object source,
java.lang.Class targetClass,
ConversionContext context)
Convert the provided source object argument to an instance of the specified target class. |
java.lang.Object |
convert(java.lang.Object source,
ConversionContext context)
Convenience convert method that converts the provided source to the first target object supported by this converter. |
protected abstract java.lang.Object |
doConvert(java.lang.Object source,
java.lang.Class targetClass,
ConversionContext context)
Template method subclasses should override to actually perform the type conversion. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.binding.convert.Converter |
---|
getSourceClasses, getTargetClasses |
Constructor Detail |
---|
public AbstractConverter()
Method Detail |
---|
public java.lang.Object convert(java.lang.Object source) throws ConversionException
source
- the source to convert
ConversionException
- an exception occured converting the source valuepublic java.lang.Object convert(java.lang.Object source, java.lang.Class targetClass) throws ConversionException
source
- the source to converttargetClass
- the target class to convert the source to, must be one of the supported
targetClasses
ConversionException
- an exception occured converting the source valuepublic java.lang.Object convert(java.lang.Object source, ConversionContext context) throws ConversionException
source
- the source to convertcontext
- the conversion context, useful for influencing the behavior of the converter
ConversionException
- an exception occured converting the source valuepublic java.lang.Object convert(java.lang.Object source, java.lang.Class targetClass, ConversionContext context) throws ConversionException
Converter
convert
in interface Converter
source
- the source object to convert, its class must be one of the supported sourceClasses
targetClass
- the target class to convert the source to, must be one of the supported
targetClasses
context
- an optional conversion context that may be used to influence the conversion process
ConversionException
- an exception occured during the conversionprotected abstract java.lang.Object doConvert(java.lang.Object source, java.lang.Class targetClass, ConversionContext context) throws java.lang.Exception
source
- the source to convert fromtargetClass
- the target type to convert tocontext
- an optional conversion context that may be used to influence the conversion process, could be null
java.lang.Exception
- an exception occured, will be wrapped in a conversion exception if necessary
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |