Package com.api.jsonata4java
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Binding(String expression)Constructor using a variable assignment expressionBinding(String varName, com.fasterxml.jackson.databind.JsonNode value)Constructor using a simple element (not an expression needing to be parsed)Binding(String varName, String expression)Constructor using a variable name and either a variable or function declaration expression
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MappingExpressionParser.ExprContextgetExpression()DeclaredFunctiongetFunction()com.api.jsonata4java.BindingTypegetType()StringgetVarName()static voidmain(String[] args)Test routine for Binding constructionStringtoString()
-
-
-
Constructor Detail
-
Binding
public Binding(String expression) throws ParseException, IOException
Constructor using a variable assignment expression- Parameters:
expression- the variable assignment expression- Throws:
ParseExceptionIOException
-
Binding
public Binding(String varName, com.fasterxml.jackson.databind.JsonNode value)
Constructor using a simple element (not an expression needing to be parsed)- Parameters:
varName- name of the variable to be assigned a valuevalue- the value to be assigned to the variable name
-
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 variableexpression- a variable or function declaration expression- Throws:
ParseExceptionIOException
-
-
Method Detail
-
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()
-
main
public static void main(String[] args)
Test routine for Binding construction- Parameters:
args- not used
-
-