mjc

org.multijava.dis
Class InstructionHandle

java.lang.Object
  extended byorg.multijava.util.classfile.AbstractInstructionAccessor
      extended byorg.multijava.dis.InstructionHandle
All Implemented Interfaces:
InstructionAccessor

public class InstructionHandle
extends AbstractInstructionAccessor


Field Summary
private  int address
           
private  Instruction instruction
           
private  boolean isTarget
           
private  ArrayList lineNumbers
           
 
Constructor Summary
InstructionHandle(Instruction instruction, int address)
          Creates a new instruction handle.
 
Method Summary
 void attachTo(AccessorContainer container)
          Notifies this handle that is has been attached to the specified container.
 String getLabel()
          Returns an identifier for the instruction address.
private  void printClassRef(IndentingWriter out, ClassConstant ref)
          Prints a ClassConstant.
private  void printFieldRef(IndentingWriter out, FieldRefConstant ref)
           
private  void printFieldSignature(IndentingWriter out, String signature)
           
private  void printInstructionHandle(IndentingWriter out, InstructionHandle handle)
           
private  void printInterfaceRef(IndentingWriter out, InterfaceConstant ref)
           
private  void printMethodRef(IndentingWriter out, MethodRefConstant ref)
           
private  void printMethodSpec(IndentingWriter out, String name, String signature)
           
private  void printQualifiedName(IndentingWriter out, String ident)
           
 void write(IndentingWriter out, boolean optionShowStack)
          Prints a byte code instruction
private  void writeClassRefInstruction(IndentingWriter out, ClassRefInstruction insn)
          Prints a ClassRefInstruction.
private  void writeFieldRefInstruction(IndentingWriter out, FieldRefInstruction insn)
          Prints a FieldRefInstruction.
private  void writeIincInstruction(IndentingWriter out, IincInstruction insn)
          Prints a IincInstruction.
private  void writeInstruction(IndentingWriter out, Instruction insn)
          Prints an instruction (dispatches to instruction types).
private  void writeInvokeinterfaceInstruction(IndentingWriter out, InvokeinterfaceInstruction insn)
          Prints a InvokeinterfaceInstruction.
private  void writeJumpInstruction(IndentingWriter out, JumpInstruction insn)
          Prints a JumpInstruction.
private  void writeLocalVarInstruction(IndentingWriter out, LocalVarInstruction insn)
          Prints a LocalVarInstruction.
private  void writeMethodRefInstruction(IndentingWriter out, MethodRefInstruction insn)
          Prints a MethodRefInstruction.
private  void writeMultiarrayInstruction(IndentingWriter out, MultiarrayInstruction insn)
          Prints a MultiarrayInstruction.
private  void writeNewarrayInstruction(IndentingWriter out, NewarrayInstruction insn)
          Prints a NewarrayInstruction.
private  void writeNoArgInstruction(IndentingWriter out, NoArgInstruction insn)
          Prints a NoArgInstruction.
private  void writeOpcode(IndentingWriter out, int opcode)
          Prints the opcode.
private  void writeOpcode(IndentingWriter out, String opcode)
          Prints the opcode.
private  void writePushLiteralInstruction(IndentingWriter out, PushLiteralInstruction insn)
          Prints a PushLiteralInstruction.
private  void writeSwitchInstruction(IndentingWriter out, SwitchInstruction insn)
          Prints a SwitchInstruction.
 
Methods inherited from class org.multijava.util.classfile.AbstractInstructionAccessor
transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instruction

private final Instruction instruction

address

private final int address

lineNumbers

private ArrayList lineNumbers

isTarget

private boolean isTarget
Constructor Detail

InstructionHandle

public InstructionHandle(Instruction instruction,
                         int address)
Creates a new instruction handle.

Parameters:
instruction - the instruction
address - the address of the instruction
Method Detail

attachTo

public void attachTo(AccessorContainer container)
Notifies this handle that is has been attached to the specified container.


getLabel

public String getLabel()
Returns an identifier for the instruction address.


write

public void write(IndentingWriter out,
                  boolean optionShowStack)
Prints a byte code instruction


writeInstruction

private void writeInstruction(IndentingWriter out,
                              Instruction insn)
Prints an instruction (dispatches to instruction types).


writeOpcode

private void writeOpcode(IndentingWriter out,
                         String opcode)
Prints the opcode.


writeOpcode

private void writeOpcode(IndentingWriter out,
                         int opcode)
Prints the opcode.


writeClassRefInstruction

private void writeClassRefInstruction(IndentingWriter out,
                                      ClassRefInstruction insn)
Prints a ClassRefInstruction.


writeFieldRefInstruction

private void writeFieldRefInstruction(IndentingWriter out,
                                      FieldRefInstruction insn)
Prints a FieldRefInstruction.


writeIincInstruction

private void writeIincInstruction(IndentingWriter out,
                                  IincInstruction insn)
Prints a IincInstruction.


writeInvokeinterfaceInstruction

private void writeInvokeinterfaceInstruction(IndentingWriter out,
                                             InvokeinterfaceInstruction insn)
Prints a InvokeinterfaceInstruction.


writeJumpInstruction

private void writeJumpInstruction(IndentingWriter out,
                                  JumpInstruction insn)
Prints a JumpInstruction.


writeLocalVarInstruction

private void writeLocalVarInstruction(IndentingWriter out,
                                      LocalVarInstruction insn)
Prints a LocalVarInstruction.


writeMethodRefInstruction

private void writeMethodRefInstruction(IndentingWriter out,
                                       MethodRefInstruction insn)
Prints a MethodRefInstruction.


writeMultiarrayInstruction

private void writeMultiarrayInstruction(IndentingWriter out,
                                        MultiarrayInstruction insn)
Prints a MultiarrayInstruction.


writeNewarrayInstruction

private void writeNewarrayInstruction(IndentingWriter out,
                                      NewarrayInstruction insn)
Prints a NewarrayInstruction.


writeNoArgInstruction

private void writeNoArgInstruction(IndentingWriter out,
                                   NoArgInstruction insn)
Prints a NoArgInstruction.


writePushLiteralInstruction

private void writePushLiteralInstruction(IndentingWriter out,
                                         PushLiteralInstruction insn)
Prints a PushLiteralInstruction.


writeSwitchInstruction

private void writeSwitchInstruction(IndentingWriter out,
                                    SwitchInstruction insn)
Prints a SwitchInstruction.


printClassRef

private void printClassRef(IndentingWriter out,
                           ClassConstant ref)
Prints a ClassConstant.


printFieldRef

private void printFieldRef(IndentingWriter out,
                           FieldRefConstant ref)

printInterfaceRef

private void printInterfaceRef(IndentingWriter out,
                               InterfaceConstant ref)

printMethodRef

private void printMethodRef(IndentingWriter out,
                            MethodRefConstant ref)

printMethodSpec

private void printMethodSpec(IndentingWriter out,
                             String name,
                             String signature)

printFieldSignature

private void printFieldSignature(IndentingWriter out,
                                 String signature)

printQualifiedName

private void printQualifiedName(IndentingWriter out,
                                String ident)

printInstructionHandle

private void printInstructionHandle(IndentingWriter out,
                                    InstructionHandle handle)

mjc

mjc is Copyright (C) 2000-2004 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. mjc is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.