org.databene.commons.converter
Class NullSafeConverterProxy<S,T>
java.lang.Object
org.databene.commons.converter.ConverterWrapper<S,T>
org.databene.commons.converter.ConverterProxy<S,T>
org.databene.commons.converter.NullSafeConverterProxy<S,T>
- All Implemented Interfaces:
- java.lang.Cloneable, Converter<S,T>, ThreadAware
public class NullSafeConverterProxy<S,T>
- extends ConverterProxy<S,T>
Wraps another Converter and adds the feature of converting null values to a predefined value.
Created: 26.07.2007 06:59:35
- Author:
- Volker Bergmann
|
Method Summary |
T |
convert(S sourceValue)
Concerts an object of type S to an object of type T |
java.lang.Class<T> |
getTargetType()
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
realConverter
protected Converter<S,T> realConverter
nullResult
protected T nullResult
NullSafeConverterProxy
public NullSafeConverterProxy(Converter<S,T> realConverter,
T nullResult)
getTargetType
public java.lang.Class<T> getTargetType()
- Specified by:
getTargetType in interface Converter<S,T>- Overrides:
getTargetType in class ConverterProxy<S,T>
convert
public T convert(S sourceValue)
throws ConversionException
- Description copied from interface:
Converter
- Concerts an object of type S to an object of type T
- Parameters:
sourceValue - the object to convert
- Returns:
- the converted object
- Throws:
ConversionException - if the conversion fails
Copyright © 2010. All Rights Reserved.