public abstract class CSVStrategy extends Object
Modifier and Type | Field and Description |
---|---|
protected CSVFileState |
csvFileState |
protected SimpleFeatureType |
featureType |
Constructor and Description |
---|
CSVStrategy(CSVFileState csvFileState) |
Modifier and Type | Method and Description |
---|---|
protected abstract SimpleFeatureType |
buildFeatureType() |
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
|
static SimpleFeatureTypeBuilder |
createBuilder(CSVFileState csvFileState,
String[] headers,
Map<String,Class<?>> typesFromData) |
abstract void |
createSchema(SimpleFeatureType featureType) |
abstract SimpleFeature |
decode(String recordId,
String[] csvRecord) |
abstract String[] |
encode(SimpleFeature feature) |
protected static Map<String,Class<?>> |
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.
|
char |
getEscapechar() |
SimpleFeatureType |
getFeatureType() |
String |
getLineSeparator() |
char |
getQuotechar() |
char |
getSeparator() |
boolean |
isQuoteAllFields() |
boolean |
isWritePrj() |
CSVIterator |
iterator() |
void |
setEscapechar(char escapechar) |
void |
setLineSeparator(String lineSeparator) |
void |
setQuoteAllFields(boolean quoteAllFields) |
void |
setQuotechar(char quotechar) |
void |
setSeparator(char separator) |
void |
setWritePrj(boolean booleanValue) |
protected final CSVFileState csvFileState
protected volatile SimpleFeatureType featureType
public CSVStrategy(CSVFileState csvFileState)
public CSVIterator iterator() throws IOException
IOException
protected abstract SimpleFeatureType buildFeatureType()
public abstract void createSchema(SimpleFeatureType featureType) throws IOException
IOException
public abstract SimpleFeature decode(String recordId, String[] csvRecord)
public abstract String[] encode(SimpleFeature feature)
public SimpleFeatureType getFeatureType()
public static SimpleFeatureTypeBuilder createBuilder(CSVFileState csvFileState)
public static SimpleFeatureTypeBuilder createBuilder(CSVFileState csvFileState, String[] headers, Map<String,Class<?>> typesFromData)
protected static Map<String,Class<?>> findMostSpecificTypesFromData(CSVReader csvReader, String[] headers) throws IOException
IOException
public char getSeparator()
public void setSeparator(char separator)
separator
- the separator to setpublic char getQuotechar()
public void setQuotechar(char quotechar)
quotechar
- the quotechar to setpublic char getEscapechar()
public void setEscapechar(char escapechar)
escapechar
- the escapechar to setpublic String getLineSeparator()
public void setLineSeparator(String lineSeparator)
lineSeparator
- the lineSeparator to setpublic boolean isQuoteAllFields()
public void setQuoteAllFields(boolean quoteAllFields)
quoteAllFields
- the quoteAllFields to setpublic void setWritePrj(boolean booleanValue)
public boolean isWritePrj()
Copyright © 1996–2023 Geotools. All rights reserved.