Class ExcelSource.Options

  • Enclosing class:
    ExcelSource

    public static class ExcelSource.Options
    extends java.lang.Object
    The options for this source
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private ExcelSource.Coordinate bottomRight
      The optional top right coordinate (zero-based) that defines bottom right corner cell for table to parse
      private boolean header
      True indicates that the first row serves as a header for frame
      private com.d3x.morpheus.util.Resource resource
      The resource to load from
      private java.util.function.Predicate<org.apache.poi.ss.usermodel.Row> rowPredicate
      The optional row predicate to includes rows
      private java.lang.String sheetName
      The optional worksheet name, otherwise the first sheet is extracted
      private ExcelSource.Coordinate topLeft
      The optional top right coordinate (zero-based) that defines top left corner cell for table to parse
    • Constructor Summary

      Constructors 
      Constructor Description
      Options()  
    • Field Detail

      • resource

        private com.d3x.morpheus.util.Resource resource
        The resource to load from
      • header

        private boolean header
        True indicates that the first row serves as a header for frame
      • sheetName

        private java.lang.String sheetName
        The optional worksheet name, otherwise the first sheet is extracted
      • topLeft

        private ExcelSource.Coordinate topLeft
        The optional top right coordinate (zero-based) that defines top left corner cell for table to parse
      • bottomRight

        private ExcelSource.Coordinate bottomRight
        The optional top right coordinate (zero-based) that defines bottom right corner cell for table to parse
      • rowPredicate

        private java.util.function.Predicate<org.apache.poi.ss.usermodel.Row> rowPredicate
        The optional row predicate to includes rows
    • Constructor Detail

      • Options

        public Options()
    • Method Detail

      • validate

        public void validate()
        Validates that these options are complete
      • getSheet

        private org.apache.poi.ss.usermodel.Sheet getSheet​(org.apache.poi.ss.usermodel.Workbook workbook)
        Returns the worksheet to parse
        Parameters:
        workbook - the workbook reference
        Returns:
        the worksheet
      • setFile

        public void setFile​(java.io.File file)
        Sets the file to load from
        Parameters:
        file - the file reference
      • setURL

        public void setURL​(java.net.URL url)
        Sets the URL to load from
        Parameters:
        url - the url reference
      • setInputStream

        public void setInputStream​(java.io.InputStream stream)
        Sets the input stream to load from
        Parameters:
        stream - the input stream
      • setResource

        public void setResource​(java.lang.String resource)
        Sets the resource string to load from
        Parameters:
        resource - the resource string
      • getDataStartRowIndex

        private int getDataStartRowIndex()
        Returns the row index of the first row containing data
        Returns:
        the row index of first row with data
      • getDataEndRowIndex

        private int getDataEndRowIndex​(org.apache.poi.ss.usermodel.Sheet sheet)
        Returns the row index of the last row containing data
        Parameters:
        sheet - the sheet reference
        Returns:
        the row index of last row with data
      • getResource

        public com.d3x.morpheus.util.Resource getResource()
      • isHeader

        public boolean isHeader()
      • setHeader

        public void setHeader​(boolean header)
      • getSheetName

        public java.lang.String getSheetName()
      • setSheetName

        public void setSheetName​(java.lang.String sheetName)
      • getRowPredicate

        public java.util.function.Predicate<org.apache.poi.ss.usermodel.Row> getRowPredicate()
      • setRowPredicate

        public void setRowPredicate​(java.util.function.Predicate<org.apache.poi.ss.usermodel.Row> rowPredicate)