私は具体的な実装を提供しています:私はjava.time.LocalTime
を処理する必要が私の場合は具体的な実装
ので、私最初に書いた:
@Override
public Object stringToValue(String text) throws ParseException {
return LocalTime.parse(text);
}
私は実際に例外を自分自身に変換する必要がありました。
@Override
public Object stringToValue(String text) throws ParseException {
try {
return LocalTime.parse(text);
} catch (DateTimeParseException e) {
// API expect a ParseException to report an error in conversion
// need to cast DateTimeParseException into ParseException
throw new ParseException(e.getParsedString(), e.getErrorIndex());
}
}
java.text.ParseException
にjava.time.format.DateTimeParseException
を変換するためにシンプルなものがあるかどうか、私は疑問に思って、または私は他の1つの例外をキャストするために明らかに何かが足りないのですか?
わずかに良い、私はまだセットアップコンプレックスを見つけます... – malat