TechTrader Bytecode Toolkit

com.techtrader.modules.tools.bytecode
Class ClassConstantInstruction

java.lang.Object
  |
  +--com.techtrader.modules.tools.bytecode.ClassConstantInstruction

public class ClassConstantInstruction
extends Object

Pseudo-instruction used to place Class types onto the stack. This logical instruction may actually involve a large chunk of code, and may even add static synthetic fields and methods to the owning class. Therefore, once the type of Class being loaded is set, it cannot be chanced. Also, this instruction is invalid as the target of any jump instruction or exception handler.

Author:
Abe White

Constructor Summary
protected ClassConstantInstruction(BCClass bc, Code code, Instruction nop)
          Protected constructor.
 
Method Summary
 Instruction setClassName(String name)
          Set the type of class being loaded.
 Instruction setClassType(Class type)
          Set the type of class being loaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassConstantInstruction

protected ClassConstantInstruction(BCClass bc,
                                   Code code,
                                   Instruction nop)
Protected constructor.
Method Detail

setClassType

public Instruction setClassType(Class type)
Set the type of class being loaded.
Returns:
the first Instruction of the block added by setting the type
Throws:
IllegalStateException - if type has already been set

setClassName

public Instruction setClassName(String name)
Set the type of class being loaded.
Returns:
the first Instruction of the block added by setting the type
Throws:
IllegalStateException - if type has already been set

TechTrader Bytecode Toolkit