Package org.basex.http.restxq
Class RestXqFunction
java.lang.Object
org.basex.http.web.WebFunction
org.basex.http.restxq.RestXqFunction
- All Implemented Interfaces:
Comparable<WebFunction>
This class represents a single RESTXQ function.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
FieldsModifier and TypeFieldDescriptionorg.basex.http.restxq.RestXqPathPath (can benull).Returned media types.Fields inherited from class org.basex.http.web.WebFunction
function, headerParams, module, output -
Constructor Summary
ConstructorsConstructorDescriptionRestXqFunction(StaticFunc function, QueryContext qc, WebModule module) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(Expr[] args, Object ext, HTTPConnection conn, QueryContext qc) Binds the annotated variables.intcompareTo(WebFunction func) consumedType(MediaType type) Returns the most specific consume type for the specified type.Creates an exception with the specified message.booleanmatches(HTTPConnection conn, QNm err, boolean perm) Checks if an HTTP request matches this function and its constraints.booleanChecks a function for REST and permission annotations.toString()Methods inherited from class org.basex.http.web.WebFunction
bind, checkParsed, checkVariable, checkVariable, toString
-
Field Details
-
produces
Returned media types. -
path
public org.basex.http.restxq.RestXqPath pathPath (can benull).
-
-
Constructor Details
-
RestXqFunction
Constructor.- Parameters:
function- associated user functionqc- query contextmodule- web module
-
-
Method Details
-
parse
Description copied from class:WebFunctionChecks 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.- Specified by:
parsein classWebFunction- Parameters:
ctx- database context- Returns:
trueif function contains relevant annotations- Throws:
QueryException- query exceptionIOException- I/O exception
-
bind
public void bind(Expr[] args, Object ext, HTTPConnection conn, QueryContext qc) throws QueryException, IOException Binds the annotated variables.- Parameters:
args- argumentsext- extended processing information (can benull)conn- HTTP connectionqc- query context- Throws:
QueryException- exceptionIOException- I/O exception
-
matches
Checks if an HTTP request matches this function and its constraints.- Parameters:
conn- HTTP connectionerr- error code (assigned if error function is to be called)perm- permission flag- Returns:
- result of check
-
consumedType
Returns the most specific consume type for the specified type.- Parameters:
type- media type- Returns:
- most specific type
-
error
Description copied from class:WebFunctionCreates an exception with the specified message.- Specified by:
errorin classWebFunction- Parameters:
msg- messageext- error extension- Returns:
- exception
-
compareTo
-
toString
- Overrides:
toStringin classWebFunction
-