@Test(expected = ConverterException.class) public void testConvertExceptionByDest() { converter.convert("2017-09-03", TypeToken.of(Duration.class)); }
@Override public Object convert(Object source, TypeToken<?> targetTypeToken) { if (!canHandle(source, targetTypeToken)) { throw new ConverterException(source, targetTypeToken.getRawType()); } Date date = stringToDateConverter.convert(String.valueOf(source)); return dateToJodaTimeBaseLocalConverter.convert(date, targetTypeToken); }
StringToJodaTimeBaseLocalConverter extends AbstractConverter { @Override public Object convert(Object source, TypeToken<?> targetTypeToken) { if (!canHandle(source, targetTypeToken)) { throw new ConverterException(source, targetTypeToken.getRawType()); } Date date = stringToDateConverter.convert(String.valueOf(source)); return dateToJodaTimeBaseLocalConverter.convert(date, targetTypeToken); } }
StringToJodaTimeBaseLocalConverter extends AbstractConverter { @Override public Object convert(Object source, TypeToken<?> targetTypeToken) { if (!canHandle(source, targetTypeToken)) { throw new ConverterException(source, targetTypeToken.getRawType()); } Date date = stringToDateConverter.convert(String.valueOf(source)); return dateToJodaTimeBaseLocalConverter.convert(date, targetTypeToken); }  }
StringToJodaTimeBaseLocalConverter extends AbstractConverter { @Override public Object convert(Object source, TypeToken<?> targetTypeToken) { if (!canHandle(source, targetTypeToken)) { throw new ConverterException(source, targetTypeToken.getRawType()); } Date date = stringToDateConverter.convert(String.valueOf(source)); return dateToJodaTimeBaseLocalConverter.convert(date, targetTypeToken); }  @Override Object convert(Object source, TypeToken<?> targetTypeToken); @Override boolean canHandle(Object source, TypeToken<?> targetTypeToken); }
StringToJodaTimeBaseLocalConverter extends AbstractConverter { @Override public Object convert(Object source, TypeToken<?> targetTypeToken) { if (!canHandle(source, targetTypeToken)) { throw new ConverterException(source, targetTypeToken.getRawType()); } Date date = stringToDateConverter.convert(String.valueOf(source)); return dateToJodaTimeBaseLocalConverter.convert(date, targetTypeToken); }  @Override Object convert(Object source, TypeToken<?> targetTypeToken); @Override boolean canHandle(Object source, TypeToken<?> targetTypeToken);  }