public class EnumHelper extends Object
| Constructor and Description |
|---|
EnumHelper()
No-op constructor (for beans conformity)
|
EnumHelper(Enum e)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
getEnumClass()
Get the fully qualified enum class name
|
String |
getSelectedEnumValue()
Get the selected/wrapped enum value (as obtained by calling toString() on
the enum value)
|
static void |
main(String[] args)
Main method for testing this class
|
void |
setEnumClass(String enumClass)
Set the fully qualified enum class name
|
void |
setSelectedEnumValue(String selectedEnumValue)
Set the selected/wrapped enum value (as obtained by calling toString() on
the enum value)
|
static Object |
valueFromString(String enmumClass,
String enumValue)
Helper method to recover an enum value given the fully qualified name of
the enum and the value in question as strings
|
public EnumHelper(Enum e)
e - the enum value to wrappublic EnumHelper()
public void setEnumClass(String enumClass)
enumClass - the fully qualified name of the enum classpublic String getEnumClass()
public void setSelectedEnumValue(String selectedEnumValue)
selectedEnumValue - the enum value to wrappublic String getSelectedEnumValue()
public static Object valueFromString(String enmumClass, String enumValue) throws Exception
enmumClass - a string containing the fully qualified name of the enum
classenumValue - a string containing the value of the enum to findException - if a problem occurspublic static void main(String[] args)
args - argumentsCopyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.