@Test public void testPartialRead() throws IOException { assertArrayEquals(HEADER, mapReader.getHeader(true)); int i = 0; Map<String, String> customer; while( (customer = mapReader.read(PARTIAL_HEADER)) != null ) { assertNull(customer.get("customerNo")); assertEquals(STRING_CUSTOMERS.get(i).getFirstName(), customer.get("firstName")); assertEquals(STRING_CUSTOMERS.get(i).getLastName(), customer.get("lastName")); assertNull(customer.get("birthDate")); assertNull(customer.get("mailingAddress")); assertNull(customer.get("married")); assertNull(customer.get("numberOfKids")); assertNull(customer.get("favouriteQuote")); assertEquals(STRING_CUSTOMERS.get(i).getEmail(), customer.get("email")); assertNull(customer.get("loyaltyPoints")); i++; } assertEquals(STRING_CUSTOMERS.size() + 1, mapReader.getRowNumber()); }
public Map<String, String> read(final String... nameMapping) throws IOException { if( nameMapping == null ) { throw new NullPointerException("nameMapping should not be null"); } if( readRow() ) { final Map<String, String> destination = new HashMap<String, String>(); Util.filterListToMap(destination, nameMapping, getColumns()); return destination; } return null; }
CsvMapReader extends AbstractCsvReader implements ICsvMapReader { public Map<String, String> read(final String... nameMapping) throws IOException { if( nameMapping == null ) { throw new NullPointerException("nameMapping should not be null"); } if( readRow() ) { final Map<String, String> destination = new HashMap<String, String>(); Util.filterListToMap(destination, nameMapping, getColumns()); return destination; } return null; } }
CsvMapReader extends AbstractCsvReader implements ICsvMapReader { public Map<String, String> read(final String... nameMapping) throws IOException { if( nameMapping == null ) { throw new NullPointerException("nameMapping should not be null"); } if( readRow() ) { final Map<String, String> destination = new HashMap<String, String>(); Util.filterListToMap(destination, nameMapping, getColumns()); return destination; } return null; } CsvMapReader(final Reader reader, final CsvPreference preferences);  CsvMapReader(final ITokenizer tokenizer, final CsvPreference preferences); }
CsvMapReader extends AbstractCsvReader implements ICsvMapReader { public Map<String, String> read(final String... nameMapping) throws IOException { if( nameMapping == null ) { throw new NullPointerException("nameMapping should not be null"); } if( readRow() ) { final Map<String, String> destination = new HashMap<String, String>(); Util.filterListToMap(destination, nameMapping, getColumns()); return destination; } return null; } CsvMapReader(final Reader reader, final CsvPreference preferences);  CsvMapReader(final ITokenizer tokenizer, final CsvPreference preferences); Map<String, String> read(final String... nameMapping); Map<String, Object> read(final String[] nameMapping, final CellProcessor[] processors); }
CsvMapReader extends AbstractCsvReader implements ICsvMapReader { public Map<String, String> read(final String... nameMapping) throws IOException { if( nameMapping == null ) { throw new NullPointerException("nameMapping should not be null"); } if( readRow() ) { final Map<String, String> destination = new HashMap<String, String>(); Util.filterListToMap(destination, nameMapping, getColumns()); return destination; } return null; } CsvMapReader(final Reader reader, final CsvPreference preferences);  CsvMapReader(final ITokenizer tokenizer, final CsvPreference preferences); Map<String, String> read(final String... nameMapping); Map<String, Object> read(final String[] nameMapping, final CellProcessor[] processors);  }