public abstract class ExportWriter extends Object
Modifier and Type | Field and Description |
---|---|
protected ExportFormat |
exportFormat
The format of the export.
|
static String |
lastFolderKey
Key to store the last export folder.
|
Constructor and Description |
---|
ExportWriter() |
Modifier and Type | Method and Description |
---|---|
void |
addSeparator()
Adds a separator.
|
abstract void |
addSeparator(WorkbookStyle textStyle)
Adds a separator.
|
abstract void |
close()
Writes the content in cache and closes the connection to the file.
|
abstract void |
decreseDepth()
Notifies the writer that data of a lower hierarchical depth will be
written, e.g.
|
ExportFormat |
getExportFormat()
Returns the export of the format.
|
static ExportWriter |
getExportWriter(ExportFormat exportFormat,
File destinationFile,
String separator,
int nSeparationLines)
Returns an export writer for the desired format.
|
abstract void |
increaseDepth()
Notifies the writer that data of a higher hierarchical depth will be
written, e.g.
|
abstract void |
newLine()
Adds a separator.
|
void |
startNewSection()
Starts a new section.
|
void |
startNewSection(String sectionTitle)
Starts a new section.
|
abstract void |
startNewSection(String sectionTitle,
WorkbookStyle textStyle)
Starts a new section.
|
void |
write(String text)
Writes text to the export.
|
abstract void |
write(String text,
WorkbookStyle textStyle)
Writes text to the export.
|
void |
writeHeaderText(String text)
Writes header text to the export.
|
abstract void |
writeHeaderText(String text,
WorkbookStyle textStyle)
Writes header text to the export.
|
void |
writeMainTitle(String text)
Writes the main title.
|
abstract void |
writeMainTitle(String text,
WorkbookStyle textStyle)
Writes the main title.
|
public static final String lastFolderKey
protected ExportFormat exportFormat
public ExportFormat getExportFormat()
public void write(String text) throws IOException
text
- the text to writeIOException
- if an IOException occurspublic abstract void write(String text, WorkbookStyle textStyle) throws IOException
text
- the text to writetextStyle
- the style to use, overwrites any previous/defaultIOException
- if an IOException occurspublic void writeMainTitle(String text) throws IOException
text
- the text to writeIOException
- if an IOException occurspublic abstract void writeMainTitle(String text, WorkbookStyle textStyle) throws IOException
text
- the text to writetextStyle
- the style to use, overwrites any previous/defaultIOException
- if an IOException occurspublic void startNewSection() throws IOException
IOException
- if an IOException occurspublic void startNewSection(String sectionTitle) throws IOException
sectionTitle
- the text to writeIOException
- if an IOException occurspublic abstract void startNewSection(String sectionTitle, WorkbookStyle textStyle) throws IOException
sectionTitle
- the text to writetextStyle
- the style to use, overwrites any previous/defaultIOException
- if an IOException occurspublic void writeHeaderText(String text) throws IOException
text
- the text to writeIOException
- if an IOException occurspublic abstract void writeHeaderText(String text, WorkbookStyle textStyle) throws IOException
text
- the text to writetextStyle
- the style to use, overwrites any previous/defaultIOException
- if an IOException occurspublic void addSeparator() throws IOException
IOException
- if an IOException occurspublic abstract void addSeparator(WorkbookStyle textStyle) throws IOException
textStyle
- the style to use, overwrites any previous/defaultIOException
- if an IOException occurspublic abstract void newLine() throws IOException
IOException
- if an IOException occurspublic abstract void close() throws IOException, FileNotFoundException
IOException
- if an IOException occursFileNotFoundException
- if a FileNotFoundException occurspublic abstract void increaseDepth()
public abstract void decreseDepth()
public static ExportWriter getExportWriter(ExportFormat exportFormat, File destinationFile, String separator, int nSeparationLines) throws IOException
exportFormat
- the export formatdestinationFile
- the file where to write the exportseparator
- the separator for a text exportnSeparationLines
- the number of separation lines between two
sections for a text exportIOException
- if an IOException occursCopyright © 2016. All rights reserved.