@Test public void testParse() { String s = "" + "kyle,123456,emp123,1\n" + "jimmy,abcnum,cust09878,2"; strat.setColumnMapping("name", "orderNumber", "id", "num"); CsvToBean<MockBean> csv = new CsvToBean<MockBean>(); List<MockBean> list = csv.parse(strat, new StringReader(s)); assertNotNull(list); assertTrue(list.size() == 2); MockBean bean = list.get(0); assertEquals("kyle", bean.getName()); assertEquals("123456", bean.getOrderNumber()); assertEquals("emp123", bean.getId()); assertEquals(1, bean.getNum()); }
public void setColumnMapping(String... columnMapping) { this.columnMapping = columnMapping != null ? columnMapping.clone() : new String[]{}; }
ColumnPositionMappingStrategy extends HeaderColumnNameMappingStrategy<T> { public void setColumnMapping(String... columnMapping) { this.columnMapping = columnMapping != null ? columnMapping.clone() : new String[]{}; } }
ColumnPositionMappingStrategy extends HeaderColumnNameMappingStrategy<T> { public void setColumnMapping(String... columnMapping) { this.columnMapping = columnMapping != null ? columnMapping.clone() : new String[]{}; }  }
ColumnPositionMappingStrategy extends HeaderColumnNameMappingStrategy<T> { public void setColumnMapping(String... columnMapping) { this.columnMapping = columnMapping != null ? columnMapping.clone() : new String[]{}; }  void captureHeader(CsvReader reader); String[] getColumnMapping(); void setColumnMapping(String... columnMapping); }
ColumnPositionMappingStrategy extends HeaderColumnNameMappingStrategy<T> { public void setColumnMapping(String... columnMapping) { this.columnMapping = columnMapping != null ? columnMapping.clone() : new String[]{}; }  void captureHeader(CsvReader reader); String[] getColumnMapping(); void setColumnMapping(String... columnMapping);  }