@DecodeType(value=java.lang.Enum.class) public class EnumDecoder extends Object implements DataDecoder, Configurable
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 returnedDataDecoder.Factory
Constructor and Description |
---|
EnumDecoder() |
Modifier and Type | Method and Description |
---|---|
Object |
decode(String data)
Decode the supplied String data into a new Object data instance.
|
Properties |
getConfiguration()
Get the component configuration.
|
void |
setConfiguration(Properties resourceConfig)
Set the component configuration.
|
void |
setEnumType(Class enumType) |
void |
setStrict(boolean strict) |
public void setConfiguration(Properties resourceConfig) throws SmooksConfigurationException
Configurable
setConfiguration
in interface Configurable
resourceConfig
- The component configuration properties.SmooksConfigurationException
- Bad component configuration.public Properties getConfiguration()
Configurable
getConfiguration
in interface Configurable
public void setEnumType(Class enumType)
public Object decode(String data) throws DataDecodeException
DataDecoder
decode
in interface DataDecoder
data
- Data to be decoded.DataDecodeException
- Error decoding data.public void setStrict(boolean strict)
Copyright © 2020. All rights reserved.