Package com.inrupt.client.jsonb


package com.inrupt.client.jsonb

JakartaEE JSON Bind 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 JakartaEE 8 JSON APIs.

This module depends on the JakartaEE APIs. A user of the JsonbService should ensure that the relevant JakartaEE JSON implementations are available on the classpath in addition to Jsonb. Example:

     <dependency>
            <groupId>com.inrupt</groupId>
            <artifactId>inrupt-client-jsonb</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
    Class
    Description
    A JsonService using the JakartaEE JSON Bind API.