@Test public void testWrongUsages() { try { expectException(""); } catch (IOException expected) { } try { expectException("org.esa.beam.FT\ta:\n"); } catch (IOException expected) { } try { expectException("org.esa.beam.FT\t:Integer\n"); } catch (IOException expected) { } try { expectException("org.esa.beam.FT\ta:Integer\tlat\tlon\n" + "ID1\t1234\tABC\n"); } catch (IOException expected) { } try { VectorDataNodeReader.read("blah", new StringReader("org.esa.beam.FT\ta:Integer\tno_lat\tlon\n" + "ID1\t1234\tABC\n"), new Product("name", "type", 360, 90), crsProvider, placemarkDescriptorProvider, DefaultGeographicCRS.WGS84, VectorDataNodeIO.DEFAULT_DELIMITER_CHAR, ProgressMonitor.NULL).getFeatureCollection(); } catch (IOException expected) { } try { String source = "org.esa.beam.FT\ta\tlat\tlon\n" + "ID1\t10\t5.0\t50.0\n"; FeatureCollection<SimpleFeatureType, SimpleFeature> fc = VectorDataNodeReader.read("blah", new StringReader(source), createDummyProduct(), crsProvider, placemarkDescriptorProvider, DefaultGeographicCRS.WGS84, VectorDataNodeIO.DEFAULT_DELIMITER_CHAR, ProgressMonitor.NULL).getFeatureCollection(); assertEquals(1, fc.size()); assertEquals(Double.class, fc.getSchema().getType(0).getBinding()); assertEquals(10.0, fc.features().next().getAttribute("a")); } catch (IOException e) { fail("Not expected: IOException: " + e.getMessage()); } }
public static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider, PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs, char delimiterChar, ProgressMonitor pm) throws IOException { return new VectorDataNodeReader(sourceName, product, reader, crsProvider, placemarkDescriptorProvider, true, delimiterChar).read(modelCrs, pm); }
VectorDataNodeReader { public static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider, PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs, char delimiterChar, ProgressMonitor pm) throws IOException { return new VectorDataNodeReader(sourceName, product, reader, crsProvider, placemarkDescriptorProvider, true, delimiterChar).read(modelCrs, pm); } }
VectorDataNodeReader { public static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider, PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs, char delimiterChar, ProgressMonitor pm) throws IOException { return new VectorDataNodeReader(sourceName, product, reader, crsProvider, placemarkDescriptorProvider, true, delimiterChar).read(modelCrs, pm); } private  VectorDataNodeReader(String sourceName, Product product, Reader reader, FeatureUtils.FeatureCrsProvider crsProvider,
                                 PlacemarkDescriptorProvider placemarkDescriptorProvider, boolean convertToVertices, char delimiterChar); }
VectorDataNodeReader { public static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider, PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs, char delimiterChar, ProgressMonitor pm) throws IOException { return new VectorDataNodeReader(sourceName, product, reader, crsProvider, placemarkDescriptorProvider, true, delimiterChar).read(modelCrs, pm); } private  VectorDataNodeReader(String sourceName, Product product, Reader reader, FeatureUtils.FeatureCrsProvider crsProvider,
                                 PlacemarkDescriptorProvider placemarkDescriptorProvider, boolean convertToVertices, char delimiterChar); static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider,
                                      PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs,
                                      char delimiterChar, ProgressMonitor pm); static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider,
                                      PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs,
                                      char delimiterChar, boolean convertToVertices, ProgressMonitor pm); }
VectorDataNodeReader { public static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider, PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs, char delimiterChar, ProgressMonitor pm) throws IOException { return new VectorDataNodeReader(sourceName, product, reader, crsProvider, placemarkDescriptorProvider, true, delimiterChar).read(modelCrs, pm); } private  VectorDataNodeReader(String sourceName, Product product, Reader reader, FeatureUtils.FeatureCrsProvider crsProvider,
                                 PlacemarkDescriptorProvider placemarkDescriptorProvider, boolean convertToVertices, char delimiterChar); static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider,
                                      PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs,
                                      char delimiterChar, ProgressMonitor pm); static VectorDataNode read(String sourceName, Reader reader, Product product, FeatureUtils.FeatureCrsProvider crsProvider,
                                      PlacemarkDescriptorProvider placemarkDescriptorProvider, CoordinateReferenceSystem modelCrs,
                                      char delimiterChar, boolean convertToVertices, ProgressMonitor pm);  }