org.jboss.byteman.rule
Class RuleElement

java.lang.Object
  extended by org.jboss.byteman.rule.RuleElement
Direct Known Subclasses:
Action, Binding, Condition, Event, Expression

public abstract class RuleElement
extends java.lang.Object

generic class implemented by rule events, conditions and actions which gives them access to the rule context and provides them with common behaviours


Field Summary
protected  Rule rule
           
 
Constructor Summary
protected RuleElement(Rule rule)
           
 
Method Summary
abstract  void compile(MethodVisitor mv, CompileContext compileContext)
           
protected  void compileBooleanConversion(Type fromType, Type toType, MethodVisitor mv, CompileContext compileContext)
           
protected  void compileBox(Type toType, MethodVisitor mv, CompileContext compileContext)
          box a value belonging to a primitive type
protected  void compileNumericConversion(Type fromType, Type toType, MethodVisitor mv, CompileContext compileContext)
           
protected  void compileObjectConversion(Type fromType, Type toType, MethodVisitor mv, CompileContext compileContext)
           
protected  void compilePrimitiveConversion(Type fromType, Type toType, MethodVisitor mv, CompileContext compileContext)
          compile code to convert a numeric or character primitive to a numeric or character primitive
protected  void compileStringConversion(Type fromType, Type toType, MethodVisitor mv, CompileContext compileContext)
           
protected  void compileTypeConversion(Type fromType, Type toType, MethodVisitor mv, CompileContext compileContext)
           
protected  void compileUnbox(Type fromType, Type toType, MethodVisitor mv, CompileContext compileContext)
          compile code to convert a value of a boxed type to a primitive type, possibly not the immediately related primitive type
protected  Bindings getBindings()
           
protected  TypeGroup getTypeGroup()
           
abstract  java.lang.Object interpret(HelperAdapter helper)
           
 java.lang.String toString()
           
abstract  Type typeCheck(Type expected)
           
abstract  void writeTo(java.io.StringWriter stringWriter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rule

protected Rule rule
Constructor Detail

RuleElement

protected RuleElement(Rule rule)
Method Detail

getTypeGroup

protected TypeGroup getTypeGroup()

getBindings

protected Bindings getBindings()

typeCheck

public abstract Type typeCheck(Type expected)
                        throws TypeException
Throws:
TypeException

interpret

public abstract java.lang.Object interpret(HelperAdapter helper)
                                    throws ExecuteException
Throws:
ExecuteException

compile

public abstract void compile(MethodVisitor mv,
                             CompileContext compileContext)
                      throws CompileException
Throws:
CompileException

compileTypeConversion

protected void compileTypeConversion(Type fromType,
                                     Type toType,
                                     MethodVisitor mv,
                                     CompileContext compileContext)
                              throws CompileException
Throws:
CompileException

compileNumericConversion

protected void compileNumericConversion(Type fromType,
                                        Type toType,
                                        MethodVisitor mv,
                                        CompileContext compileContext)
                                 throws CompileException
Throws:
CompileException

compileUnbox

protected void compileUnbox(Type fromType,
                            Type toType,
                            MethodVisitor mv,
                            CompileContext compileContext)
                     throws CompileException
compile code to convert a value of a boxed type to a primitive type, possibly not the immediately related primitive type

Parameters:
fromType -
toType -
mv -
compileContext -
Throws:
CompileException

compileBox

protected void compileBox(Type toType,
                          MethodVisitor mv,
                          CompileContext compileContext)
                   throws CompileException
box a value belonging to a primitive type

Parameters:
toType -
mv -
compileContext -
Throws:
CompileException

compileStringConversion

protected void compileStringConversion(Type fromType,
                                       Type toType,
                                       MethodVisitor mv,
                                       CompileContext compileContext)
                                throws CompileException
Throws:
CompileException

compilePrimitiveConversion

protected void compilePrimitiveConversion(Type fromType,
                                          Type toType,
                                          MethodVisitor mv,
                                          CompileContext compileContext)
                                   throws CompileException
compile code to convert a numeric or character primitive to a numeric or character primitive

Parameters:
fromType -
toType -
mv -
compileContext -
Throws:
CompileException

compileBooleanConversion

protected void compileBooleanConversion(Type fromType,
                                        Type toType,
                                        MethodVisitor mv,
                                        CompileContext compileContext)
                                 throws CompileException
Throws:
CompileException

compileObjectConversion

protected void compileObjectConversion(Type fromType,
                                       Type toType,
                                       MethodVisitor mv,
                                       CompileContext compileContext)
                                throws CompileException
Throws:
CompileException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

writeTo

public abstract void writeTo(java.io.StringWriter stringWriter)