Class JsonUtil

java.lang.Object
org.glassfish.json.JsonUtil

public final class JsonUtil extends Object
A utility class
Since:
1.1
  • Constructor Details

    • JsonUtil

      private JsonUtil()
  • Method Details

    • toJson

      public static JsonValue toJson(String jsonString)
      Reads the input JSON text and returns a JsonValue.

      For convenience, single quotes as well as double quotes are allowed to delimit JSON strings. If single quotes are used, any quotes, single or double, in the JSON string must be escaped (prepend with a '\').

      Parameters:
      jsonString - the input JSON data
      Returns:
      the object model for jsonString
      Throws:
      JsonParsingException - if the input is not legal JSON text