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 classFile,
boolean keepLines,
boolean keepLocals)
Constructs an instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getAccessFlags()
Get the field
access_flags. |
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.
|
CstString |
getSourceFile()
Gets the source file associated with the method if known.
|
boolean |
isDefaultOrStaticInterfaceMethod()
Tests whether the method is being defined on an interface.
|
boolean |
isStaticMethod()
Tests whether the method is being defined is declared as static.
|
SourcePosition |
makeSourcePosistion(int offset)
Returns a
SourcePosition instance corresponding to the
given bytecode offset. |
public ConcreteMethod(Method method, ClassFile classFile, boolean keepLines, boolean keepLocals)
method - non-null; the method to be based onclassFile - 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 CstString getSourceFile()
public final boolean isDefaultOrStaticInterfaceMethod()
public final boolean isStaticMethod()
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 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 instanceCopyright © 2020. All Rights Reserved.