org.jboss.byteman.rule.binding
Class Binding

java.lang.Object
  extended by org.jboss.byteman.rule.RuleElement
      extended by org.jboss.byteman.rule.binding.Binding

public class Binding
extends RuleElement

Class used to store a binding of a named variable to a value of some given type


Field Summary
private  Binding alias
           
private static int BIND_VAR
           
private  int callArrayIndex
           
private  java.lang.String descriptor
           
private static int HELPER
           
private  int index
           
private static int INVOKE_PARAM_ARRAY_VAR
           
private static int LOCAL_VAR
           
private  int localIndex
           
private  java.lang.String name
           
private static int PARAM_ARRAY_VAR
           
private static int PARAM_COUNT_VAR
           
private static int RETURN_VAR
           
private static int THROWABLE_VAR
           
private  Type type
           
(package private)  boolean updated
           
private  Expression value
           
 
Fields inherited from class org.jboss.byteman.rule.RuleElement
rule
 
Constructor Summary
Binding(Rule rule, java.lang.String name)
           
Binding(Rule rule, java.lang.String name, Type type)
           
Binding(Rule rule, java.lang.String name, Type type, Expression value)
           
 
Method Summary
 void aliasTo(Binding alias)
           
 void compile(MethodVisitor mv, CompileContext compileContext)
           
 Binding getAlias()
           
 int getCallArrayIndex()
           
 java.lang.String getDescriptor()
           
 int getIndex()
           
 int getLocalIndex()
           
 java.lang.String getName()
           
 Type getType()
           
 Expression getValue()
           
 java.lang.Object interpret(HelperAdapter helper)
           
 boolean isAlias()
           
 boolean isBindVar()
           
 boolean isHelper()
           
 boolean isInvokeParamArray()
           
 boolean isLocalVar()
           
 boolean isParam()
           
 boolean isParamArray()
           
 boolean isParamCount()
           
 boolean isRecipient()
           
 boolean isReturn()
           
 boolean isThrowable()
           
 boolean isUpdated()
          record that this binding occurs on the LHS of an assignment
 void setCallArrayIndex(int callArrayIndex)
           
 void setDescriptor(java.lang.String desc)
           
 void setLocalIndex(int localIndex)
           
 void setType(Type type)
           
 void setUpdated()
          record that this binding occurs on the LHS of an assignment
 Expression setValue(Expression value)
           
 Type typeCheck(Type expected)
           
 void writeTo(java.io.StringWriter stringWriter)
           
 
Methods inherited from class org.jboss.byteman.rule.RuleElement
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
 

Field Detail

HELPER

private static final int HELPER
See Also:
Constant Field Values

BIND_VAR

private static final int BIND_VAR
See Also:
Constant Field Values

LOCAL_VAR

private static final int LOCAL_VAR
See Also:
Constant Field Values

RETURN_VAR

private static final int RETURN_VAR
See Also:
Constant Field Values

THROWABLE_VAR

private static final int THROWABLE_VAR
See Also:
Constant Field Values

PARAM_COUNT_VAR

private static final int PARAM_COUNT_VAR
See Also:
Constant Field Values

PARAM_ARRAY_VAR

private static final int PARAM_ARRAY_VAR
See Also:
Constant Field Values

INVOKE_PARAM_ARRAY_VAR

private static final int INVOKE_PARAM_ARRAY_VAR
See Also:
Constant Field Values

name

private java.lang.String name

descriptor

private java.lang.String descriptor

type

private Type type

value

private Expression value

index

private int index

callArrayIndex

private int callArrayIndex

localIndex

private int localIndex

alias

private Binding alias

updated

boolean updated
Constructor Detail

Binding

public Binding(Rule rule,
               java.lang.String name)

Binding

public Binding(Rule rule,
               java.lang.String name,
               Type type)

Binding

public Binding(Rule rule,
               java.lang.String name,
               Type type,
               Expression value)
Method Detail

typeCheck

public Type typeCheck(Type expected)
               throws TypeException
Specified by:
typeCheck in class RuleElement
Throws:
TypeException

interpret

public java.lang.Object interpret(HelperAdapter helper)
                           throws ExecuteException
Specified by:
interpret in class RuleElement
Throws:
ExecuteException

compile

public void compile(MethodVisitor mv,
                    CompileContext compileContext)
             throws CompileException
Specified by:
compile in class RuleElement
Throws:
CompileException

getName

public java.lang.String getName()

getValue

public Expression getValue()

setValue

public Expression setValue(Expression value)

getType

public Type getType()

setType

public void setType(Type type)

getCallArrayIndex

public int getCallArrayIndex()

setCallArrayIndex

public void setCallArrayIndex(int callArrayIndex)

getLocalIndex

public int getLocalIndex()

setLocalIndex

public void setLocalIndex(int localIndex)

isParam

public boolean isParam()

isRecipient

public boolean isRecipient()

isHelper

public boolean isHelper()

isBindVar

public boolean isBindVar()

isLocalVar

public boolean isLocalVar()

isReturn

public boolean isReturn()

isThrowable

public boolean isThrowable()

isParamCount

public boolean isParamCount()

isParamArray

public boolean isParamArray()

isInvokeParamArray

public boolean isInvokeParamArray()

getIndex

public int getIndex()

getDescriptor

public java.lang.String getDescriptor()

setDescriptor

public void setDescriptor(java.lang.String desc)

setUpdated

public void setUpdated()
record that this binding occurs on the LHS of an assignment


isUpdated

public boolean isUpdated()
record that this binding occurs on the LHS of an assignment


writeTo

public void writeTo(java.io.StringWriter stringWriter)
Specified by:
writeTo in class RuleElement

aliasTo

public void aliasTo(Binding alias)

isAlias

public boolean isAlias()

getAlias

public Binding getAlias()