Awesome
json-io
Useful tool for Java serialization to and from JSON format.
Available on Maven Central.
This library has <b>no dependencies</b> on other libraries for runtime other than our own java-util.
The json-io.jar
file is 220K
and java-util
is 336K.
Compatible with JDK1.8 through JDK 23.
Compatibility
JPMS (Java Platform Module System)
This library is fully compatible with JPMS, commonly known as Java Modules. It includes a module-info.class
file that
specifies module dependencies and exports.
OSGi
This library also supports OSGi environments. It comes with pre-configured OSGi metadata in the MANIFEST.MF
file, ensuring easy integration into any OSGi-based application.
Both of these features ensure that our library can be seamlessly integrated into modular Java applications, providing robust dependency management and encapsulation.
To include in your project:
Gradle
implementation 'com.cedarsoftware:json-io:4.31.0'
Maven
<dependency>
<groupId>com.cedarsoftware</groupId>
<artifactId>json-io</artifactId>
<version>4.31.0</version>
</dependency>
User Guide
Usage
WriteOptions reference
ReadOptions reference
Revision History
Releases
5.0.0 (future)
- Bundling: Both JPMS (Java Platform Module System) and OSGi (Open Service Gateway initiative)
- Maintained: Fully
- Java Package: com.cedarsoftware.io
- Java: JDK17+ (Class file 52 format, includes module-info.class - multi-release JAR)
- API
- Static methods on JsonIo: toJson(), toObjects(), formatJson(), deepCopy()
- Use ReadOptionsBuilder and WriteOptionsBuilder to configure
JsonIo
- Use JsonReader.ClassFactory for difficult classes (hard to instantiate & fill)
- Use JsonWriter.JsonClassWriter to customize the output JSON for a particular class
- Updates will be 5.1.0, 5.2.0, ...
4.31.0 (current)
- Version: 4.31.0
- Bundling: Both JPMS (Java Platform Module System) and OSGi (Open Service Gateway initiative)
- Maintained: Fully
- Java Package: com.cedarsoftware.io
- Java: JDK1.8+ (Class file 52 format, includes module-info.class - multi-release JAR)
- API
- Static methods on JsonIo: toJson(), toObjects(), formatJson(), deepCopy()
- Use ReadOptionsBuilder and WriteOptionsBuilder to configure
JsonIo
- Use JsonReader.ClassFactory for difficult classes (hard to instantiate & fill)
- Use JsonWriter.JsonClassWriter to customize the output JSON for a particular class
- Updates will be 4.32.0, 4.33.0, ...
4.14.x (supported)
- Version: 4.14.3
- Bundling: Both JPMS (Java Platform Module System) and OSGi (Open Service Gateway initiative)
- Maintained: Bug fixes, CVE's
- Java Package: com.cedarsoftware.util.io
- Java: JDK1.8+ (Class file 52 format, includes module-info.class - multi-release JAR)
- API
- Static methods on JsonReader: jsonToJava(), jsonToMaps(), special: jsonObjectsToJava()
- Static methods on JsonWriter: objectToJson()), formatJson()
- Configuration via
Map
with constants defined in JsonReader/JsonWriter.- Use JsonReader.JsonClassReader or JsonReader.JsonClassReaderEx for customer reader
- Use JsonReader.assignInstantiator() when
json-io
cannot construct a particular class- Use JsonWriter.JsonClassWriter or JsonWriter.JsonClassWriterEx to customize particular class output JSON
- Updates will be 4.14.4, 4.14.5, ...
Featured on json.org.
For useful Java utilities, check out java-util
Sponsors
YourKit supports open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of <a href="https://www.yourkit.com/java/profiler/index.jsp">YourKit Java Profiler</a> and <a href="https://www.yourkit.com/.net/profiler/index.jsp">YourKit .NET Profiler</a>, innovative and intelligent tools for profiling Java and .NET applications.
<a href="https://www.jetbrains.com/idea/"><img alt="Intellij IDEA from JetBrains" src="https://s-media-cache-ak0.pinimg.com/236x/bd/f4/90/bdf49052dd79aa1e1fc2270a02ba783c.jpg" data-canonical-src="https://s-media-cache-ak0.pinimg.com/236x/bd/f4/90/bdf49052dd79aa1e1fc2270a02ba783c.jpg" width="100" height="100" /></a> Intellij IDEA
License
Copyright (c) 2007 Cedar Software LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
<a href="http://www.apache.org/licenses/LICENSE-2.0">License</a>
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
by John DeRegnaucourt and Kenny Partlow