<dependency>
<grooupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-jodatime</artifactId>
<version>0.5-incubating-SNAPSHOT</version>
</dependency>
2019-11-17
Tamaya JodaTime is an extension module. Refer to the extensions documentation for further details.
Tamaya JodaTime is an extension module to support the usage of Joda-Time in conjunction with Tamaya. Tamaya JodaTime defines some additional property converters to use Joda-Time types when accessing configuration.
To support Joda-Time types as configuration values, you only have to add the following maven dependency to your project:
<dependency>
<grooupId>org.apache.tamaya.ext</groupId>
<artifactId>tamaya-jodatime</artifactId>
<version>0.5-incubating-SNAPSHOT</version>
</dependency>
After adding this module to your project you can retrieve Joda-Time based values directly from a given configuration.
Configuration configuration = Configuration.current();
DateTime pit = configuration.get("pointInTime", DateTime.class)
Currently the following types are supported:
Joda-Time target type | Supported Input Formats |
---|---|
org.joda.time.DateTime org.joda.time.Instant |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
org.joda.time.DateTimeZone |
|
all timezone ids known by Joda-Time. |
|
org.joda.time.Duration |
|
|
|
|
|
org.joda.time.Period |
|
|
|
org.joda.time.LocalDate |
|
|
|
|
|
|
|
org.joda.time.LocalTime |
|
time-element = HH [minute-element] or [fraction] |
|
minute-element = ':' mm [second-element] or [fraction] |
|
second-element = ':' ss [fraction] |