Module jakarta.json

Class JsonUtil


  • public final class JsonUtil
    extends Object
    A utility class
    Since:
    1.1
    • Method Detail

      • 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