T
- the Joda type that the processor formatspublic abstract class AbstractJodaFormattingProcessor<T> extends CellProcessorAdaptor
next
Constructor and Description |
---|
AbstractJodaFormattingProcessor(Class<T> jodaClass)
Constructs a new AbstractJodaFormattingProcessor processor,
which formats the Joda type as a String.
|
AbstractJodaFormattingProcessor(Class<T> jodaClass,
CellProcessor next)
Constructs a new AbstractJodaFormattingProcessor processor,
which formats the Joda type as a String, then calls the next processor in
the chain.
|
AbstractJodaFormattingProcessor(Class<T> jodaClass,
DateTimeFormatter formatter)
Constructs a new AbstractJodaFormattingProcessor processor,
which formats the Joda type as a String using the supplied formatter.
|
AbstractJodaFormattingProcessor(Class<T> jodaClass,
DateTimeFormatter formatter,
CellProcessor next)
Constructs a new AbstractJodaFormattingProcessor processor,
which formats the Joda type as a String using the supplied formatter,
then calls the next processor in the chain.
|
AbstractJodaFormattingProcessor(Class<T> jodaClass,
String pattern)
Constructs a new AbstractJodaFormattingProcessor processor,
which formats the Joda type as a String using the supplied pattern and
the default locale.
|
AbstractJodaFormattingProcessor(Class<T> jodaClass,
String pattern,
CellProcessor next)
Constructs a new AbstractJodaFormattingProcessor processor,
which formats the Joda type as a String using the supplied pattern and
the default locale, then calls the next processor in the chain.
|
AbstractJodaFormattingProcessor(Class<T> jodaClass,
String pattern,
Locale locale)
Constructs a new AbstractJodaFormattingProcessor processor,
which formats the Joda type as a String using the supplied pattern and
the locale.
|
AbstractJodaFormattingProcessor(Class<T> jodaClass,
String pattern,
Locale locale,
CellProcessor next)
Constructs a new AbstractJodaFormattingProcessor processor,
which formats the Joda type as a String using the supplied pattern and
the locale, 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.
|
protected abstract String |
format(T jodaType)
Formats the Joda type as a String using the default pattern and locale.
|
protected abstract String |
format(T jodaType,
DateTimeFormatter formatter)
Formats the Joda type as a String using a DateTimeFormatter.
|
protected abstract String |
format(T jodaType,
String pattern,
Locale locale)
Formats the Joda type as a String using the supplied pattern and
(optional) locale.
|
toString, validateInputNotNull
public AbstractJodaFormattingProcessor(Class<T> jodaClass)
jodaClass
- the Joda class that the processor formatsNullPointerException
- if jodaClass is nullpublic AbstractJodaFormattingProcessor(Class<T> jodaClass, CellProcessor next)
jodaClass
- the Joda class that the processor formatsnext
- next processor in the chainNullPointerException
- if jodaClass or next is nullpublic AbstractJodaFormattingProcessor(Class<T> jodaClass, DateTimeFormatter formatter)
jodaClass
- the Joda class that the processor formatsformatter
- the formatter to useNullPointerException
- if jodaClass or formatter is nullpublic AbstractJodaFormattingProcessor(Class<T> jodaClass, DateTimeFormatter formatter, CellProcessor next)
jodaClass
- the Joda class that the processor formatsformatter
- the formatter to usenext
- the next processor in the chainNullPointerException
- if jodaClass, formatter or next is nullpublic AbstractJodaFormattingProcessor(Class<T> jodaClass, String pattern)
jodaClass
- the Joda class that the processor formatspattern
- the pattern to useNullPointerException
- if jodaClass or pattern is nullpublic AbstractJodaFormattingProcessor(Class<T> jodaClass, String pattern, CellProcessor next)
jodaClass
- the Joda class that the processor formatspattern
- the pattern to usenext
- the next processor in the chainNullPointerException
- if jodaClass, pattern or next is nullpublic AbstractJodaFormattingProcessor(Class<T> jodaClass, String pattern, Locale locale)
jodaClass
- the Joda class that the processor formatspattern
- the pattern to uselocale
- the locale to use (default used if null)NullPointerException
- if jodaClass or pattern is nullpublic AbstractJodaFormattingProcessor(Class<T> jodaClass, String pattern, Locale locale, CellProcessor next)
jodaClass
- the Joda class that the processor formatspattern
- the pattern to uselocale
- the locale to use (default used if null)next
- the next processor in the chainNullPointerException
- if jodaClass, pattern or next is nullpublic Object execute(Object value, CsvContext context)
value
- the value to be processedcontext
- the CSV contextSuperCsvCellProcessorException
- if value is null, not the correct type, or can't be formattedprotected abstract String format(T jodaType, DateTimeFormatter formatter)
jodaType
- the Joda type to formatformatter
- the formatter to useIllegalArgumentException
- if the Joda type couldn't be formattedprotected abstract String format(T jodaType, String pattern, Locale locale)
jodaType
- the Joda type to formatpattern
- the pattern to uselocale
- the (optional) localeIllegalArgumentException
- if the Joda type couldn't be formattedprotected abstract String format(T jodaType)
jodaType
- the Joda type to formatIllegalArgumentException
- if the Joda type couldn't be formattedCopyright © 2007–2015 Super CSV. All rights reserved.