Package ca.phon.query.report.csv
Class CSVReportBuilder
java.lang.Object
ca.phon.query.report.ReportBuilder
ca.phon.query.report.csv.CSVReportBuilder
CSV report builder implementation.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
CSV line termstatic final String
CSV quote charstatic final String
CSV separator charstatic final String
File Encodingstatic final String
Property for indenting content at sections (default:false)static final String
Property for printing section names (default:true)Fields inherited from class ca.phon.query.report.ReportBuilder
CANCEL_BUILD, TEMP_PROJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildReport
(ReportDesign design, Project project, Query query, ResultSet[] resultSets, OutputStream stream) TODO Datasources should be given as indirect dependencies since we can re-use them for other report builders.Get the display name for the builder.Get the default extension for the reportGet the mimetype created by this report builder.Class<?>
getPropertyClass
(String propName) Returns the value type for the given property name.getPropertyDefault
(String propName) Get the default value for the given property name.getPropertyMessage
(String propName) Returns the UI message associated with a property name returned by getPropertyNames()String[]
Returns a list of property names used for configuring the builder.boolean
Should we indent contentboolean
Methods inherited from class ca.phon.query.report.ReportBuilder
buildReport, getProperty, isBuildCanceled, putProperty
-
Field Details
-
INDENT_CONTENT
Property for indenting content at sections (default:false)- See Also:
-
PRINT_SECTION_NAMES
Property for printing section names (default:true)- See Also:
-
CSV_SEP_CHAR
CSV separator char- See Also:
-
CSV_QUOTE_CHAR
CSV quote char- See Also:
-
CSV_LINE_TERM
CSV line term- See Also:
-
FILE_ENCODING
File Encoding- See Also:
-
-
Constructor Details
-
CSVReportBuilder
public CSVReportBuilder()
-
-
Method Details
-
getPropertyNames
Description copied from class:ReportBuilder
Returns a list of property names used for configuring the builder. The properties are presented as options in the report wizard.- Overrides:
getPropertyNames
in classReportBuilder
- Returns:
- propNames
-
getPropertyClass
Description copied from class:ReportBuilder
Returns the value type for the given property name. NOTE: Only Boolean and String values are supported by the report wizard.- Overrides:
getPropertyClass
in classReportBuilder
- Returns:
- the class of the property value
-
getPropertyMessage
Description copied from class:ReportBuilder
Returns the UI message associated with a property name returned by getPropertyNames()- Overrides:
getPropertyMessage
in classReportBuilder
- Returns:
- the UI message
-
getPropertyDefault
Description copied from class:ReportBuilder
Get the default value for the given property name.- Overrides:
getPropertyDefault
in classReportBuilder
- Returns:
- the default property value. This MUST be of the type returned by getPropertyClass(propName)
-
buildReport
public void buildReport(ReportDesign design, Project project, Query query, ResultSet[] resultSets, OutputStream stream) throws ReportBuilderException TODO Datasources should be given as indirect dependencies since we can re-use them for other report builders. Perhaps a global object can be created to keep track of created datasources so they can still be lazilly generated.- Specified by:
buildReport
in classReportBuilder
- Parameters:
design
- the report designproject
- the phon projectresultSets
- the selected searches to report onstream
- the output file- Throws:
ReportBuilderException
-
isIndentContent
public boolean isIndentContent()Should we indent content -
isPrintSectionNames
public boolean isPrintSectionNames() -
getMimetype
Description copied from class:ReportBuilder
Get the mimetype created by this report builder.- Specified by:
getMimetype
in classReportBuilder
- Returns:
- report mimetype
-
getFileExtension
Description copied from class:ReportBuilder
Get the default extension for the report- Specified by:
getFileExtension
in classReportBuilder
- Returns:
- default extension
-
getDisplayName
Description copied from class:ReportBuilder
Get the display name for the builder.- Specified by:
getDisplayName
in classReportBuilder
- Returns:
- display name
-