org.springframework.core.convert.support
Class StringToEnumConverterFactory

java.lang.Object
  extended by org.springframework.core.convert.support.StringToEnumConverterFactory
All Implemented Interfaces:
ConverterFactory<java.lang.String,java.lang.Enum>

final class StringToEnumConverterFactory
extends java.lang.Object
implements ConverterFactory<java.lang.String,java.lang.Enum>

Converts from a String to a java.lang.Enum by calling Enum#valueOf(Class, String).

Since:
3.0
Author:
Keith Donald

Nested Class Summary
private  class StringToEnumConverterFactory.StringToEnum<T extends java.lang.Enum>
           
 
Constructor Summary
StringToEnumConverterFactory()
           
 
Method Summary
<T extends java.lang.Enum>
Converter<java.lang.String,T>
getConverter(java.lang.Class<T> targetType)
          Get the converter to convert from S to target type T, where T is also an instance of R.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringToEnumConverterFactory

StringToEnumConverterFactory()
Method Detail

getConverter

public <T extends java.lang.Enum> Converter<java.lang.String,T> getConverter(java.lang.Class<T> targetType)
Description copied from interface: ConverterFactory
Get the converter to convert from S to target type T, where T is also an instance of R.

Specified by:
getConverter in interface ConverterFactory<java.lang.String,java.lang.Enum>
Type Parameters:
T - the target type
Parameters:
targetType - the target type to convert to
Returns:
A converter from S to T