Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
public static void read(String incomingJSONPostBody) {

        JsonReader reader = Json.createReader(new StringReader(incomingJSONPostBody));

        JsonObject jsonobject = reader.readObject();

        JsonString jsonValue = jsonobject.getJsonString("jsonKey");


        if (jsonValue.toString().contains("matcher")) {

           //perform action if matcher

            String specificValue = jsonValue.toString();

            System.out.println(specificValue);

        }

    }



using javax.json

Store Objects made with Json.createObjectBuilder into jsonArrayBuilder... example:

jsonFirstObject = Json.createObjectBuilder()

.add("name",