Class JsonProvider


  • @ProviderType
    public abstract class JsonProvider
    extends java.lang.Object
    • Method Detail

      • createParser

        public abstract JsonParser createParser​(java.io.Reader reader)
      • createParser

        public abstract JsonParser createParser​(java.io.InputStream in)
      • createParserFactory

        public abstract JsonParserFactory createParserFactory​(java.util.Map<java.lang.String,​?> config)
      • createGenerator

        public abstract JsonGenerator createGenerator​(java.io.Writer writer)
      • createGenerator

        public abstract JsonGenerator createGenerator​(java.io.OutputStream out)
      • createGeneratorFactory

        public abstract JsonGeneratorFactory createGeneratorFactory​(java.util.Map<java.lang.String,​?> config)
      • createReader

        public abstract JsonReader createReader​(java.io.Reader reader)
      • createReader

        public abstract JsonReader createReader​(java.io.InputStream in)
      • createWriter

        public abstract JsonWriter createWriter​(java.io.Writer writer)
      • createWriter

        public abstract JsonWriter createWriter​(java.io.OutputStream out)
      • createWriterFactory

        public abstract JsonWriterFactory createWriterFactory​(java.util.Map<java.lang.String,​?> config)
      • createReaderFactory

        public abstract JsonReaderFactory createReaderFactory​(java.util.Map<java.lang.String,​?> config)
      • createObjectBuilder

        public abstract JsonObjectBuilder createObjectBuilder()
        Create an empty JsonObjectBuilder
        Since:
        1.0
      • createObjectBuilder

        public JsonObjectBuilder createObjectBuilder​(JsonObject jsonObject)
        Creates a JSON object builder, initialized with the specified JsonObject.
        Since:
        1.1
      • createObjectBuilder

        public JsonObjectBuilder createObjectBuilder​(java.util.Map<java.lang.String,​java.lang.Object> map)
        Creates a JSON object builder, initialized with the specified Map.
        Since:
        1.1
      • createArrayBuilder

        public JsonArrayBuilder createArrayBuilder​(java.util.Collection<?> initialData)
      • createPointer

        public JsonPointer createPointer​(java.lang.String path)
        Create a JsonPointer based on the given path string
        Since:
        1.1
      • createBuilderFactory

        public abstract JsonBuilderFactory createBuilderFactory​(java.util.Map<java.lang.String,​?> config)
      • createValue

        public JsonString createValue​(java.lang.String value)
      • createValue

        public JsonNumber createValue​(int value)
      • createValue

        public JsonNumber createValue​(long value)
      • createValue

        public JsonNumber createValue​(double value)
      • createValue

        public JsonNumber createValue​(java.math.BigDecimal value)
      • createValue

        public JsonNumber createValue​(java.math.BigInteger value)
      • createPatchBuilder

        public JsonPatchBuilder createPatchBuilder()
        Create a new JsonPatchBuilder
        Since:
        1.1
      • createPatchBuilder

        public JsonPatchBuilder createPatchBuilder​(JsonArray initialData)
        Create a new JsonPatchBuilder from initial data.
        Parameters:
        initialData - the initial patch operations
        Since:
        1.1
      • createMergePatch

        public JsonMergePatch createMergePatch​(JsonValue patch)
        Create a merge patch based on the given JsonValue. If you have the following JsonMergePatch:
         {
           "a":"z",
           "c": {
             "f": null
           }
         }
         
        and apply it to the following JSON
         {
           "a": "b",
           "c": {
             "d": "e",
             "f": "g"
           }
         }
         
        you will get the following result:
         {
           "a": "z",
           "c": {
             "d": "e",
           }
         }
         
        Since:
        1.1
        See Also:
        createMergeDiff(JsonValue, JsonValue)
      • createMergeDiff

        public JsonMergePatch createMergeDiff​(JsonValue source,
                                              JsonValue target)
        Create a merge patch by comparing the source to the target. Applying this JsonMergePatch to the source will give you the target. A MergePatch is a JsonValue as defined in http://tools.ietf.org/html/rfc7396 If you have a JSON like
         {
           "a": "b",
           "c": {
             "d": "e",
             "f": "g"
           }
         }
         
        and comparing it with
         {
           "a": "z",
           "c": {
             "d": "e",
           }
         }
         
        you will get the following JsonMergePatch:
         {
           "a":"z",
           "c": {
             "f": null
           }
         }
         
        Since:
        1.1
        See Also:
        createMergePatch(JsonValue)