Class InvokeExpression

java.lang.Object
org.datanucleus.store.query.expression.Expression
org.datanucleus.store.query.expression.InvokeExpression
All Implemented Interfaces:
Serializable

public class InvokeExpression extends Expression
Expression representing invocation of a method. This may be an aggregate in a result clause (like "count(this)"), or a method on a class, or a function. The "left" expression is what we are invoking on. This is typically a PrimaryExpression, or an InvokeExpression. This then allows chaining of invocations.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • methodName

      String methodName
      Name of the method to invoke.
    • arguments

      List<Expression> arguments
      Arguments for the method invocation.
  • Constructor Details

    • InvokeExpression

      public InvokeExpression(Expression invoked, String methodName, List<Expression> args)
      Constructor for an expression for the invocation of a method/function.
      Parameters:
      invoked - Expression on which we are invoking
      methodName - Name of the method
      args - Arguments passed in to the method/function call
  • Method Details

    • getOperation

      public String getOperation()
      The method/function invoked.
      Returns:
      The method/function invoked.
    • getArguments

      public List<Expression> getArguments()
      Accessor for any arguments to be passed in the invocation.
      Returns:
      The arguments.
    • bind

      public Symbol bind(SymbolTable symtbl)
      Method to bind the expression to the symbol table as appropriate.
      Specified by:
      bind in class Expression
      Parameters:
      symtbl - Symbol table
      Returns:
      The symbol for this expression
    • toStringWithoutAlias

      public String toStringWithoutAlias()
      Method to return the string form of this without the alias component. This is useful when we want to compare expressions in a query compile, and the alias is not important to the comparison. Returns a String of the form "InvokeExpression{[left].methodName(args)}" or "InvokeExpression{STATIC.methodName(args)}".
      Returns:
      The string form
    • toString

      public String toString()
      Method to return the string form of this expression. Returns a String of the form "InvokeExpression{[left].methodName(args)} AS alias" or "InvokeExpression{STATIC.methodName(args)} AS alias". where it only adds the "AS alias" when the alias is non-null.
      Overrides:
      toString in class Object
      Returns:
      The string form