Class PluginResultsToExcel
java.lang.Object
de.oktoflow.platform.cmdTools.excel.PluginResultsToExcel
Results from
MavenBuildExtractor to Excel converter.- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidcsvToExcel(File file, org.apache.poi.ss.usermodel.Sheet sheet, int startRow, int rowSpace, int count) Turns CSV to excel.private static FileGets the file to read.private static org.apache.poi.ss.usermodel.RowgetRow(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr) Returns the row object forrowNrinsheet.private static StringgetRowKey(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr) Returns the row key forrowNrinsheet.private static booleanhasRow(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr) Returns whether there is a known row object forrowNrinsheet.static voidPerforms the conversion.private static intGets the maximum number of files existing.private static org.apache.poi.ss.usermodel.RowobtainRow(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr) Ensures and gets rowrowNrinsheet.private static voidsetCellValue(org.apache.poi.ss.usermodel.Row row, int cNr, String tok) Sets the cell value, considering potential numbers, doubles, etc.
-
Field Details
-
rows
-
titles
-
-
Constructor Details
-
PluginResultsToExcel
public PluginResultsToExcel()
-
-
Method Details
-
maxFile
Gets the maximum number of files existing.- Parameters:
folder- the folder containing the fileprefix- the file name prefix- Returns:
- the maximum number of files
-
getFile
Gets the file to read.- Parameters:
folder- the folder containing the fileprefix- the file name prefixcount- the file number- Returns:
- the file, may not exist
-
getRowKey
Returns the row key forrowNrinsheet.- Parameters:
sheet- the sheetrowNr- 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 forrowNrinsheet. After creating a row object, somehow it's gone.- Parameters:
sheet- the sheetrowNr- 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 forrowNrinsheet.- Parameters:
sheet- the sheetrowNr- the row number- Returns:
trueif there is a row object,falseelse
-
obtainRow
private static org.apache.poi.ss.usermodel.Row obtainRow(org.apache.poi.ss.usermodel.Sheet sheet, int rowNr) Ensures and gets rowrowNrinsheet.- Parameters:
sheet- the sheet to modifyrowNr- the row number- Returns:
- the row
-
setCellValue
Sets the cell value, considering potential numbers, doubles, etc.- Parameters:
row- the row to set the valuecNr- the cell numbertok- 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 readsheet- the sheet to insert the data intospace- additional space
-
main
Performs the conversion.- Parameters:
args- command line arguments, input folder and output excel file
-