| java.lang.Object org.josql.expressions.Expression org.josql.expressions.ValueExpression org.josql.expressions.Function
Function | public class Function extends ValueExpression (Code) | | This class represents a Function that can be "called" in JoSQL.
|
evaluate | public Object evaluate(Object o, Query q) throws QueryExecutionException(Code) | | Evaluate this function on the current object. It should be noted that not
all functions will use the current object in their execution, functions from the
org.josql.functions.GroupingFunctions class are notable exceptions.
Parameters: o - The current object. Parameters: q - The Query object. The result of evaluating the function. throws: QueryExecutionException - If something goes wrong during execution of thefunction or gaining the values to be used as arguments. |
getExpectedReturnType | public Class getExpectedReturnType(Query q)(Code) | | Get the expected return type from the function. The exact class returned is
dependent upon the function (Java method) that is being called.
Parameters: q - The Query object. The class of the expected return type. |
getGetter | public Getter getGetter()(Code) | | |
getParameters | public List getParameters()(Code) | | Return the List of
Expression objects that constitute the arguments
to the function, no guarantee is made here as to whether they have been inited.
The List of Expression objects. |
hasFixedResult | public boolean hasFixedResult(Query q)(Code) | | Return whether the function will return a fixed result, this only
occurs iff all the arguments to the function also return a fixed result.
Parameters: q - The Query object. |
init | public void init(Query q) throws QueryParseException(Code) | | This is a complex method that will initialise the function.
Firstly all of the "arguments" to the function are inited and then
their expected return types gained from calling:
Function.getExpectedReturnType(Query) .
Then the function handlers, user-defined and then built-in are searched until they
find a match for the function name, ensure that it's a public method and that all the
arguments match, widening the match where necessary.
Parameters: q - The Query object. throws: QueryParseException - If something goes wrong whilst initing the arguments to the function or if the function cannot be found. |
setParameters | public void setParameters(List ps)(Code) | | |
toString | public String toString()(Code) | | Return a string representation of the function.
In the form: Name (
Expression [ ,
Expression ] )
A string representation of the function. |
|
|