CsvProductReader extends AbstractProductReader { int getProductDataType(Class<?> type) { if (type.getSimpleName().toLowerCase().equals("string")) { return ProductData.TYPE_ASCII; } else if (type.getSimpleName().toLowerCase().equals("float")) { return ProductData.TYPE_FLOAT32; } else if (type.getSimpleName().toLowerCase().equals("double")) { return ProductData.TYPE_FLOAT64; } else if (type.getSimpleName().toLowerCase().equals("byte")) { return ProductData.TYPE_INT8; } else if (type.getSimpleName().toLowerCase().equals("short")) { return ProductData.TYPE_INT16; } else if (type.getSimpleName().toLowerCase().equals("integer")) { return ProductData.TYPE_INT32; } else if (type.getSimpleName().toLowerCase().equals("utc")) { return ProductData.TYPE_UTC; } throw new IllegalArgumentException("Unsupported type '" + type + "'."); } protected  CsvProductReader(ProductReaderPlugIn readerPlugIn); @Override void close();  }
@Test public void testGetDataType() throws Exception { assertEquals(ProductData.TYPE_ASCII, ((CsvProductReader)reader).getProductDataType(String.class)); assertEquals(ProductData.TYPE_FLOAT32, ((CsvProductReader)reader).getProductDataType(Float.class)); assertEquals(ProductData.TYPE_FLOAT64, ((CsvProductReader)reader).getProductDataType(Double.class)); assertEquals(ProductData.TYPE_INT8, ((CsvProductReader)reader).getProductDataType(Byte.class)); }