Package org.opensextant.output
Class CSVFormatter
java.lang.Object
org.opensextant.output.AbstractFormatter
org.opensextant.output.CSVFormatter
- All Implemented Interfaces:
MatchInterpreter
,ResultsFormatter
-
Field Summary
Fields inherited from class org.opensextant.output.AbstractFormatter
debug, geoInterpreter, includeCoordinate, includeOffsets, log, outputExtension, outputParams, outputType, overwrite, TEXT_WIDTH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
Add a column of data to output; Field is validated ; value is not added if nullvoid
void
Pull in data from match into the output schema (map)protected void
Create a schema instance with the fields properly typed and orderedprotected boolean
void
close()
protected void
Create the output stream appropriate for the output type.protected final void
Default fields for generic CSV output.void
finish()
void
void
void
writeGeocodingResult
(ExtractionResult rowdata) Write your geocoding result directly to output Result should carry ExtractionResult.recordFile as a URI for original.Methods inherited from class org.opensextant.output.AbstractFormatter
checkOverwrite, createOutputFileName, deleteOutput, formatResults, getGeocoding, getJobName, getOutputFilepath, getOutputType, setMatchInterpeter, setOutputDir, setOutputFilename, setParameters
-
Field Details
-
fieldOrder
-
-
Constructor Details
-
CSVFormatter
public CSVFormatter()
-
-
Method Details
-
addField
- Parameters:
f
- field- Throws:
ConfigException
- if not consistent with schema
-
removeField
- Parameters:
f
- field- Throws:
ConfigException
- if not consistent with schema
-
start
- Specified by:
start
in interfaceResultsFormatter
- Specified by:
start
in classAbstractFormatter
- Throws:
ProcessingException
-
finish
public void finish()- Specified by:
finish
in interfaceResultsFormatter
- Specified by:
finish
in classAbstractFormatter
-
createOutputStreams
Description copied from class:AbstractFormatter
Create the output stream appropriate for the output type. IO is created using the filename represented by getOutputFilepath()- Specified by:
createOutputStreams
in classAbstractFormatter
- Throws:
Exception
-
close
- Specified by:
close
in classAbstractFormatter
- Throws:
IOException
-
writeGeocodingResult
Description copied from class:AbstractFormatter
Write your geocoding result directly to output Result should carry ExtractionResult.recordFile as a URI for original.- Specified by:
writeGeocodingResult
in classAbstractFormatter
- Parameters:
rowdata
- the data to write out
-
buildRow
Pull in data from match into the output schema (map)- Parameters:
row
- input row to writem
- given match has more metadata
-
buildSchema
Create a schema instance with the fields properly typed and ordered- Throws:
ConfigException
- schema configuration error
-
canAdd
-
addColumn
Add a column of data to output; Field is validated ; value is not added if null -
addColumn
-
defaultFields
protected final void defaultFields()Default fields for generic CSV output. If GIS output is desired, then use GeoCSV formatter.
-