sysModel.classFile
Class MethodInfo

java.lang.Object
  extended by sysModel.classFile.MethodInfo

public final class MethodInfo
extends java.lang.Object

Represents a method in a class file.

Author:
Mathias Ricken

Field Summary
private  short _accessFlags
          Method access flags.
private  java.util.ArrayList<AAttributeInfo> _attributes
          Attributes.
private  AUTFPoolInfo _descriptor
          Type descriptor information.
private  AUTFPoolInfo _name
          Name information.
 
Constructor Summary
MethodInfo(java.io.DataInputStream di, ConstantPool pool)
          Constructor.
MethodInfo(short accessFlags, AUTFPoolInfo name, AUTFPoolInfo signature, AAttributeInfo[] attributes)
          Constructor.
 
Method Summary
 short getAccessFlags()
          Accessor for access flags.
 java.util.ArrayList<AAttributeInfo> getAttributes()
          Accessor for attributes.
 CodeAttributeInfo getCodeAttributeInfo()
          Return this method's code attribute info.
 AUTFPoolInfo getDescriptor()
          Accessor for descriptor.
 AUTFPoolInfo getName()
          Accessor for field name.
 void setAccessFlags(short accessFlags)
          Mutator for access flags.
 void setDescriptor(AUTFPoolInfo descriptor)
          Mutator for descriptor.
 void setName(AUTFPoolInfo name)
          Mutator for field name.
 java.lang.String toString()
          Return a human-readable version of this method.
 java.lang.String toString(ConstantPool pool)
          Return a human-readable version of this method.
 java.lang.String toString(ConstantPool pool, boolean lineNumbers, boolean PCs)
          Return a human-readable version of this method.
 void write(java.io.DataOutputStream dos, ConstantPool pool)
          Write this method into the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_accessFlags

private short _accessFlags
Method access flags.


_name

private AUTFPoolInfo _name
Name information.


_descriptor

private AUTFPoolInfo _descriptor
Type descriptor information.


_attributes

private java.util.ArrayList<AAttributeInfo> _attributes
Attributes.

Constructor Detail

MethodInfo

public MethodInfo(short accessFlags,
                  AUTFPoolInfo name,
                  AUTFPoolInfo signature,
                  AAttributeInfo[] attributes)
Constructor.

Parameters:
accessFlags - method access flags
name - method name
signature - method descriptor
attributes - array of attributes

MethodInfo

public MethodInfo(java.io.DataInputStream di,
                  ConstantPool pool)
           throws java.io.IOException,
                  java.lang.ClassFormatError
Constructor.

Parameters:
di - input stream
pool - constant pool
Throws:
java.io.IOException
java.lang.ClassFormatError
Method Detail

write

public void write(java.io.DataOutputStream dos,
                  ConstantPool pool)
           throws java.io.IOException
Write this method into the stream.

Parameters:
dos - output stream
pool - constant pool
Throws:
java.io.IOException

toString

public java.lang.String toString()
Return a human-readable version of this method.

Overrides:
toString in class java.lang.Object
Returns:
string

toString

public java.lang.String toString(ConstantPool pool)
Return a human-readable version of this method.

Parameters:
pool - constant pool
Returns:
string

toString

public java.lang.String toString(ConstantPool pool,
                                 boolean lineNumbers,
                                 boolean PCs)
Return a human-readable version of this method.

Parameters:
pool - constant pool
lineNumbers - print line numbers
PCs - print PC values
Returns:
string

getAccessFlags

public short getAccessFlags()
Accessor for access flags.

Returns:
access flags

setAccessFlags

public void setAccessFlags(short accessFlags)
Mutator for access flags.

Parameters:
accessFlags - new access flags

getName

public AUTFPoolInfo getName()
Accessor for field name.

Returns:
field name

setName

public void setName(AUTFPoolInfo name)
Mutator for field name.

Parameters:
name - new field name

getDescriptor

public AUTFPoolInfo getDescriptor()
Accessor for descriptor.

Returns:
descriptor

setDescriptor

public void setDescriptor(AUTFPoolInfo descriptor)
Mutator for descriptor.

Parameters:
descriptor - new descriptor

getAttributes

public java.util.ArrayList<AAttributeInfo> getAttributes()
Accessor for attributes.

Returns:
attributes

getCodeAttributeInfo

public CodeAttributeInfo getCodeAttributeInfo()
Return this method's code attribute info.

Returns:
code attribute info