harpoon.IR.RawClass
Class MethodInfo

java.lang.Object
  extended by harpoon.IR.RawClass.MethodInfo

public class MethodInfo
extends Object

Each method, and each instance initialization method <init>, is described by a variable-length method_info structure.

Version:
$Id: MethodInfo.java,v 1.2 2002/02/25 21:05:27 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
"The Java Virtual Machine Specification, section 4.6", ClassFile, HMethod

Field Summary
 AccessFlags access_flags
          Access permissions and properties of the method.
 Attribute[] attributes
          A method can have any number of optional attributes associated with it.
 int descriptor_index
          The value of the descriptor_index item must be a valid index into the constant_pool table.
 int name_index
          The value of the name_index item must be a valid index into the constant_pool table.
protected  ClassFile parent
          ClassFile in which this method information is found.
 
Constructor Summary
MethodInfo(ClassFile parent, AccessFlags access_flags, int name_index, int descriptor_index, Attribute[] attributes)
          Constructor.
 
Method Summary
 ConstantUtf8 descriptor_index()
           
 String descriptor()
           
 ConstantUtf8 name_index()
           
 String name()
           
 void print(PrintWriter pw, int indent)
          Pretty-print this method_info structure.
 void read(ClassFile p, ClassDataInputStream in)
          Read a single MethodInfo item from an input class bytecode file.
 void write(ClassDataOutputStream out)
          Writes a MethodInfo item out to a class bytecode file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected ClassFile parent
ClassFile in which this method information is found.


access_flags

public AccessFlags access_flags
Access permissions and properties of the method.


name_index

public int name_index
The value of the name_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Utf8_info structure representing either one of the special internal method names, either <init> or <clint>, or a valid Java method name, stored as a simple (not fully qualified) name.


descriptor_index

public int descriptor_index
The value of the descriptor_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Utf8_info structure representing a valid Java method descriptor.


attributes

public Attribute[] attributes
A method can have any number of optional attributes associated with it.

The only attributes defined by this specification for the attributes table of a method_info structure are the Code and Exceptions attributes.

Constructor Detail

MethodInfo

public MethodInfo(ClassFile parent,
                  AccessFlags access_flags,
                  int name_index,
                  int descriptor_index,
                  Attribute[] attributes)
Constructor.

Method Detail

read

public void read(ClassFile p,
                 ClassDataInputStream in)
          throws IOException
Read a single MethodInfo item from an input class bytecode file.

Throws:
IOException

write

public void write(ClassDataOutputStream out)
           throws IOException
Writes a MethodInfo item out to a class bytecode file.

Throws:
IOException

name_index

public ConstantUtf8 name_index()

descriptor_index

public ConstantUtf8 descriptor_index()

name

public String name()

descriptor

public String descriptor()

print

public void print(PrintWriter pw,
                  int indent)
Pretty-print this method_info structure.