2.17.2: 2011-06-17

net.sf.basedb.clients.web.plugins
Interface ExportTemplate

All Known Implementing Classes:
PlainTextTemplate, XMLTemplate

public interface ExportTemplate

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: 2009-04-21 11:29:09 +0200 (Tue, 21 Apr 2009) $

Method Summary
 void beginDocument()
          Start writing the document.
 void beginItem(int id)
          Start writing a new item.
 void endDocument()
          End writing the document.
 void endItem()
          End writing an item
 String getMimeType()
          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 collection
 void writeHeaders()
          Write headers.
 void writeProperty(ExportedProperty ep, Object data)
          Write the specified property values.
 

Method Detail

getMimeType

String getMimeType()
Get the MIME type to assign to files generated by this template.

Returns:
a String

beginDocument

void beginDocument()
                   throws IOException
Start writing the document.

Throws:
IOException - If there is an error

writeHeaders

void writeHeaders()
                  throws IOException
Write headers.

Throws:
IOException - If there is an error

beginItem

void beginItem(int id)
               throws IOException
Start writing a new item.

Parameters:
id - Id of the new item.
Throws:
IOException - If there is an error

writeAnnotations

void writeAnnotations(ExportedProperty ep,
                      List<?> values,
                      String unit)
                      throws IOException
Write annotation values.

Parameters:
ep - Exported property the annotations belongs to
values - 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

void writeProperty(ExportedProperty ep,
                   Object data)
                   throws IOException
Write the specified property values.

Parameters:
ep - The exported property the data belongs to.
data - Data to be written.
Throws:
IOException - If there is an error

writeCollection

void writeCollection(ExportedProperty ep,
                     Collection<?> values)
                     throws IOException
Write the values in a collection

Parameters:
ep - Exported property the values belong to
values - The values to be written
Throws:
IOException
Since:
2.12

endItem

void endItem()
             throws IOException
End writing an item

Throws:
IOException - If there is an error

endDocument

void endDocument()
                 throws IOException
End writing the document.

Throws:
IOException - If there is an error

2.17.2: 2011-06-17