com.atlassian.confluence.webwork.converters
Class EnumTypeConverter

java.lang.Object
  extended by ognl.DefaultTypeConverter
      extended by com.atlassian.confluence.webwork.converters.EnumTypeConverter
All Implemented Interfaces:
ognl.TypeConverter

public class EnumTypeConverter
extends ognl.DefaultTypeConverter

Converter class that converts strings in the request to the correct enum types.

Copied from webwork website :)


Constructor Summary
EnumTypeConverter()
           
 
Method Summary
 Object convertFromString(String value, Class toClass)
          Converts one or more String values to the specified class.
 Object 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
 

Constructor Detail

EnumTypeConverter

public EnumTypeConverter()
Method Detail

convertValue

public Object convertValue(Map context,
                           Object o,
                           Class toClass)
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 class ognl.DefaultTypeConverter
Parameters:
context - - OGNL context under which the conversion is being done
o - - the object to be converted
toClass - - 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

public Object convertFromString(String value,
                                Class toClass)
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 form
toClass - - the class to convert to
Returns:
the converted object


Copyright © 2003–2015 Atlassian. All rights reserved.