1 package org.opentrafficsim.xml.bindings;
2
3 import org.djunits.value.vdouble.scalar.Duration;
4 import org.djutils.logger.CategoryLogger;
5
6
7
8
9
10
11
12
13
14 public class DurationAdapter extends UnitAdapter<Duration>
15 {
16
17 @Override
18 public Duration unmarshal(final String field) throws IllegalArgumentException
19 {
20 try
21 {
22 return Duration.valueOf(field);
23 }
24 catch (Exception exception)
25 {
26 CategoryLogger.always().error(exception, "Problem parsing Duration '" + field + "'");
27 throw exception;
28 }
29 }
30
31 }