com.agimatec.utility.fileimport.spreadsheet
Class ExcelGenerator
java.lang.Object
com.agimatec.utility.fileimport.spreadsheet.ExcelGenerator
public abstract class ExcelGenerator
- extends Object
Description: convenience class to write data as excel worksheet. subclass to customize.
new MyExcelGenerator(inputData).generateWorkbook().write(outputStream);
User: roman.stumm
Date: 24.05.13
Time: 11:17
viaboxx GmbH, 2013
- Since:
- 2.5.13
|
Nested Class Summary |
class |
ExcelGenerator.Styles
style factory class. replace by own class or add additional styles by overriding method 'initStyles()' |
|
Method Summary |
protected org.apache.poi.hssf.usermodel.HSSFCell |
createCell(org.apache.poi.hssf.usermodel.HSSFRow row,
int column,
Object value)
|
protected org.apache.poi.hssf.usermodel.HSSFCell |
createCell(org.apache.poi.hssf.usermodel.HSSFRow row,
int column,
Object value,
org.apache.poi.ss.usermodel.CellStyle style)
|
protected void |
createHeaders(org.apache.poi.hssf.usermodel.HSSFRow row,
int column,
org.apache.poi.ss.usermodel.CellStyle style,
String... headers)
|
protected abstract void |
generateSheets()
override in subclasses to generate the sheets into 'wb' |
org.apache.poi.hssf.usermodel.HSSFWorkbook |
generateWorkbook()
|
ExcelGenerator.Styles |
getStyles()
|
org.apache.poi.hssf.usermodel.HSSFWorkbook |
getWb()
|
protected void |
initStyles()
method can be overwritten to create additional styles |
protected void |
initWorkbook()
|
protected org.apache.poi.ss.usermodel.CellStyle |
style(String name)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
wb
protected org.apache.poi.hssf.usermodel.HSSFWorkbook wb
styles
protected ExcelGenerator.Styles styles
STYLE_boldTitle
protected static final String STYLE_boldTitle
- See Also:
- Constant Field Values
STYLE_boldHeader
protected static final String STYLE_boldHeader
- See Also:
- Constant Field Values
STYLE_redCell
protected static final String STYLE_redCell
- See Also:
- Constant Field Values
STYLE_blueCell
protected static final String STYLE_blueCell
- See Also:
- Constant Field Values
ExcelGenerator
public ExcelGenerator()
generateWorkbook
public org.apache.poi.hssf.usermodel.HSSFWorkbook generateWorkbook()
generateSheets
protected abstract void generateSheets()
- override in subclasses to generate the sheets into 'wb'
initWorkbook
protected void initWorkbook()
initStyles
protected void initStyles()
- method can be overwritten to create additional styles
getWb
public org.apache.poi.hssf.usermodel.HSSFWorkbook getWb()
getStyles
public ExcelGenerator.Styles getStyles()
style
protected org.apache.poi.ss.usermodel.CellStyle style(String name)
createCell
protected org.apache.poi.hssf.usermodel.HSSFCell createCell(org.apache.poi.hssf.usermodel.HSSFRow row,
int column,
Object value,
org.apache.poi.ss.usermodel.CellStyle style)
createCell
protected org.apache.poi.hssf.usermodel.HSSFCell createCell(org.apache.poi.hssf.usermodel.HSSFRow row,
int column,
Object value)
createHeaders
protected void createHeaders(org.apache.poi.hssf.usermodel.HSSFRow row,
int column,
org.apache.poi.ss.usermodel.CellStyle style,
String... headers)
Copyright © 2008-2015. All Rights Reserved.