Package org.basex.query.func.java
Class JavaCall
- java.lang.Object
-
- org.basex.query.expr.ExprInfo
-
- org.basex.query.expr.Expr
-
- org.basex.query.expr.ParseExpr
-
- org.basex.query.expr.Arr
-
- org.basex.query.func.java.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-24, BSD License, Christian Gruen
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static String
classPath(String name)
Returns a fully qualified class name.String
description()
Returns a string description of the expression.protected abstract Value
eval(QueryContext qc, MainOptions.WrapOptions wrap)
Returns the result of the evaluated Java function.static JavaCall
get(QNm qname, Expr[] args, QueryContext qc, InputInfo info)
Returns a new Java function instance.void
toString(QueryString qs)
Creates a query string.static Value
toValue(Object object, QueryContext qc, InputInfo info)
Converts the specified object to an XQuery value.static Value
toValue(Object object, QueryContext qc, InputInfo info, MainOptions.WrapOptions wrap)
Converts the specified object to an XQuery value.void
toXml(QueryPlan plan)
Creates a query plan.Value
value(QueryContext qc)
Evaluates the expression and returns the resulting value.-
Methods inherited from class org.basex.query.expr.Arr
accept, allAreValues, arg, args, checkUp, compile, copyAll, count, equals, exprSize, flatten, has, inline, inlineable, mayBePositional, removeEmpty, simplifyAll
-
Methods inherited from class org.basex.query.expr.ParseExpr
adoptType, atomValue, checkAllUp, checkNoneUp, checkNoUp, checkType, checkType, checkUp, copyType, ctxValue, data, info, item, iter, refineType, sc, seqType, size, test, toArray, toArray, toAtomItem, toBin, toBin, toBinOrNull, toBoolean, toBoolean, toBooleanOrFalse, toBytes, toBytes, toDouble, toDouble, toElem, toElem, toEnum, toFloat, toFunction, toLong, toLong, toLong, toMap, toMap, toNode, toNode, toNodeOrNull, toNumber, toNumber, toNumberOrNull, toQNm, toQNmOrNull, toRecord, toString, toString, toStringOrNull, toToken, toToken, toTokenOrNull, toZeroToken
-
Methods inherited from class org.basex.query.expr.Expr
arg, atomItem, atomIter, copy, ddo, funcType, hasFreeVars, indexAccessible, info, isSimple, markTailCalls, mergeEbv, optimize, optimizePos, simplify, simplifyFor, typeCheck, uses, vacuous, visitAll
-
Methods inherited from class org.basex.query.expr.ExprInfo
toErrorString, toString
-
-
-
-
Method Detail
-
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 classParseExpr
- Parameters:
qc
- query context- Returns:
- value
- Throws:
QueryException
- query exception
-
eval
protected abstract Value eval(QueryContext qc, MainOptions.WrapOptions wrap) throws QueryException
Returns the result of the evaluated Java function.- Parameters:
qc
- query contextwrap
- wrap options- Returns:
- result value
- Throws:
QueryException
- query exception
-
toValue
public static Value toValue(Object object, QueryContext qc, InputInfo info) throws QueryException
Converts the specified object to an XQuery value.- Parameters:
object
- result objectqc
- query contextinfo
- input info (can benull
)- Returns:
- value
- Throws:
QueryException
- query exception
-
toValue
public static Value toValue(Object object, QueryContext qc, InputInfo info, MainOptions.WrapOptions wrap) throws QueryException
Converts the specified object to an XQuery value.- Parameters:
object
- result objectqc
- query contextinfo
- input info (can benull
)wrap
- wrap options- Returns:
- value
- Throws:
QueryException
- query exception
-
get
public static JavaCall get(QNm qname, Expr[] args, QueryContext qc, InputInfo info) throws QueryException
Returns a new Java function instance.- Parameters:
qname
- function nameargs
- argumentsqc
- query contextinfo
- input info (can benull
)- Returns:
- Java function or
null
- Throws:
QueryException
- query exception
-
classPath
public static String classPath(String name)
Returns a fully qualified class name.- Parameters:
name
- class string- Returns:
- normalized name
-
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 theExprInfo.toString()
method, arguments are not included in the output.- Overrides:
description
in classExprInfo
- Returns:
- result of check
-
toXml
public final void toXml(QueryPlan plan)
Description copied from class:ExprInfo
Creates a query plan.
-
toString
public void toString(QueryString qs)
Description copied from class:ExprInfo
Creates a query string.
-
-