Package org.basex.query.func
Class StaticFuncs
java.lang.Object
org.basex.query.expr.ExprInfo
org.basex.query.func.StaticFuncs
Container for user-defined functions.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck(QueryContext qc) Checks if all functions have been correctly declared, and initializes all function calls.voidcheckUp()Checks if the updating semantics are satisfied.voidCompiles all referenced functions.voidCompiles all functions.declare(AnnList anns, QNm qname, Var[] params, SeqType type, Expr expr, String doc, VarScope vs, InputInfo ii) Declares a new user-defined function.funcs()Returns all user-defined functions.Returns the function with the given name and arity.voidCreates a query plan.voidplan(QueryString qs) Creates a query string.voidregisterFuncLiteral(Closure literal) Registers a literal for a function that was not yet encountered during parsing.SeqType[]seqTypes(StaticFunc func) Returns the unions of the sequences types for function calls of the specified function.similarError(QNm qname, InputInfo ii) Throws an exception if the name of a function is similar to the specified function name.Methods inherited from class org.basex.query.expr.ExprInfo
description, toErrorString, toString
-
Constructor Details
-
StaticFuncs
public StaticFuncs()
-
-
Method Details
-
declare
public StaticFunc declare(AnnList anns, QNm qname, Var[] params, SeqType type, Expr expr, String doc, VarScope vs, InputInfo ii) throws QueryException Declares a new user-defined function.- Parameters:
anns- annotationsqname- function nameparams- formal parameterstype- declared return type (can benull)expr- function body (can benull)doc- xqdoc stringvs- variable scopeii- input info- Returns:
- static function reference
- Throws:
QueryException- query exception
-
registerFuncLiteral
Registers a literal for a function that was not yet encountered during parsing.- Parameters:
literal- the literal
-
check
Checks if all functions have been correctly declared, and initializes all function calls.- Parameters:
qc- query context- Throws:
QueryException- query exception
-
checkUp
Checks if the updating semantics are satisfied.- Throws:
QueryException- query exception
-
compileAll
Compiles all functions.- Parameters:
cc- compilation context
-
compile
Compiles all referenced functions.- Parameters:
cc- compilation context
-
get
Returns the function with the given name and arity.- Parameters:
qname- function namearity- function arity- Returns:
- function if found,
nullotherwise
-
seqTypes
Returns the unions of the sequences types for function calls of the specified function.- Parameters:
func- function- Returns:
- sequence types or
null
-
similarError
Throws an exception if the name of a function is similar to the specified function name.- Parameters:
qname- function nameii- input info- Returns:
- exception
-
funcs
Returns all user-defined functions.- Returns:
- functions
-
plan
Description copied from class:ExprInfoCreates a query plan. -
plan
Description copied from class:ExprInfoCreates a query string.
-