public class ParseEnum extends CellProcessorAdaptor implements StringCellProcessor
next
Constructor and Description |
---|
ParseEnum(Class<T> enumClass)
Constructs a new ParseEnum processor, which converts a String to a Enum.
|
ParseEnum(Class<T> enumClass,
boolean ignoreCase)
Constructs a new ParseEnum processor, which converts a String to a Enum, ignoring the case of the input
(or not) depending on the supplied flag.
|
ParseEnum(Class<T> enumClass,
boolean ignoreCase,
CellProcessor next)
Constructs a new ParseEnum processor, which converts a String to a Enum, ignoring the case of the input
(or not) depending on the supplied flag, then calls the next processor in the chain.
|
ParseEnum(Class<T> enumClass,
CellProcessor next)
Constructs a new ParseEnum processor, which converts a String to a Enum then calls the next processor in
the chain.
|
Modifier and Type | Method and Description |
---|---|
Object |
execute(Object value,
CsvContext context)
This method is invoked by the framework when the processor needs to process data or check constraints.
|
toString, validateInputNotNull
public ParseEnum(Class<T> enumClass)
T
- the Enum typeenumClass
- the enum class to convert toNullPointerException
- if enumClass is nullpublic ParseEnum(Class<T> enumClass, boolean ignoreCase)
T
- the Enum typeenumClass
- the enum class to convert toignoreCase
- whether to ignore the case of the inputNullPointerException
- if enumClass is nullpublic ParseEnum(Class<T> enumClass, CellProcessor next)
T
- the Enum typeenumClass
- the enum class to convert tonext
- the next processor in the chainNullPointerException
- if enumClass or next is nullpublic ParseEnum(Class<T> enumClass, boolean ignoreCase, CellProcessor next)
T
- the Enum typeenumClass
- the enum class to convert toignoreCase
- whether to ignore the case of the inputnext
- the next processor in the chainNullPointerException
- if enumClass or next is nullpublic Object execute(Object value, CsvContext context)
execute
in interface CellProcessor
value
- the value to be processedcontext
- the CSV contextSuperCsvCellProcessorException
- if value is null or can't be parsed as an EnumCopyright © 2007–2015 Super CSV. All rights reserved.