Package ghidra.app.util.bin.format.golang.rtti

# Class JsonPatchApplier

java.lang.Object
ghidra.app.util.bin.format.golang.rtti.JsonPatchApplier

public class JsonPatchApplier extends Object
Simplistic implementation, applies a json diff (see https://github.com/josephburnett/jd) to an in memory json element to create a new json value.

Does not use any context hints in the diff to correct for mismatches, hence should only be used against the exact original value to produce the new value, useful for compressing json files that are derived from each other.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JsonPatchApplier(com.google.gson.JsonElement json)`
  `JsonPatchApplier(File baseFile)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `apply(JsonPatch patch, TaskMonitor monitor)`
  `void`
  `apply(String patchString, TaskMonitor monitor)`
  `com.google.gson.JsonElement`
  `getJson()`
  `void`
  `writeJson(File destFile)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### JsonPatchApplier

    public JsonPatchApplier(com.google.gson.JsonElement json)

  - ### JsonPatchApplier

    public JsonPatchApplier(File baseFile) throws IOException
    Throws:
      `IOException`

- ## Method Details

  - ### getJson

    public com.google.gson.JsonElement getJson()

  - ### apply

    public void apply(String patchString, TaskMonitor monitor) throws IOException, CancelledException
    Throws:
      `IOException`
      `CancelledException`

  - ### apply

    public void apply(JsonPatch patch, TaskMonitor monitor) throws IOException, CancelledException
    Throws:
      `IOException`
      `CancelledException`

  - ### writeJson

    public void writeJson(File destFile) throws IOException
    Throws:
      `IOException`