This application is a bare-bones example of how JB4JSON-LD and its integration with Jackson works. It is a command line application that allows serialization and deserialization of sample data.
The demo requires:
- JDK 8 or later
- Apache Maven 3.3 or later
To run the demo, mvn exec:java
can be used (note that mvn package
needs to be run to build the example app first).
The following options can be used as program arguments to specify what the demo application should do.
su
- Serialize a single instance of classUser
slu
- Serialize a list of instances of classUser
so
- Serialize a single instance of class Organization having references to a set of instances of classUser
(with backward references)du
- Deserialize a single instance of classUser
. The second argument can be used to specify path to a file containing JSON-LD to deserialize. If not provided, default sample data will be used.do
- Deserialize a single instance of classOrganization
. The second argument can be used to specify path to a file containing JSON-LD to deserialize. If not provided, default sample data will be used.
For example:
mvn package exec:java -Dexec.args=su
or mvn package exec:java -Dexec.args="du user.json"
Jackson ObjectMapper
is configured in the Example
class, method initObjectMapper
.