public class NewObjectExpression extends ValueExpression
| 构造器和说明 |
|---|
NewObjectExpression() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addIntoExpression(Expression exp,
String setter) |
Object |
evaluate(Object o,
Query q) |
Class |
getExpectedReturnType(Query q)
Return the class of the object that "should" be returned from a call to the:
Expression.getValue(Object,Query) method. |
Object |
getValue(Object o,
Query q)
Get the value for this expression based upon the object passed in.
|
boolean |
hasFixedResult(Query q)
Return whether the expression will evaluate to a fixed/constant result.
|
void |
init(Query q)
Perform the necessary initialisation for this expression.
|
boolean |
isTrue(Object o,
Query q)
Always return
true because a new object is being created and thus
will be unequal to null. |
void |
setClassName(String c) |
void |
setConstructorArgs(List exps) |
String |
toString()
Return a string representation of the expression, making this abstract forces
sub-classes to provide an implementation.
|
isBracketed, setBracketedpublic void addIntoExpression(Expression exp, String setter)
public void setConstructorArgs(List exps)
public void setClassName(String c)
public boolean hasFixedResult(Query q)
ExpressionExpression.isTrue(Object,Query) or Expression.getValue(Object,Query)
methods will return the same object (or that o1.equals (o2) == true)
regardless of the object passed to the method.hasFixedResult 在类中 Expressionq - The Query object.true if the expression evaluates to a fixed/constant result.public Class getExpectedReturnType(Query q) throws QueryParseException
ExpressionExpression.getValue(Object,Query) method. It may be that repeated executions
of a query will return different classes from this method. In general
sub-classes should take this variance into account.getExpectedReturnType 在类中 Expressionq - The Query object.Expression.getValue(Object,Query)
method.QueryParseException - If something goes wrong with determining the type.public void init(Query q) throws QueryParseException
Expressioninit 在类中 Expressionq - The Query object.QueryParseException - If something goes wrong with the initialisation.public boolean isTrue(Object o, Query q)
true because a new object is being created and thus
will be unequal to null.isTrue 在类中 Expressiono - The object currently in "scope".q - The Query object.true always.public Object evaluate(Object o, Query q) throws QueryExecutionException
evaluate 在类中 ValueExpressionQueryExecutionExceptionpublic Object getValue(Object o, Query q) throws QueryExecutionException
ExpressiongetValue 在类中 ValueExpressiono - The current object that the expression should be evaluated on.q - The Query object.QueryExecutionException - If something goes wrong with gaining the value.public String toString()
ExpressiontoString 在类中 ExpressionCopyright © 2021. All rights reserved.