@Test public void testDataFewerRowsDifferentType() throws IOException { String input = buildInputString("a,b", "foo"); CSVFileState fileState = new CSVFileState(input, "typename", WGS84); CSVLatLonStrategy strategy = new CSVLatLonStrategy(fileState); SimpleFeatureType featureType = strategy.getFeatureType(); assertEquals("Invalid attribute count", 2, featureType.getAttributeCount()); assertEquals("Invalid attribute type", "java.lang.String", getBindingName(featureType, "a")); assertEquals("Invalid attribute type", "java.lang.Integer", getBindingName(featureType, "b")); }
@Override public SimpleFeatureType getFeatureType() { if (featureType == null) { synchronized (this) { if (featureType == null) { featureType = buildFeatureType(); } } } return featureType; }
CSVLatLonStrategy implements CSVStrategy { @Override public SimpleFeatureType getFeatureType() { if (featureType == null) { synchronized (this) { if (featureType == null) { featureType = buildFeatureType(); } } } return featureType; } }
CSVLatLonStrategy implements CSVStrategy { @Override public SimpleFeatureType getFeatureType() { if (featureType == null) { synchronized (this) { if (featureType == null) { featureType = buildFeatureType(); } } } return featureType; } CSVLatLonStrategy(CSVFileState csvFileState); }
CSVLatLonStrategy implements CSVStrategy { @Override public SimpleFeatureType getFeatureType() { if (featureType == null) { synchronized (this) { if (featureType == null) { featureType = buildFeatureType(); } } } return featureType; } CSVLatLonStrategy(CSVFileState csvFileState); @Override SimpleFeatureType getFeatureType(); @Override CSVIterator iterator(); @Override SimpleFeature createFeature(String recordId, String[] csvRecord); }
CSVLatLonStrategy implements CSVStrategy { @Override public SimpleFeatureType getFeatureType() { if (featureType == null) { synchronized (this) { if (featureType == null) { featureType = buildFeatureType(); } } } return featureType; } CSVLatLonStrategy(CSVFileState csvFileState); @Override SimpleFeatureType getFeatureType(); @Override CSVIterator iterator(); @Override SimpleFeature createFeature(String recordId, String[] csvRecord);  }