polyglot.types.reflect
Class Method

java.lang.Object
  extended by polyglot.types.reflect.Method

public class Method
extends java.lang.Object

Method represents a method in a Java classfile. A method's name and value (the types of its parameters and its return type) are modeled as indices into it class's constant pool. A method has modifiers that determine whether it is public, private, static, final, etc. Methods have a number of attributes such as their Code and any Exceptions they may throw.

Author:
Nate Nystrom (nystrom@cs.purdue.edu)
See Also:
Code, Exceptions

Field Summary
protected  Attribute[] attrs
           
protected  ClassFile clazz
           
protected  Exceptions exceptions
           
protected  java.io.DataInputStream in
           
protected  int modifiers
           
protected  int name
           
protected  boolean synthetic
           
protected  int type
           
 
Constructor Summary
Method(java.io.DataInputStream in, ClassFile clazz)
          Constructor.
 
Method Summary
 ConstructorInstance constructorInstance(TypeSystem ts, ClassType ct, Field[] fields)
           
 void initialize()
           
 MethodInstance methodInstance(TypeSystem ts, ClassType ct)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clazz

protected ClassFile clazz

in

protected java.io.DataInputStream in

modifiers

protected int modifiers

name

protected int name

type

protected int type

attrs

protected Attribute[] attrs

exceptions

protected Exceptions exceptions

synthetic

protected boolean synthetic
Constructor Detail

Method

public Method(java.io.DataInputStream in,
              ClassFile clazz)
Constructor. Read a method from a class file.

Parameters:
in - The data stream of the class file.
clazz - The class file containing the method.
Throws:
java.io.IOException - If an error occurs while reading.
Method Detail

initialize

public void initialize()
                throws java.io.IOException
Throws:
java.io.IOException

methodInstance

public MethodInstance methodInstance(TypeSystem ts,
                                     ClassType ct)

constructorInstance

public ConstructorInstance constructorInstance(TypeSystem ts,
                                               ClassType ct,
                                               Field[] fields)