Class PluginResultsToExcel

java.lang.Object
de.oktoflow.platform.cmdTools.excel.PluginResultsToExcel

public class PluginResultsToExcel extends Object
Results from MavenBuildExtractor to Excel converter.
Author:
Holger Eichelberger, SSE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static Map<String,org.apache.poi.ss.usermodel.Row>
     
    private static Set<String>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static void
    csvToExcel(File file, org.apache.poi.ss.usermodel.Sheet sheet, int startRow, int rowSpace, int count)
    Turns CSV to excel.
    private static File
    getFile(File folder, String prefix, int count)
    Gets the file to read.
    private static org.apache.poi.ss.usermodel.Row
    getRow(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr)
    Returns the row object for rowNr in sheet.
    private static String
    getRowKey(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr)
    Returns the row key for rowNr in sheet.
    private static boolean
    hasRow(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr)
    Returns whether there is a known row object for rowNr in sheet.
    static void
    main(String[] args)
    Performs the conversion.
    private static int
    maxFile(File folder, String prefix)
    Gets the maximum number of files existing.
    private static org.apache.poi.ss.usermodel.Row
    obtainRow(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr)
    Ensures and gets row rowNr in sheet.
    private static void
    setCellValue(org.apache.poi.ss.usermodel.Row row, int cNr, String tok)
    Sets the cell value, considering potential numbers, doubles, etc.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • rows

      private static Map<String,org.apache.poi.ss.usermodel.Row> rows
    • titles

      private static Set<String> titles
  • Constructor Details

    • PluginResultsToExcel

      public PluginResultsToExcel()
  • Method Details

    • maxFile

      private static int maxFile(File folder, String prefix)
      Gets the maximum number of files existing.
      Parameters:
      folder - the folder containing the file
      prefix - the file name prefix
      Returns:
      the maximum number of files
    • getFile

      private static File getFile(File folder, String prefix, int count)
      Gets the file to read.
      Parameters:
      folder - the folder containing the file
      prefix - the file name prefix
      count - the file number
      Returns:
      the file, may not exist
    • getRowKey

      private static String getRowKey(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr)
      Returns the row key for rowNr in sheet.
      Parameters:
      sheet - the sheet
      rowNr - the row number
      Returns:
      the row key
    • getRow

      private static org.apache.poi.ss.usermodel.Row getRow(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr)
      Returns the row object for rowNr in sheet. After creating a row object, somehow it's gone.
      Parameters:
      sheet - the sheet
      rowNr - the row number
      Returns:
      the row object, may be null
    • hasRow

      private static boolean hasRow(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr)
      Returns whether there is a known row object for rowNr in sheet.
      Parameters:
      sheet - the sheet
      rowNr - the row number
      Returns:
      true if there is a row object, false else
    • obtainRow

      private static org.apache.poi.ss.usermodel.Row obtainRow(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr)
      Ensures and gets row rowNr in sheet.
      Parameters:
      sheet - the sheet to modify
      rowNr - the row number
      Returns:
      the row
    • setCellValue

      private static void setCellValue(org.apache.poi.ss.usermodel.Row row, int cNr, String tok)
      Sets the cell value, considering potential numbers, doubles, etc.
      Parameters:
      row - the row to set the value
      cNr - the cell number
      tok - the token to be turned into number, double, string
    • csvToExcel

      private static void csvToExcel(File file, org.apache.poi.ss.usermodel.Sheet sheet, int startRow, int rowSpace, int count)
      Turns CSV to excel.
      Parameters:
      file - the file to read
      sheet - the sheet to insert the data into
      space - additional space
    • main

      public static void main(String[] args)
      Performs the conversion.
      Parameters:
      args - command line arguments, input folder and output excel file