|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jode.bytecode.BinaryInfo net.sf.jode.bytecode.MethodInfo
public final class MethodInfo
Represents a java bytecode method. A method consists of the following parts:
type signature
in bytecode format.type signature
in bytecode format including template information.Modifier.PUBLIC
,
Modifier.PRIVATE
, Modifier.PROTECTED
,
Modifier.STATIC
, Modifier.FINAL
,
Modifier.SYNCHRONIZED
, Modifier.NATIVE
,
Modifier.ABSTRACT
, Modifier.STRICT
of class Modifier
.
basic blocks
, null if it is native or
abstract.
TypeSignature
,
BasicBlocks
Field Summary |
---|
Fields inherited from class net.sf.jode.bytecode.BinaryInfo |
---|
ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VARARGS, ACC_VOLATILE |
Constructor Summary | |
---|---|
MethodInfo()
|
|
MethodInfo(String name,
String typeSig,
int modifier)
|
Method Summary | |
---|---|
int |
compareTo(Object other)
Compares two MethodInfo objects for method order. |
protected void |
drop(int keep)
Drops information from this info. |
protected int |
getAttributeCount()
Returns the number of attributes of this class. |
BasicBlocks |
getBasicBlocks()
|
List<InstructionHandle> |
getBCELInstructions()
|
String[] |
getExceptions()
|
Instruction[] |
getInstructions()
|
int |
getModifiers()
|
String |
getName()
|
String |
getSignature()
Gets the type signature including template information of the method. |
String |
getType()
|
boolean |
isConstructor()
|
boolean |
isDeprecated()
|
boolean |
isStatic()
|
boolean |
isSynthetic()
|
protected void |
readAttribute(String name,
int length,
ConstantPool cp,
DataInputStream input,
int howMuch)
Reads in an attributes of this class. |
void |
setBasicBlocks(BasicBlocks newBasicblocks)
|
void |
setDeprecated(boolean flag)
|
void |
setExceptions(String[] newExceptions)
|
void |
setModifiers(int newModifier)
|
void |
setName(String newName)
|
void |
setSynthetic(boolean flag)
|
void |
setType(String newType)
|
String |
toString()
Returns a string representation of this method. |
protected void |
writeAttributes(GrowableConstantPool gcp,
DataOutputStream output)
Writes the attributes to the output stream. |
Methods inherited from class net.sf.jode.bytecode.BinaryInfo |
---|
addAttribute, findAttribute, getAttributes, getAttributeSize, prepareAttributes, removeAllAttributes, removeAttribute |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MethodInfo()
public MethodInfo(String name, String typeSig, int modifier)
Method Detail |
---|
protected void readAttribute(String name, int length, ConstantPool cp, DataInputStream input, int howMuch) throws IOException
BinaryInfo
readAttribute
in class BinaryInfo
name
- the attribute name.length
- the length of the attribute.cp
- the constant pool of the class.input
- a data input stream where you can read the attribute
from. It will protect you to read more over the attribute boundary.howMuch
- the constant that was given to the ClassInfo.load(int)
function when loading this class.
IOException
protected int getAttributeCount()
BinaryInfo
getAttributeCount
in class BinaryInfo
protected void writeAttributes(GrowableConstantPool gcp, DataOutputStream output) throws IOException
BinaryInfo
Writes the attributes to the output stream.
Overwrite this method if you want to add your own attributes.
All constants you need from the growable constant pool must
have been previously registered by the BinaryInfo.prepareAttributes(net.sf.jode.bytecode.GrowableConstantPool)
method. This method must not add new constants to the pool
writeAttributes
in class BinaryInfo
gcp
- The growable constant pool, which is not
growable anymore (see above).output
- the data output stream. You must write exactly
as many bytes to it as you have told with the BinaryInfo.getAttributeSize()
method.
IOException
protected void drop(int keep)
BinaryInfo
drop
in class BinaryInfo
keep
- the constant representing how much information we
should keep (see ClassInfo.load(int)
).public String getName()
public String getType()
public String getSignature()
TypeSignature
public int getModifiers()
public boolean isConstructor()
public boolean isStatic()
public boolean isSynthetic()
public boolean isDeprecated()
public BasicBlocks getBasicBlocks()
public String[] getExceptions()
public void setName(String newName)
public void setType(String newType)
public void setModifiers(int newModifier)
public void setSynthetic(boolean flag)
public void setDeprecated(boolean flag)
public void setBasicBlocks(BasicBlocks newBasicblocks)
public void setExceptions(String[] newExceptions)
public int compareTo(Object other)
compareTo
in interface Comparable
ClassCastException
- if other is not a ClassInfo.public Instruction[] getInstructions()
public List<InstructionHandle> getBCELInstructions()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |