StopTimeFieldMappingFactory implements FieldMappingFactory { public FieldMapping createFieldMapping(EntitySchemaFactory schemaFactory, Class<?> entityType, String csvFieldName, String objFieldName, Class<?> objFieldType, boolean required) { return new StopTimeFieldMapping(entityType, csvFieldName, objFieldName, required); }  FieldMapping createFieldMapping(EntitySchemaFactory schemaFactory,
      Class<?> entityType, String csvFieldName, String objFieldName,
      Class<?> objFieldType, boolean required); static String getSecondsAsString(int t); static int getStringAsSeconds(String value);  }
@Test public void test() { StopTimeFieldMappingFactory factory = new StopTimeFieldMappingFactory(); DefaultEntitySchemaFactory schemaFactory = new DefaultEntitySchemaFactory(); String propName = "time"; FieldMapping mapping = factory.createFieldMapping(schemaFactory, Dummy.class, propName, propName, Integer.class, true); CsvEntityContext context = new CsvEntityContextImpl(); Map<String, Object> csvValues = new HashMap<String, Object>(); csvValues.put(propName, "1234:23:32"); Dummy obj = new Dummy(); BeanWrapper wrapped = BeanWrapperFactory.wrap(obj); mapping.translateFromCSVToObject(context, csvValues, wrapped); assertEquals(new Integer(1234 * 60 * 60 + 23 * 60 + 32), obj.getTime()); csvValues.clear(); mapping.translateFromObjectToCSV(context, wrapped, csvValues); assertEquals("1234:23:32", csvValues.get(propName)); }