Package org.geotools.data.csv.parse
Class CSVStrategy
Object
CSVStrategy
- Direct Known Subclasses:
CSVAttributesOnlyStrategy,CSVLatLonStrategy,CSVSpecifiedWKTStrategy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract SimpleFeatureTypestatic SimpleFeatureTypeBuildercreateBuilder(CSVFileState csvFileState) Originally in a strategy support class - giving a chance to override them to improve efficiency and utilise the different strategiesstatic SimpleFeatureTypeBuildercreateBuilder(CSVFileState csvFileState, String[] headers, Map<String, Class<?>> typesFromData) abstract voidcreateSchema(SimpleFeatureType featureType) abstract SimpleFeatureabstract String[]encode(SimpleFeature feature) findMostSpecificTypesFromData(CSVReader csvReader, String[] headers) 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.charcharcharbooleanbooleaniterator()voidsetEscapechar(char escapechar) voidsetLineSeparator(String lineSeparator) voidsetQuoteAllFields(boolean quoteAllFields) voidsetQuotechar(char quotechar) voidsetSeparator(char separator) voidsetWritePrj(boolean booleanValue)
-
Field Details
-
csvFileState
-
featureType
-
-
Constructor Details
-
CSVStrategy
-
-
Method Details
-
iterator
- Throws:
IOException
-
buildFeatureType
-
createSchema
- Throws:
IOException
-
decode
-
encode
-
getFeatureType
-
createBuilder
Originally in a strategy support class - giving a chance to override them to improve efficiency and utilise the different strategies -
createBuilder
public static SimpleFeatureTypeBuilder createBuilder(CSVFileState csvFileState, String[] headers, Map<String, Class<?>> typesFromData) -
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
- Returns:
- the lineSeparator
-
setLineSeparator
- 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()
-