Package org.opensextant.output
Class CSVFormatter
java.lang.Object
org.opensextant.output.AbstractFormatter
org.opensextant.output.CSVFormatter
- All Implemented Interfaces:
MatchInterpreter,ResultsFormatter
-
Field Summary
FieldsFields inherited from class org.opensextant.output.AbstractFormatter
debug, geoInterpreter, includeCoordinate, includeOffsets, log, outputExtension, outputParams, outputType, overwrite, TEXT_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidAdd a column of data to output; Field is validated ; value is not added if nullvoidvoidPull in data from match into the output schema (map)protected voidCreate a schema instance with the fields properly typed and orderedprotected booleanvoidclose()protected voidCreate the output stream appropriate for the output type.protected final voidDefault fields for generic CSV output.voidfinish()voidvoidvoidwriteGeocodingResult(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:
startin interfaceResultsFormatter- Specified by:
startin classAbstractFormatter- Throws:
ProcessingException
-
finish
public void finish()- Specified by:
finishin interfaceResultsFormatter- Specified by:
finishin classAbstractFormatter
-
createOutputStreams
Description copied from class:AbstractFormatterCreate the output stream appropriate for the output type. IO is created using the filename represented by getOutputFilepath()- Specified by:
createOutputStreamsin classAbstractFormatter- Throws:
Exception
-
close
- Specified by:
closein classAbstractFormatter- Throws:
IOException
-
writeGeocodingResult
Description copied from class:AbstractFormatterWrite your geocoding result directly to output Result should carry ExtractionResult.recordFile as a URI for original.- Specified by:
writeGeocodingResultin 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.
-