Package org.basex.http.web
Class WebFunction
java.lang.Object
org.basex.http.web.WebFunction
- All Implemented Interfaces:
Comparable<WebFunction>
- Direct Known Subclasses:
RestXqFunction,WsFunction
This abstract class defines common methods of Web functions.
- Author:
- BaseX Team 2005-21, BSD License, Johannes Finckh
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StaticFuncAssociated function.Header Parameters.final WebModuleWeb module.final SerializerOptionsSerialization parameters. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWebFunction(StaticFunc function, WebModule module, QueryContext qc) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidBinds the specified value to a variable.protected final booleancheckParsed(boolean found, AnnList list, boolean[] declared) Checks parsed meta data.protected final QNmcheckVariable(String tmp, boolean... declared) Checks the specified template and adds a variable.protected final QNmcheckVariable(QNm name, boolean[] declared) Checks if the specified variable exists in the current function.protected abstract QueryExceptionCreates an exception with the specified message.abstract booleanChecks a function for REST and permission annotations.toString()protected static StringReturns the specified item as a string.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
function
Associated function. -
output
Serialization parameters. -
module
Web module. -
headerParams
Header Parameters.
-
-
Constructor Details
-
WebFunction
Constructor.- Parameters:
function- associated user functionqc- query contextmodule- web module
-
-
Method Details
-
parse
Checks a function for REST and permission annotations. This function is called both when a module is parsed, and when the function is prepared for evaluation.- Parameters:
ctx- database context- Returns:
trueif function contains relevant annotations- Throws:
QueryException- query exceptionIOException- I/O exception
-
error
Creates an exception with the specified message.- Parameters:
msg- messageext- error extension- Returns:
- exception
-
checkVariable
Checks the specified template and adds a variable.- Parameters:
tmp- template stringdeclared- variable declaration flags- Returns:
- resulting variable
- Throws:
QueryException- query exception
-
checkParsed
protected final boolean checkParsed(boolean found, AnnList list, boolean[] declared) throws QueryException Checks parsed meta data.- Parameters:
found- found flaglist- list of annotationsdeclared- declared parameters- Returns:
- found flag
- Throws:
QueryException- query exception
-
checkVariable
Checks if the specified variable exists in the current function.- Parameters:
name- variabledeclared- variable declaration flags- Returns:
- resulting variable
- Throws:
QueryException- query exception
-
bind
protected final void bind(QNm name, Expr[] args, Value value, QueryContext qc, String info) throws QueryException Binds the specified value to a variable.- Parameters:
name- variable nameargs- argumentsvalue- value to be boundqc- query contextinfo- info string- Throws:
QueryException- query exception
-
toString
Returns the specified item as a string.- Parameters:
item- item- Returns:
- string
-
toString
-