Package org.supercsv.cellprocessor.time
Class FmtZoneId
- java.lang.Object
-
- org.supercsv.cellprocessor.CellProcessorAdaptor
-
- org.supercsv.cellprocessor.time.FmtZoneId
-
- All Implemented Interfaces:
CellProcessor
public class FmtZoneId extends CellProcessorAdaptor
Converts a ZoneId to a String. The format is the ID of the timezone, e.g. ('Europe/Vienna'), as defined byZoneId.toString()
.- Since:
- 2.4.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Locale
locale
private java.time.format.TextStyle
textStyle
-
Fields inherited from class org.supercsv.cellprocessor.CellProcessorAdaptor
next
-
-
Constructor Summary
Constructors Constructor Description FmtZoneId()
Constructs a new FmtZoneId processor, which formats a ZoneId as a String.FmtZoneId(java.time.format.TextStyle textStyle, java.util.Locale locale)
Constructs a new FmtZoneId processor, which formats a ZoneId as String, then calls the next processor in the chain.FmtZoneId(java.time.format.TextStyle textStyle, java.util.Locale locale, CellProcessor next)
Constructs a new FmtZoneId processor, which formats a ZoneId as String, then calls the next processor in the chain.FmtZoneId(CellProcessor next)
Constructs a new FmtZoneId processor, which formats a ZoneId as a String, then calls the next processor in the chain.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
execute(java.lang.Object value, CsvContext context)
This method is invoked by the framework when the processor needs to process data or check constraints.-
Methods inherited from class org.supercsv.cellprocessor.CellProcessorAdaptor
toString, validateInputNotNull
-
-
-
-
Constructor Detail
-
FmtZoneId
public FmtZoneId()
Constructs a new FmtZoneId processor, which formats a ZoneId as a String.
-
FmtZoneId
public FmtZoneId(CellProcessor next)
Constructs a new FmtZoneId processor, which formats a ZoneId as a String, then calls the next processor in the chain.- Parameters:
next
- next processor in the chain- Throws:
java.lang.NullPointerException
- if next is null
-
FmtZoneId
public FmtZoneId(java.time.format.TextStyle textStyle, java.util.Locale locale)
Constructs a new FmtZoneId processor, which formats a ZoneId as String, then calls the next processor in the chain.- Parameters:
textStyle
- the TextStyle to use for formattinglocale
- the Locale to use for formatting- Throws:
java.lang.NullPointerException
- if either textStyle or locale is null
-
FmtZoneId
public FmtZoneId(java.time.format.TextStyle textStyle, java.util.Locale locale, CellProcessor next)
Constructs a new FmtZoneId processor, which formats a ZoneId as String, then calls the next processor in the chain.- Parameters:
textStyle
- the TextStyle to use for formattinglocale
- the Locale to use for formattingnext
- next processor in the chain- Throws:
java.lang.NullPointerException
- if any argument is null
-
-
Method Detail
-
execute
public java.lang.Object execute(java.lang.Object value, CsvContext context)
This method is invoked by the framework when the processor needs to process data or check constraints.- Parameters:
value
- the value to be processedcontext
- the CSV context- Returns:
- the result of cell processor execution
- Throws:
SuperCsvCellProcessorException
- if value is null or not a ZoneId
-
-