public final class ConcreteMethod extends java.lang.Object implements Method
Method, so it provides all the original access
(by delegation), but it also constructs and keeps useful versions of
stuff extracted from the method's Code attribute.| Constructor and Description |
|---|
ConcreteMethod(Method method,
ClassFile cf,
boolean keepLines,
boolean keepLocals)
Constructs an instance.
|
ConcreteMethod(Method method,
int accessFlags,
CstString sourceFile,
boolean keepLines,
boolean keepLocals) |
| Modifier and Type | Method and Description |
|---|---|
int |
getAccessFlags()
Get the field
access_flags. |
boolean |
getAccSuper()
Gets whether the class that this method is part of is defined with
ACC_SUPER. |
AttributeList |
getAttributes()
Get the field
attributes (along with
attributes_count). |
ByteCatchList |
getCatches()
Gets the exception table.
|
BytecodeArray |
getCode()
Gets the bytecode array.
|
CstType |
getDefiningClass()
Get the defining class.
|
CstString |
getDescriptor()
Get the field
descriptor_index of the member. |
Prototype |
getEffectiveDescriptor()
Get the effective method descriptor, which includes, if
necessary, a first
this parameter. |
LineNumberList |
getLineNumbers()
Gets the line number list.
|
LocalVariableList |
getLocalVariables()
Gets the local variable list.
|
int |
getMaxLocals()
Gets the number of locals.
|
int |
getMaxStack()
Gets the maximum stack size.
|
CstString |
getName()
Get the field
name_index of the member. |
CstNat |
getNat()
Get the name and type associated with this member.
|
SourcePosition |
makeSourcePosistion(int offset)
Returns a
SourcePosition instance corresponding to the
given bytecode offset. |
public ConcreteMethod(Method method, ClassFile cf, boolean keepLines, boolean keepLocals)
method - non-null; the method to be based oncf - non-null; the class file that contains this methodkeepLines - whether to keep the line number information
(if any)keepLocals - whether to keep the local variable
information (if any)public CstNat getNat()
name_index and
descriptor_index in the original classfile, interpreted
via the constant pool.public CstString getName()
name_index of the member. This is
just a convenient shorthand for getNat().getName().public CstString getDescriptor()
descriptor_index of the member. This is
just a convenient shorthand for getNat().getDescriptor().getDescriptor in interface Membernon-null; the descriptorpublic int getAccessFlags()
access_flags.getAccessFlags in interface Memberpublic AttributeList getAttributes()
attributes (along with
attributes_count).getAttributes in interface HasAttributegetAttributes in interface Membernon-null; the constant poolpublic CstType getDefiningClass()
getDefiningClass in interface Membernon-null; the defining classpublic Prototype getEffectiveDescriptor()
this parameter.getEffectiveDescriptor in interface Methodnon-null; the effective method descriptorpublic boolean getAccSuper()
ACC_SUPER.ACC_SUPER valuepublic int getMaxStack()
>= 0; the maximum stack sizepublic int getMaxLocals()
>= 0; the number of localspublic BytecodeArray getCode()
non-null; the bytecode arraypublic ByteCatchList getCatches()
non-null; the exception tablepublic LineNumberList getLineNumbers()
non-null; the line number listpublic LocalVariableList getLocalVariables()
non-null; the local variable listpublic SourcePosition makeSourcePosistion(int offset)
SourcePosition instance corresponding to the
given bytecode offset.offset - >= 0; the bytecode offsetnon-null; an appropriate instance