Package com.atlassian.bamboo.ww2.common
Class EnumTypeConverter
java.lang.Object
ognl.DefaultTypeConverter
com.atlassian.bamboo.ww2.common.EnumTypeConverter
- All Implemented Interfaces:
com.opensymphony.xwork2.conversion.TypeConverter
,ognl.TypeConverter
public class EnumTypeConverter
extends ognl.DefaultTypeConverter
implements com.opensymphony.xwork2.conversion.TypeConverter
-
Field Summary
Fields inherited from interface com.opensymphony.xwork2.conversion.TypeConverter
NO_CONVERSION_POSSIBLE, TYPE_CONVERTER_CONTEXT_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertFromString
(String value, Class toClass) Converts one or more String values to the specified class.convertValue
(Map context, Object o, Class toClass) Converts the given object to a given type.Methods inherited from class ognl.DefaultTypeConverter
convertValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.opensymphony.xwork2.conversion.TypeConverter
convertValue
-
Constructor Details
-
EnumTypeConverter
public EnumTypeConverter()
-
-
Method Details
-
convertValue
Converts the given object to a given type. How this is to be done is implemented in toClass. The OGNL context, o and toClass are given. This method should be able to handle conversion in general without any context or object specified.- Overrides:
convertValue
in classognl.DefaultTypeConverter
- Parameters:
context
- - OGNL context under which the conversion is being doneo
- - the object to be convertedtoClass
- - the class that contains the code to convert to enumeration- Returns:
- Converted value of type declared in toClass or TypeConverter.NoConversionPossible to indicate that the conversion was not possible.
-
convertFromString
Converts one or more String values to the specified class.- Parameters:
value
- - the String values to be converted, such as those submitted from an HTML formtoClass
- - the class to convert to- Returns:
- the converted object
- See Also:
-
StrutsTypeConverter.convertFromString(java.util.Map, String[], Class)
-