Interface ExportTemplate
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
PlainTextTemplate
,XlsxTemplate
,XMLTemplate
A helper interface for the
SimpleExport
class to make it
easier to output exported data in different formats.- Version:
- 2.2
- Author:
- nicklas
- Last modified
- $Date: 2019-03-12 10:56:19 +0100 (tis, 12 mars 2019) $
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Start writing the document.void
beginItem
(int id) Start writing a new item.void
endDocument
(ProgressReporter progress) End writing the document.void
endItem()
End writing an itemGet the default file extension to give to files generated by this template.Get the MIME type to assign to files generated by this template.void
writeAnnotations
(ExportedProperty ep, List<?> values, String unit) Write annotation values.void
writeCollection
(ExportedProperty ep, Collection<?> values) Write the values in a collectionvoid
Write headers.void
writeProperty
(ExportedProperty ep, Object data) Write the specified property values.
-
Method Details
-
getMimeType
String getMimeType()Get the MIME type to assign to files generated by this template.- Returns:
- a String
-
getDefaultFileExtension
String getDefaultFileExtension()Get the default file extension to give to files generated by this template.- Returns:
- The file extension (without .)
- Since:
- 3.0
-
beginDocument
Start writing the document.- Throws:
IOException
- If there is an error
-
writeHeaders
Write headers.- Throws:
IOException
- If there is an error
-
beginItem
Start writing a new item.- Parameters:
id
- Id of the new item.- Throws:
IOException
- If there is an error
-
writeAnnotations
Write annotation values.- Parameters:
ep
- Exported property the annotations belongs tovalues
- Annotation values to be written.unit
- The unit of the annotation values, or null to not display write a unit- Throws:
IOException
- If there is an error
-
writeProperty
Write the specified property values.- Parameters:
ep
- The exported property thedata
belongs to.data
- Data to be written.- Throws:
IOException
- If there is an error
-
writeCollection
Write the values in a collection- Parameters:
ep
- Exported property the values belong tovalues
- The values to be written- Throws:
IOException
- Since:
- 2.12
-
endItem
End writing an item- Throws:
IOException
- If there is an error
-
endDocument
End writing the document.- Throws:
IOException
- If there is an error
-