Class 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 by ZoneId.toString().
    Since:
    2.4.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Locale locale  
      private java.time.format.TextStyle textStyle  
    • 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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • textStyle

        private final java.time.format.TextStyle textStyle
      • locale

        private final java.util.Locale locale
    • 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 formatting
        locale - 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 formatting
        locale - the Locale to use for formatting
        next - 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 processed
        context - the CSV context
        Returns:
        the result of cell processor execution
        Throws:
        SuperCsvCellProcessorException - if value is null or not a ZoneId