|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExpressionFactory
The ExpressionFactory must be implemented by a particular runtime
to form Expression
s in its native query language.
Method Summary | |
---|---|
Value |
abs(Value num)
Return a value representing the absolute value of the given one. |
Value |
add(Value num1,
Value num2)
Return a value representing the two values added together. |
Value |
all(Value target)
Return an expression representing the given condition. |
Expression |
and(Expression exp1,
Expression exp2)
Return the two expressions AND'd together. |
Value |
any(Value target)
Return an expression representing the given condition. |
Expression |
asExpression(Value bool)
Return the given value as an expression. |
Value |
avg(Value num)
Return the average of the given value for all matches. |
Expression |
bindKeyVariable(Value var,
Value map)
Bind the given variable to the key set of the given map value. |
Expression |
bindValueVariable(Value var,
Value map)
Bind the given variable to the value set of the given map value. |
Expression |
bindVariable(Value var,
Value coll)
Bind the given variable to the given collection value. |
Value |
cast(Value obj,
Class cls)
Cast the value to the given class. |
Value |
concat(Value str,
Value args)
Return a value representing the concatenation of the given target with the given args. |
Expression |
contains(Value coll,
Value arg)
Return an expression representing the given condition. |
Expression |
containsKey(Value map,
Value arg)
Return an expression representing the given condition. |
Expression |
containsValue(Value map,
Value arg)
Return an expression representing the given condition. |
Value |
count(Value obj)
Return the count of the given value for all matches. |
Value |
distinct(Value obj)
Return distinct values of the given value. |
Value |
divide(Value num1,
Value num2)
Return a value representing the first value divided by the first one. |
Expression |
emptyExpression()
Return a blank expression; this is used when the filter is empty. |
Expression |
endsWith(Value str1,
Value str2)
Return whether the first string ends with the second. |
Expression |
equal(Value v1,
Value v2)
Return an expression representing the given condition. |
Value |
getCurrentDate()
Return a value representing the current date. |
Value |
getCurrentTime()
Return a value representing the current time. |
Value |
getCurrentTimestamp()
Return a value representing the current timestamp. |
Value |
getMapValue(Value map,
Value arg)
Return an expression representing the given condition. |
Value |
getNull()
Return a value representing null. |
Value |
getObjectId(Value val)
Return the object id of the given value. |
Value |
getThis()
Return a value representing this . |
Expression |
greaterThan(Value v1,
Value v2)
Return an expression representing the given condition. |
Expression |
greaterThanEqual(Value v1,
Value v2)
Return an expression representing the given condition. |
Value |
indexOf(Value str,
Value args)
Return a value representing the String.indexOf(int) function on
the given target with the given args. |
Expression |
isEmpty(Value target)
Return an expression representing the given condition. |
Expression |
isInstance(Value obj,
Class c)
Return whether the first value is an instance of the given class. |
Expression |
isNotEmpty(Value target)
Return an expression representing the given condition. |
Expression |
lessThan(Value v1,
Value v2)
Return an expression representing the given condition. |
Expression |
lessThanEqual(Value v1,
Value v2)
Return an expression representing the given condition. |
Expression |
matches(Value str,
Value regexp,
String single,
String multi,
String escape)
Return whether the string matches the matching pattern. |
Value |
max(Value num)
Return the max of the given value for all matches. |
Value |
min(Value num)
Return the max of the given value for all matches. |
Value |
mod(Value num1,
Value num2)
Return a value representing the first value mod'd by the second one. |
Value |
multiply(Value num1,
Value num2)
Return a value representing the two values multiplied together. |
Value |
newAggregate(AggregateListener listener,
Value args)
Return the value of the given function. |
Arguments |
newArgumentList(Value arg1,
Value arg2)
Return a function argument list consisting of the given values, either of which may itself be an argument list. |
Value |
newBoundVariable(String name,
Class type)
This method will be called only once per variable bound in a contains clause, and the returned value will be reused
for any further instances of the variable in subexpression of the
filter string. |
Value |
newExtension(FilterListener listener,
Value target,
Value args)
Return the value of the given extension. |
Literal |
newLiteral(Object val,
int parseType)
Return a value representing the given constant, which will be a Number , String , or Boolean instance. |
Parameter |
newParameter(String name,
Class type)
Return a value representing a parameter for the given value. |
Path |
newPath()
Return a value representing a path which will consist of a chain of 1 or more field names starting in the namespace of the candidate class. Example: parent.address.city |
Path |
newPath(Value val)
Return a value representing a path which will consist of a chain of 1 or more field names starting in the namespace of the given value. Example: var.address.city |
Subquery |
newSubquery(ClassMetaData candidate,
boolean subs,
String alias)
Return a subquery. |
Value |
newUnboundVariable(String name,
Class type)
Return an unbound variable. |
Expression |
not(Expression exp)
Return the inverse of this expression. |
Expression |
notEqual(Value v1,
Value v2)
Return an expression representing the given condition. |
Expression |
notMatches(Value str,
Value regexp,
String single,
String multi,
String escape)
Return whether the string does not match the given pattern. |
Expression |
or(Expression exp1,
Expression exp2)
Return the two expressions OR'd together. |
Value |
size(Value target)
Return an expression representing the given condition. |
Value |
sqrt(Value num)
Return the square root of the given value. |
Expression |
startsWith(Value str1,
Value str2)
Return whether the first string starts with the second. |
Value |
stringLength(Value str)
Returns the number of characters in the String value. |
Value |
substring(Value str,
Value args)
Return a value representing the String.substring(int) function on
the given target with the given args. |
Value |
subtract(Value num1,
Value num2)
Return a value representing the second value subtracted from the first. |
Value |
sum(Value num)
Return the max of the given value for all matches. |
Value |
toLowerCase(Value str)
Return the upper case of the given value. |
Value |
toUpperCase(Value str)
Return the upper case of the given value. |
Value |
trim(Value str,
Value trimChar,
Boolean where)
Trims the specified specified trimChar from the specified value. |
Method Detail |
---|
Expression emptyExpression()
Expression asExpression(Value bool)
Expression equal(Value v1, Value v2)
Expression notEqual(Value v1, Value v2)
Expression lessThan(Value v1, Value v2)
Expression greaterThan(Value v1, Value v2)
Expression lessThanEqual(Value v1, Value v2)
Expression greaterThanEqual(Value v1, Value v2)
Expression isEmpty(Value target)
Expression isNotEmpty(Value target)
Expression contains(Value coll, Value arg)
Expression containsKey(Value map, Value arg)
Expression containsValue(Value map, Value arg)
Value getMapValue(Value map, Value arg)
Expression isInstance(Value obj, Class c)
Expression and(Expression exp1, Expression exp2)
Expression or(Expression exp1, Expression exp2)
Expression not(Expression exp)
Expression bindVariable(Value var, Value coll)
Expression bindKeyVariable(Value var, Value map)
Expression bindValueVariable(Value var, Value map)
Expression endsWith(Value str1, Value str2)
Expression matches(Value str, Value regexp, String single, String multi, String escape)
str
- the value to compareregexp
- the pattern against which to comparesingle
- the token that signifies a single-character matchmulti
- the token that signifies a multi-character matchescape
- the escape token that escapes the matching tokensExpression notMatches(Value str, Value regexp, String single, String multi, String escape)
str
- the value to compareregexp
- the pattern against which to comparesingle
- the token that signifies a single-character matchmulti
- the token that signifies a multi-character matchescape
- the escape token that escapes the matching tokensExpression startsWith(Value str1, Value str2)
Value stringLength(Value str)
Value trim(Value str, Value trimChar, Boolean where)
str
- the value from which to trimtrimChar
- the characters to trim offwhere
- which side of the String to trim: null
indicates both sides, true indicates
leading, and false indicates trailingSubquery newSubquery(ClassMetaData candidate, boolean subs, String alias)
newPath(Value)
, passing in the subquery as the
value.
candidate
- the candidate class of the subquerysubs
- whether the query includes subclassesalias
- the alias given to the query candidate classPath newPath()
parent.address.city
Path newPath(Value val)
var.address.city
Literal newLiteral(Object val, int parseType)
Number
, String
, or Boolean
instance.
Value getThis()
this
.
Value getNull()
Value getCurrentDate()
Value getCurrentTime()
Value getCurrentTimestamp()
Parameter newParameter(String name, Class type)
Object
if the parameter is not declared.
Value newExtension(FilterListener listener, Value target, Value args)
Value newAggregate(AggregateListener listener, Value args)
Arguments newArgumentList(Value arg1, Value arg2)
Value newUnboundVariable(String name, Class type)
Object
if the variable is not declared.
Value newBoundVariable(String name, Class type)
contains
clause, and the returned value will be reused
for any further instances of the variable in subexpression of the
filter string. The type may be Object
if the variable is
not declared.
Value cast(Value obj, Class cls)
Value add(Value num1, Value num2)
Value subtract(Value num1, Value num2)
Value multiply(Value num1, Value num2)
Value divide(Value num1, Value num2)
Value mod(Value num1, Value num2)
Value abs(Value num)
Value indexOf(Value str, Value args)
String.indexOf(int)
function on
the given target with the given args.
Value concat(Value str, Value args)
Value sqrt(Value num)
Value substring(Value str, Value args)
String.substring(int)
function on
the given target with the given args.
Value toUpperCase(Value str)
Value toLowerCase(Value str)
Value avg(Value num)
Value count(Value obj)
Value max(Value num)
Value min(Value num)
Value sum(Value num)
Value any(Value target)
Value all(Value target)
Value size(Value target)
Value distinct(Value obj)
Value getObjectId(Value val)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |