Class Binding

java.lang.Object
com.api.jsonata4java.Binding
All Implemented Interfaces:
Serializable

public class Binding extends Object implements Serializable
Class mapping a variable name to a variable or function declaration expression
See Also:
  • Constructor Details

    • Binding

      public Binding(String expression) throws ParseException, IOException
      Constructor using a variable assignment expression
      Parameters:
      expression - the variable assignment expression
      Throws:
      ParseException
      IOException
    • Binding

      public Binding(String varName, com.fasterxml.jackson.databind.JsonNode value) throws ParseException
      Constructor using a simple element (not an expression needing to be parsed)
      Parameters:
      varName - name of the variable to be assigned a value
      value - the value to be assigned to the variable name
      Throws:
      ParseException
    • Binding

      public Binding(String varName, String expression) throws ParseException, IOException
      Constructor using a variable name and either a variable or function declaration expression
      Parameters:
      varName - name of the variable
      expression - a variable or function declaration expression
      Throws:
      ParseException
      IOException
  • Method Details

    • getVarName

      public String getVarName()
      Returns:
      the name of the variable or function declaration
    • getFunction

      public DeclaredFunction getFunction()
      Returns:
      the function declaration if the type is BindingType.FUNCTION, otherwise returns null
    • getExpression

      public MappingExpressionParser.ExprContext getExpression()
      Returns:
      the expression defining the variable or function declaration
    • getType

      public com.api.jsonata4java.BindingType getType()
      Returns:
      the type of binding (either BindingType.VARIABLE or BindingType.FUNCTION)
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      the string representation of the variable or function declaration
    • main

      public static void main(String[] args)
      Test routine for Binding construction
      Parameters:
      args - not used