org.jboss.byteman.rule.expression
Class AssignableExpression
java.lang.Object
org.jboss.byteman.rule.RuleElement
org.jboss.byteman.rule.expression.Expression
org.jboss.byteman.rule.expression.AssignableExpression
- Direct Known Subclasses:
- ArrayExpression, DollarExpression, FieldExpression, StaticExpression, Variable
public abstract class AssignableExpression
- extends Expression
an expression which can appear on the left hand side of an assignment expression as well as in any
other expression context. assignable expressions provide extra methods which support assignment,
either interpreted or compiled, on top of the usual evaluation methods.
Method Summary |
abstract void |
bindAssign()
bind as an assignable expression. |
abstract void |
compileAssign(MethodVisitor mv,
CompileContext compileContext)
compile an assignment to the referenced location using the value on the top of the
Java stack. |
abstract java.lang.Object |
interpretAssign(HelperAdapter helperAdapter,
java.lang.Object value)
execute an assignment to the referenced location by interpretation of the expression,
using the object passed in this call |
Methods inherited from class org.jboss.byteman.rule.RuleElement |
compile, compileBooleanConversion, compileBox, compileNumericConversion, compileObjectConversion, compilePrimitiveConversion, compileStringConversion, compileTypeConversion, compileUnbox, getBindings, getTypeGroup, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AssignableExpression
protected AssignableExpression(Rule rule,
Type type,
ParseNode token)
- Create a new expression.
- Parameters:
type
- the current type for this expression.
interpretAssign
public abstract java.lang.Object interpretAssign(HelperAdapter helperAdapter,
java.lang.Object value)
throws ExecuteException
- execute an assignment to the referenced location by interpretation of the expression,
using the object passed in this call
- Parameters:
helperAdapter
- an execution context associated with the rule which contains a map of
current bindings for rule variables and another map of their declared types both of which
are indexed by variable name. This includes entries for the helper (name "-1"), the
recipient if the trigger method is not static (name "0") and the trigger method arguments
(names "1", ...)
- Returns:
- the result of evaluation as an Object
- Throws:
ExecuteException
compileAssign
public abstract void compileAssign(MethodVisitor mv,
CompileContext compileContext)
throws CompileException
- compile an assignment to the referenced location using the value on the top of the
Java stack.
- Parameters:
mv
- compileContext
-
- Throws:
CompileException
bindAssign
public abstract void bindAssign()
throws TypeException
- bind as an assignable expression. for variables and dollar expressions this will ensure that a binding exists
and that it is marked as potentially updateable.
- Throws:
TypeException