Package com.inrupt.client.jackson
package com.inrupt.client.jackson
Jackson JSON support for the Inrupt Java Client Libraries
Many of the high-level APIs in the Inrupt Java Client Libraries make use of a JSON parser. In the Java ecosystem, there are several widely used JSON parsing libraries. This package adds support for the Jackson JSON libraries.
A user of the JacksonService
should ensure that the Jackson implementation is
available on the classpath by adding the following dependency:
<dependency> <groupId>com.inrupt</groupId> <artifactId>inrupt-client-jackson</artifactId> <version>${project.version}</version> </dependency>
Example of using the JSON service fromJson() method to deserialize data into a custom type:
JsonService service = ServiceProvider.getJsonService();
try (InputStream is = Test.class.getResourceAsStream("customType.json")) {
CustomType obj = service.fromJson(is, CustomType.class);
System.out.println("Custom Type Id is: " + obj.id);
}
-
Classes