br.com.caelum.iogi.conversion
Class FallbackConverter<T>

java.lang.Object
  extended by br.com.caelum.iogi.conversion.TypeConverter<T>
      extended by br.com.caelum.iogi.conversion.FallbackConverter<T>
All Implemented Interfaces:
Instantiator<T>

public class FallbackConverter<T>
extends TypeConverter<T>


Constructor Summary
FallbackConverter(TypeConverter<T> delegate, T fallbackValue)
           
 
Method Summary
protected  T convert(String stringValue, Target<?> to)
           
static
<T> FallbackConverter<T>
fallbackTo(TypeConverter<T> delegate, T fallbackValue)
           
static
<T> FallbackConverter<T>
fallbackToNull(TypeConverter<T> delegate)
           
 boolean isAbleToInstantiate(Target<?> target)
           
 
Methods inherited from class br.com.caelum.iogi.conversion.TypeConverter
instantiate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FallbackConverter

public FallbackConverter(TypeConverter<T> delegate,
                         T fallbackValue)
Method Detail

fallbackToNull

public static <T> FallbackConverter<T> fallbackToNull(TypeConverter<T> delegate)

fallbackTo

public static <T> FallbackConverter<T> fallbackTo(TypeConverter<T> delegate,
                                                  T fallbackValue)

convert

protected T convert(String stringValue,
                    Target<?> to)
             throws Exception
Specified by:
convert in class TypeConverter<T>
Throws:
Exception

isAbleToInstantiate

public boolean isAbleToInstantiate(Target<?> target)


Copyright © 2014. All Rights Reserved.