Class PoijiOptions.PoijiOptionsBuilder

  • Enclosing class:
    PoijiOptions

    public static class PoijiOptions.PoijiOptionsBuilder
    extends Object
    • Method Detail

      • settings

        public static PoijiOptions.PoijiOptionsBuilder settings​(int skip)
        Skip a number of rows after the header row. The header row is not counted.
        Parameters:
        skip - ignored row number after the header row
        Returns:
        builder itself
      • dateFormatter

        public PoijiOptions.PoijiOptionsBuilder dateFormatter​(DateTimeFormatter dateFormatter)
        set a date formatter, default date time formatter is "dd/M/yyyy" for java.time.LocalDate
        Parameters:
        dateFormatter - date time formatter
        Returns:
        this
      • dateTimeFormatter

        public PoijiOptions.PoijiOptionsBuilder dateTimeFormatter​(DateTimeFormatter dateTimeFormatter)
        set a date time formatter, default date time formatter is "dd/M/yyyy HH:mm:ss" for java.time.LocalDateTime
        Parameters:
        dateTimeFormatter - date time formatter
        Returns:
        this
      • datePattern

        public PoijiOptions.PoijiOptionsBuilder datePattern​(String datePattern)
        set date pattern, default date format is "dd/M/yyyy" for java.util.Date
        Parameters:
        datePattern - date time formatter
        Returns:
        this
      • preferNullOverDefault

        public PoijiOptions.PoijiOptionsBuilder preferNullOverDefault​(boolean preferNullOverDefault)
        set whether or not to use null instead of default values for Integer, Double, Float, Long, String and java.util.Date types.
        Parameters:
        preferNullOverDefault - boolean
        Returns:
        this
      • sheetIndex

        public PoijiOptions.PoijiOptionsBuilder sheetIndex​(int sheetIndex)
        set sheet index, default is 0
        Parameters:
        sheetIndex - number
        Returns:
        this
      • skip

        public PoijiOptions.PoijiOptionsBuilder skip​(int skip)
        skip a number of rows after the header row. The header row is not counted.
        Parameters:
        skip - number
        Returns:
        this
      • limit

        public PoijiOptions.PoijiOptionsBuilder limit​(int limit)
        limit a number of rows after the header & skipped rows row. The header & skipped rows are not counted.
        Parameters:
        limit - number
        Returns:
        this
      • ignoreHiddenSheets

        public PoijiOptions.PoijiOptionsBuilder ignoreHiddenSheets​(boolean ignoreHiddenSheets)
        Ignore hidden sheets
        Parameters:
        ignoreHiddenSheets - whether or not to ignore any hidden sheets in the work book.
        Returns:
        this
      • trimCellValue

        public PoijiOptions.PoijiOptionsBuilder trimCellValue​(boolean trimCellValue)
        Trim cell value
        Parameters:
        trimCellValue - trim the cell value before processing work book.
        Returns:
        this
      • dateRegex

        public PoijiOptions.PoijiOptionsBuilder dateRegex​(String dateRegex)
        Date regex, if would like to specify a regex patter the date must be in, e.g.\\d{2}/\\d{1}/\\d{4}.
        Parameters:
        dateRegex - date regex pattern
        Returns:
        this
      • dateTimeRegex

        public PoijiOptions.PoijiOptionsBuilder dateTimeRegex​(String dateTimeRegex)
        DateTime regex, if would like to specify a regex patter the date time must be in, e.g.\\d{2}/\\d{1}/\\d{4} \\d{2}:\\d{2}:\\d{2}.
        Parameters:
        dateTimeRegex - date regex pattern
        Returns:
        this
      • dateLenient

        public PoijiOptions.PoijiOptionsBuilder dateLenient​(boolean dateLenient)
        If the simple date format is lenient, use to set how strict the date formatting must be, defaults to lenient false. It works only for java.util.Date.
        Parameters:
        dateLenient - true or false
        Returns:
        this
      • headerStart

        public PoijiOptions.PoijiOptionsBuilder headerStart​(int headerStart)
        This is to set the row which the unmarshall will use to start reading header titles, incase the header is not in row 0.
        Parameters:
        headerStart - an index number of the excel header to start reading header
        Returns:
        this
      • headerCount

        public PoijiOptions.PoijiOptionsBuilder headerCount​(int headerCount)
        This is to set the number of row contains headers
        Set 0 to indicate that no header in the excel file. Default - 1.
        Parameters:
        headerCount - an index number of the excel header to start reading header
        Returns:
        this
      • caseInsensitive

        public PoijiOptions.PoijiOptionsBuilder caseInsensitive​(boolean caseInsensitive)
        Permits case insensitive column names mapping for annotation ExcelCellName. Default - false.
        Parameters:
        caseInsensitive - true or false
      • ignoreWhitespaces

        public PoijiOptions.PoijiOptionsBuilder ignoreWhitespaces​(boolean ignoreWhitespaces)
        Ignore white space before and after column names for annotation ExcelCellName. Default - false.
        Parameters:
        ignoreWhitespaces - true or false
      • poijiLogCellFormat

        public PoijiOptions.PoijiOptionsBuilder poijiLogCellFormat​(PoijiLogCellFormat cellFormat)
        Add cell format option to see each internal cell's excel format for files ending with xlsx format. This option should be enabled for debugging purpose.
        Parameters:
        cellFormat - poiji cell format instance
      • namedHeaderMandatory

        public PoijiOptions.PoijiOptionsBuilder namedHeaderMandatory​(boolean namedHeaderMandatory)
        Set true if all headers named in ExcelCellName are mandatory, otherwise false
        Parameters:
        namedHeaderMandatory - fieldas are mandatory or not
      • disableXLSXNumberCellFormat

        public PoijiOptions.PoijiOptionsBuilder disableXLSXNumberCellFormat()
        Disable the cell format of all the number cells of an excel file ending with xlsx
        Returns:
        this
      • addListDelimiter

        public PoijiOptions.PoijiOptionsBuilder addListDelimiter​(String delimiter)
        Use different delimiter to split the list of items of a cell
        Parameters:
        delimiter - by default delimiter is ','
        Returns:
        this
      • withFormatting

        public PoijiOptions.PoijiOptionsBuilder withFormatting​(Formatting formatting)
        Use a custom excel header format implementation
        Parameters:
        formatting - custom header format implementation
        Returns:
        this