Class ValueNodeMapper

java.lang.Object
com.northconcepts.datapipeline.jsonata.ValueNodeMapper

public final class ValueNodeMapper extends Object
Converts values between DataPipeline ValueNodes and the maps, lists and plain Java values used by the JSONata engine.
  • Method Details

    • isValueNode

      public static boolean isValueNode(Object value)
      Returns true if the value is a ValueNode, such as a Record or ArrayValue.
    • toJsonataData

      public static Object toJsonataData(Object value)
      Converts a DataPipeline ValueNode to a form the JSONata engine understands (Map, List, or plain Java value) without deep-copying.

      Record is wrapped in a JsonObject (implements Map), ArrayValue is wrapped in an JsonArray (implements List), and SingleValue is returned as its raw Java value.

    • toValueNode

      public static ValueNode<?> toValueNode(Object value)
      Converts a JSONata engine result back to a DataPipeline ValueNode.

      If the result is already backed by a JsonObject or JsonArray, the original DataPipeline object is unwrapped directly — no copy required. Plain Map and List instances produced by the engine are converted to Record and ArrayValue respectively.