Class CSVFormatter

    • Field Detail

      • fieldOrder

        protected java.util.List<java.lang.String> fieldOrder
    • Constructor Detail

      • CSVFormatter

        public CSVFormatter()
    • Method Detail

      • addField

        public void addField​(java.lang.String f)
                      throws ConfigException
        Parameters:
        f - field
        Throws:
        ConfigException - if not consistent with schema
      • removeField

        public void removeField​(java.lang.String f)
                         throws ConfigException
        Parameters:
        f - field
        Throws:
        ConfigException - if not consistent with schema
      • createOutputStreams

        protected void createOutputStreams()
                                    throws java.lang.Exception
        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 class AbstractFormatter
        Throws:
        java.lang.Exception
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in class AbstractFormatter
        Throws:
        java.io.IOException
      • writeGeocodingResult

        public void writeGeocodingResult​(ExtractionResult rowdata)
        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 class AbstractFormatter
        Parameters:
        rowdata - the data to write out
      • buildRow

        public void buildRow​(java.util.Map<java.lang.String,​java.lang.String> row,
                             TextMatch m)
        Pull in data from match into the output schema (map)
        Parameters:
        row - input row to write
        m - given match has more metadata
      • buildSchema

        protected void buildSchema()
                            throws ConfigException
        Create a schema instance with the fields properly typed and ordered
        Throws:
        ConfigException - schema configuration error
      • canAdd

        protected boolean canAdd​(java.lang.String f)
      • addColumn

        protected void addColumn​(java.util.Map<java.lang.String,​java.lang.String> row,
                                 java.lang.String f,
                                 java.lang.String d)
        Add a column of data to output; Field is validated ; value is not added if null
      • addColumn

        protected void addColumn​(java.util.Map<java.lang.String,​java.lang.String> row,
                                 java.lang.String f,
                                 int d)
      • defaultFields

        protected final void defaultFields()
        Default fields for generic CSV output. If GIS output is desired, then use GeoCSV formatter.