diff --git a/README.md b/README.md index e8f6cec1..eea85c57 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Project is composed of multiple Maven sub-modules, each corresponding to a jar: * [jr-retrofit2](../../tree/master/jr-retrofit2) contains `jackson-jr` - based handlers for [Retrofit 2](https://square.github.io/retrofit/) library * Depends on `jackson-jr` and `Retrofit` API jars, and indirectly on `jackson-core` * [jr-annotation-support](../../tree/master/jr-annotation-support) contains extension with support for a subset of core [Jackson annotations](../../../jackson-annotations) +* [jr-extension-datetime](../../tree/master/jr-extension-datetime) contains extension with support for `LocalDateTime` * jr-all creates an "uber-jar" that contains individual modules along with all their dependencies: * `jr-objects` classes as-is, without relocating * `jr-stree` classes as-is, without relocating diff --git a/jr-extension-datetime/README.md b/jr-extension-datetime/README.md new file mode 100644 index 00000000..94838e76 --- /dev/null +++ b/jr-extension-datetime/README.md @@ -0,0 +1,28 @@ +## Overview + +This module extends the functionalities of jackson-jr adding support for LocalDateTime. + +### Example + +```java +import com.fasterxml.jackson.jr.extension.datetime.JacksonLocalDateTimeExtension; +import com.fasterxml.jackson.jr.ob.JSON; + +import java.time.LocalDateTime; + +class Application { + private static final JSON JACKSON = JSON.builder() + .register(new JacksonLocalDateTimeExtension()) + .build(); + + public static void main(String[] args) { + // Create the class that we need to + final LocalDateTime now = LocalDateTime.now(); + MyClass myObject = new MyClass(now, 'Some Other Values....'); + String myObjectJsonString = JACKSON.asString(myObject); + MyClass myObjectFromJson = JACKSON.beanFrom(MyClass, myObjectJsonString); + assert myObjectFromJson.time == now; + } + +} +``` diff --git a/jr-extension-datetime/pom.xml b/jr-extension-datetime/pom.xml index 4d62aafe..73a443d6 100644 --- a/jr-extension-datetime/pom.xml +++ b/jr-extension-datetime/pom.xml @@ -1,8 +1,11 @@ - - + + + + + + 4.0.0 + com.fasterxml.jackson.jr jackson-jr-parent @@ -11,12 +14,58 @@ jackson-jr-extension-datetime bundle + Additional package that adds support for LocalDate time and other Time Related Fields + https://github.com/FasterXML/jackson-jr + + + + The Apache Software License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + ${project.groupId}.extension.datetime;version=${project.version} + + + 2023-11-15T22:39:39Z + com.fasterxml.jackson.jr jackson-jr-objects + ${project.version} + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${surefire.redirectTestOutputToFile} + + **/failing/*.java + + + + + + org.moditect + moditect-maven-plugin + + + + de.jjohannes + gradle-module-metadata-maven-plugin + + + + diff --git a/jr-extension-datetime/src/main/resources/META-INF/LICENSE b/jr-extension-datetime/src/main/resources/META-INF/LICENSE new file mode 100644 index 00000000..56dcbf42 --- /dev/null +++ b/jr-extension-datetime/src/main/resources/META-INF/LICENSE @@ -0,0 +1,8 @@ +This copy of Jackson-jr library is licensed under the +Apache (Software) License, version 2.0 ("the License"). +See the License for details about distribution rights, and the +specific rights regarding derivative works. + +You may obtain a copy of the License at: + +http://www.apache.org/licenses/LICENSE-2.0 diff --git a/jr-extension-datetime/src/main/resources/META-INF/NOTICE b/jr-extension-datetime/src/main/resources/META-INF/NOTICE new file mode 100644 index 00000000..d55c59a0 --- /dev/null +++ b/jr-extension-datetime/src/main/resources/META-INF/NOTICE @@ -0,0 +1,17 @@ +# Jackson JSON processor + +Jackson is a high-performance, Free/Open Source JSON processing library. +It was originally written by Tatu Saloranta (tatu.saloranta@iki.fi), and has +been in development since 2007. +It is currently developed by a community of developers. + +## Licensing + +Jackson components are licensed under Apache (Software) License, version 2.0, +as per accompanying LICENSE file. + +## Credits + +A list of contributors may be found from CREDITS file, which is included +in some artifacts (usually source distributions); but is always available +from the source code management (SCM) system project uses.