Class CSVStrategy

    • Constructor Detail

      • CSVStrategy

        public CSVStrategy​(CSVFileState csvFileState)
    • Method Detail

      • iterator

        public CSVIterator iterator()
                             throws IOException
        Throws:
        IOException
      • createSchema

        public abstract void createSchema​(SimpleFeatureType featureType)
                                   throws IOException
        Throws:
        IOException
      • decode

        public abstract SimpleFeature decode​(String recordId,
                                             String[] csvRecord)
      • encode

        public abstract String[] encode​(SimpleFeature feature)
      • createBuilder

        public static SimpleFeatureTypeBuilder createBuilder​(CSVFileState csvFileState)
        Originally in a strategy support class - giving a chance to override them to improve efficiency and utilise the different strategies
      • findMostSpecificTypesFromData

        protected static Map<String,​Class<?>> findMostSpecificTypesFromData​(CSVReader csvReader,
                                                                                  String[] headers)
                                                                           throws IOException
        Performs a full file scan attempting to guess the type of each column Specific strategy implementations will expand this functionality by overriding the buildFeatureType() method.
        Throws:
        IOException
      • getSeparator

        public char getSeparator()
        Returns:
        the separator
      • setSeparator

        public void setSeparator​(char separator)
        Parameters:
        separator - the separator to set
      • getQuotechar

        public char getQuotechar()
        Returns:
        the quotechar
      • setQuotechar

        public void setQuotechar​(char quotechar)
        Parameters:
        quotechar - the quotechar to set
      • getEscapechar

        public char getEscapechar()
        Returns:
        the escapechar
      • setEscapechar

        public void setEscapechar​(char escapechar)
        Parameters:
        escapechar - the escapechar to set
      • getLineSeparator

        public String getLineSeparator()
        Returns:
        the lineSeparator
      • setLineSeparator

        public void setLineSeparator​(String lineSeparator)
        Parameters:
        lineSeparator - the lineSeparator to set
      • isQuoteAllFields

        public boolean isQuoteAllFields()
        Returns:
        the quoteAllFields
      • setQuoteAllFields

        public void setQuoteAllFields​(boolean quoteAllFields)
        Parameters:
        quoteAllFields - the quoteAllFields to set
      • setWritePrj

        public void setWritePrj​(boolean booleanValue)
      • isWritePrj

        public boolean isWritePrj()