public class WorkbookGenerator extends Object implements TemplateGenerator
Constructor and Description |
---|
WorkbookGenerator(File output,
WorkbookFormat format)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
static org.apache.poi.ss.usermodel.Workbook |
createEmptyWorkbook(org.apache.poi.ss.SpreadsheetVersion version)
Creates a new empty workbook for the target version.
|
void |
generate(ModelDeclaration model)
Generates a workbook for the specified model.
|
static org.apache.poi.ss.SpreadsheetVersion |
getSpreadsheetVersion(String fileName)
Returns spreadsheet version for the target workbook.
|
static org.apache.poi.ss.SpreadsheetVersion |
getSpreadsheetVersion(org.apache.poi.ss.usermodel.Workbook workbook)
Returns spreadsheet version for the target workbook.
|
String |
getTitle()
Returns the title of this generator.
|
public WorkbookGenerator(File output, WorkbookFormat format)
output
- output directoryformat
- workbook format to be generatedIllegalArgumentException
- if some parameters were null
public void generate(ModelDeclaration model) throws IOException
generate
in interface TemplateGenerator
model
- the target modelIOException
- if failed to generate a workbookIllegalArgumentException
- if some parameters were null
public static org.apache.poi.ss.SpreadsheetVersion getSpreadsheetVersion(String fileName)
fileName
- the target workbook pathpublic static org.apache.poi.ss.SpreadsheetVersion getSpreadsheetVersion(org.apache.poi.ss.usermodel.Workbook workbook)
workbook
- the target workbookpublic static org.apache.poi.ss.usermodel.Workbook createEmptyWorkbook(org.apache.poi.ss.SpreadsheetVersion version) throws IOException
version
- the target versionIOException
- if failed to create the workbookpublic String getTitle()
TemplateGenerator
getTitle
in interface TemplateGenerator
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.