public interface ValueExp
Modifier and Type | Method and Description |
---|---|
boolean |
containsAssignment()
Returns whether the expression contains any assignments (= or ++ or --).
|
Object |
evaluate(Context context)
Evaluates the expression.
|
boolean |
isLookupMembers()
Returns whether
evaluate() will return an object that
explicitly shows the values of all members of the expression. |
Object evaluate(Context context) throws NumberFormatException, NoSuchVariableException, PlayerFaultException, PlayerDebugException
context
- the context in which the expression should be evaluated;
primarily used for looking up variables. For example, when
evaluating the expression "myvar", the context looks at
locals, members of "this", etc.; when evaluating "myfield"
node of the expression "myvar.myfield", the context looks at
members of the variable "myvar".NumberFormatException
NoSuchVariableException
PlayerFaultException
PlayerDebugException
Context.lookup(Object)
boolean containsAssignment()
boolean isLookupMembers()
evaluate()
will return an object that
explicitly shows the values of all members of the expression. For
example, in fdb, if the user writes "print myvar", then isLookupMembers
will be false, and the debugger will show just the value of
myvar
, but not the values of its members; but if the user
writes "print myvar." (with a "." at the end), then the debugger will
show the values of all of the members of myvar
.Copyright © 2016 The Apache Software Foundation. All rights reserved.