Class EnumConverter
java.lang.Object
org.x4o.xml.conv.AbstractObjectConverter
org.x4o.xml.conv.AbstractStringObjectConverter
org.x4o.xml.conv.text.EnumConverter
- All Implemented Interfaces:
Serializable
,Cloneable
,ObjectConverter
Converts Sring of an Enum into the enum value.
- Version:
- 1.0 Aug 31, 2007
- Author:
- Willem Cazander
- See Also:
-
Field Summary
Fields inherited from class org.x4o.xml.conv.AbstractObjectConverter
converters
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone this ObjectConverter.convertStringBack
(Object obj, Locale locale) Converts object into string.convertStringTo
(String str, Locale locale) Converts string into object.Class
<?> Returns the convert to class.void
setEnumClass
(String enumClass) Methods inherited from class org.x4o.xml.conv.AbstractStringObjectConverter
convertAfterBack, convertAfterTo, getObjectClassBack
Methods inherited from class org.x4o.xml.conv.AbstractObjectConverter
addObjectConverter, cloneConverters, convertBack, convertTo, getObjectConverters, removeObjectConverter
-
Constructor Details
-
EnumConverter
public EnumConverter()
-
-
Method Details
-
getObjectClassTo
Returns the convert to class.- Returns:
- The class to convert to.
- See Also:
-
convertStringTo
Converts string into object.- Specified by:
convertStringTo
in classAbstractStringObjectConverter
- Parameters:
str
- The string to convert to object.locale
- The locale to convert the string from.- Returns:
- The object converted from the string.
- Throws:
ObjectConverterException
- When conversion fails.- See Also:
-
convertStringBack
Converts object into string.- Specified by:
convertStringBack
in classAbstractStringObjectConverter
- Parameters:
obj
- The object to convert to string.locale
- The locale to convert the object from.- Returns:
- The string converted from the object.
- Throws:
ObjectConverterException
- When conversion fails.- See Also:
-
getEnumClass
- Returns:
- the enumClass
-
setEnumClass
- Parameters:
enumClass
- the enumClass to set
-
clone
Clone this ObjectConverter.- Specified by:
clone
in interfaceObjectConverter
- Specified by:
clone
in classAbstractObjectConverter
- Returns:
- The cloned ObjectConverter.
- Throws:
CloneNotSupportedException
- When cloning fails.- See Also:
-