org.milyn.javabean.decoders
Class EnumDecoder
java.lang.Object
org.milyn.javabean.decoders.EnumDecoder
- All Implemented Interfaces:
- Serializable, Configurable, DataDecoder
@DecodeType(value=java.lang.Enum.class)
public class EnumDecoder
- extends Object
- implements DataDecoder, Configurable
Enum instance decoder.
The enumeration type is specified through the "enumType" configuration
param. Enum constant value mappings can be performed as per the
MappingDecoder.
The "strict" configuration param determines how data that do not
map to valid enum constants will be handled. Under the default behavior, or
when specifying strict as "true", an error will be thrown. If strict is
"false" null will be returned
- Author:
- tom.fennelly@gmail.com
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EnumDecoder
public EnumDecoder()
setConfiguration
public void setConfiguration(Properties resourceConfig)
throws SmooksConfigurationException
- Description copied from interface:
Configurable
- Set the component configuration.
- Specified by:
setConfiguration in interface Configurable
- Parameters:
resourceConfig - The component configuration properties.
- Throws:
SmooksConfigurationException - Bad component configuration.
getConfiguration
public Properties getConfiguration()
- Description copied from interface:
Configurable
- Get the component configuration.
- Specified by:
getConfiguration in interface Configurable
- Returns:
- The component configuration properties.
setEnumType
public void setEnumType(Class enumType)
decode
public Object decode(String data)
throws DataDecodeException
- Description copied from interface:
DataDecoder
- Decode the supplied String data into a new Object data instance.
- Specified by:
decode in interface DataDecoder
- Parameters:
data - Data to be decoded.
- Returns:
- Decoded data Object.
- Throws:
DataDecodeException - Error decoding data.
setStrict
public void setStrict(boolean strict)
Copyright © 2018. All rights reserved.