Class NodeReference.ObjectReference

java.lang.Object
org.eclipse.parsson.NodeReference
org.eclipse.parsson.NodeReference.ObjectReference
Enclosing class:
NodeReference

static class NodeReference.ObjectReference extends NodeReference
  • Field Details

    • object

      private final jakarta.json.JsonObject object
    • key

      private final String key
    • jsonContext

      private final JsonContext jsonContext
  • Constructor Details

    • ObjectReference

      ObjectReference(jakarta.json.JsonObject object, String key, JsonContext jsonContext)
  • Method Details

    • contains

      public boolean contains()
      Description copied from class: NodeReference
      Return true if a reference points to a valid value, false otherwise.
      Specified by:
      contains in class NodeReference
      Returns:
      true if a reference points to a value
    • get

      public jakarta.json.JsonValue get()
      Description copied from class: NodeReference
      Get the value at the referenced location.
      Specified by:
      get in class NodeReference
      Returns:
      the JSON value referenced
    • add

      public jakarta.json.JsonObject add(jakarta.json.JsonValue value)
      Description copied from class: NodeReference
      Add or replace a value at the referenced location. If the reference is the root of a JSON tree, the added value must be a JSON object or array, which becomes the referenced JSON value. If the reference is an index of a JSON array, the value is inserted into the array at the index. If the index is -1, the value is appended to the array. If the reference is a name of a JSON object, the name/value pair is added to the object, replacing any pair with the same name.
      Specified by:
      add in class NodeReference
      Parameters:
      value - the value to be added
      Returns:
      the JsonStructure after the operation
    • remove

      public jakarta.json.JsonObject remove()
      Description copied from class: NodeReference
      Remove the name/value pair from the JSON object, or the value in a JSON array, as specified by the reference
      Specified by:
      remove in class NodeReference
      Returns:
      the JsonStructure after the operation
    • replace

      public jakarta.json.JsonObject replace(jakarta.json.JsonValue value)
      Description copied from class: NodeReference
      Replace the referenced value with the specified value.
      Specified by:
      replace in class NodeReference
      Parameters:
      value - the JSON value to be stored at the referenced location
      Returns:
      the JsonStructure after the operation