Class JavaCall

Direct Known Subclasses:
StaticJavaCall

public abstract class JavaCall extends Arr
This class contains common methods for executing Java code and mapping Java objects to XQuery values.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Method Details

    • value

      public final Value value(QueryContext qc) throws QueryException
      Description copied from class: Expr
      Evaluates the expression and returns the resulting value. If this method is not implemented, Expr.item(QueryContext, InputInfo) must be implemented instead.
      Overrides:
      value in class ParseExpr
      Parameters:
      qc - query context
      Returns:
      value
      Throws:
      QueryException - query exception
    • eval

      protected abstract Object eval(QueryContext qc) throws QueryException
      Returns the result of the evaluated Java function.
      Parameters:
      qc - query context
      Returns:
      arguments
      Throws:
      QueryException - query exception
    • toValue

      public static Value toValue(Object object, QueryContext qc, StaticContext sc) throws QueryException
      Converts the specified result to an XQuery value.
      Parameters:
      object - result object
      qc - query context
      sc - static context
      Returns:
      value
      Throws:
      QueryException - query exception
    • get

      public static JavaCall get(QNm qname, Expr[] args, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
      Returns a new Java function instance.
      Parameters:
      qname - function name
      args - arguments
      qc - query context
      sc - static context
      ii - input info
      Returns:
      Java function or null
      Throws:
      QueryException - query exception
    • typesMatch

      protected static boolean typesMatch(Class<?>[] pTypes, String[] qTypes)
      Compares the types of method parameters with the specified types.
      Parameters:
      pTypes - parameter types
      qTypes - query types (can be null)
      Returns:
      result of check
    • description

      public final String description()
      Description copied from class: ExprInfo
      Returns a string description of the expression. This method is only called by error messages. Contrary to the ExprInfo.toString() method, arguments are not included in the output.
      Overrides:
      description in class ExprInfo
      Returns:
      result of check
    • plan

      public final void plan(QueryPlan plan)
      Description copied from class: ExprInfo
      Creates a query plan.
      Overrides:
      plan in class Arr
      Parameters:
      plan - expression plan
    • plan

      public void plan(QueryString qs)
      Description copied from class: ExprInfo
      Creates a query string.
      Specified by:
      plan in class ExprInfo
      Parameters:
      qs - query string builder