org.codehaus.waffle.bind.converters
Class EnumValueConverter

java.lang.Object
  extended by org.codehaus.waffle.bind.converters.EnumValueConverter
All Implemented Interfaces:
ValueConverter

public class EnumValueConverter
extends java.lang.Object
implements ValueConverter

ValueConverter that converts Enum values.

Author:
Michael Ward, Mauro Talevi

Constructor Summary
EnumValueConverter()
           
 
Method Summary
 boolean accept(java.lang.reflect.Type type)
          Determines if converter is compatible with the given type
 java.lang.Object convertValue(java.lang.String propertyName, java.lang.String value, java.lang.reflect.Type type)
          Converts a String value to an Object of a given type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumValueConverter

public EnumValueConverter()
Method Detail

accept

public boolean accept(java.lang.reflect.Type type)
Description copied from interface: ValueConverter
Determines if converter is compatible with the given type

Specified by:
accept in interface ValueConverter
Parameters:
type - the Type a value is to be bound to
Returns:
A boolean true is type is compatible

convertValue

public java.lang.Object convertValue(java.lang.String propertyName,
                                     java.lang.String value,
                                     java.lang.reflect.Type type)
Description copied from interface: ValueConverter
Converts a String value to an Object of a given type

Specified by:
convertValue in interface ValueConverter
Parameters:
propertyName - the associated property name, which can be null, also needed to present customized error messages.
value - the String value
type - the Object Type
Returns:
The converted Object


Copyright © 2008. All Rights Reserved.