polyglot.types.reflect
Class Method
java.lang.Object
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
Constructor Summary |
Method(java.io.DataInputStream in,
ClassFile clazz)
Constructor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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.
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)