Class JSONPathCompilerReflect.SingleNamePathTyped

java.lang.Object
com.alibaba.fastjson2.JSONPath
com.alibaba.fastjson2.JSONPathCompilerReflect.SingleNamePathTyped
Enclosing class:
JSONPathCompilerReflect

public static class JSONPathCompilerReflect.SingleNamePathTyped extends JSONPath
  • Constructor Details

  • Method Details

    • getParent

      public JSONPath getParent()
      Description copied from class: JSONPath
      Gets the parent JSONPath of this path
      Specified by:
      getParent in class JSONPath
      Returns:
      the parent JSONPath, or null if this is the root path
    • isRef

      public boolean isRef()
      Description copied from class: JSONPath
      Checks if this path is a reference
      Specified by:
      isRef in class JSONPath
      Returns:
      true if this path is a reference, false otherwise
    • contains

      public boolean contains(Object rootObject)
      Description copied from class: JSONPath
      Checks if the path exists in the object
      Specified by:
      contains in class JSONPath
      Parameters:
      rootObject - the object to check
      Returns:
      true if the path exists, false otherwise
    • eval

      public Object eval(Object object)
      Description copied from class: JSONPath
      Evaluates the path on the object
      Specified by:
      eval in class JSONPath
      Parameters:
      object - the object to evaluate
      Returns:
      the evaluation result
    • extract

      public Object extract(JSONReader jsonReader)
      Description copied from class: JSONPath
      Extracts a value using the provided JSONReader
      Specified by:
      extract in class JSONPath
      Parameters:
      jsonReader - the JSONReader to use
      Returns:
      the extracted value
    • extractScalar

      public String extractScalar(JSONReader jsonReader)
      Description copied from class: JSONPath
      Extracts a scalar value using the provided JSONReader
      Specified by:
      extractScalar in class JSONPath
      Parameters:
      jsonReader - the JSONReader to use
      Returns:
      the extracted scalar value
    • set

      public void set(Object rootObject, Object value)
      Description copied from class: JSONPath
      Sets a value in the object
      Specified by:
      set in class JSONPath
      Parameters:
      rootObject - the object to modify
      value - the value to set
    • set

      public void set(Object rootObject, Object value, JSONReader.Feature... readerFeatures)
      Description copied from class: JSONPath
      Sets a value in the object with specified reader features
      Specified by:
      set in class JSONPath
      Parameters:
      rootObject - the object to modify
      value - the value to set
      readerFeatures - the reader features to apply
    • setCallback

      public void setCallback(Object rootObject, BiFunction callback)
      Description copied from class: JSONPath
      Sets a callback function for the object
      Specified by:
      setCallback in class JSONPath
      Parameters:
      rootObject - the object to modify
      callback - the callback function to set
    • setInt

      public void setInt(Object rootObject, int value)
      Description copied from class: JSONPath
      Sets an integer value in the object
      Specified by:
      setInt in class JSONPath
      Parameters:
      rootObject - the object to modify
      value - the integer value to set
    • setLong

      public void setLong(Object rootObject, long value)
      Description copied from class: JSONPath
      Sets a long value in the object
      Specified by:
      setLong in class JSONPath
      Parameters:
      rootObject - the object to modify
      value - the long value to set
    • remove

      public boolean remove(Object rootObject)
      Description copied from class: JSONPath
      Removes a value from the object
      Specified by:
      remove in class JSONPath
      Parameters:
      rootObject - the object to modify
      Returns:
      true if removal was successful, false otherwise