Package org.benf.cfr.reader.entities
Class Method
- java.lang.Object
-
- org.benf.cfr.reader.entities.Method
-
- All Implemented Interfaces:
KnowsRawSize
,TypeUsageCollectable
public class Method extends java.lang.Object implements KnowsRawSize, TypeUsageCollectable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Method.MethodConstructor
static class
Method.Visibility
-
Field Summary
Fields Modifier and Type Field Description private java.util.EnumSet<AccessFlagMethod>
accessFlags
private AttributeMap
attributes
private ClassFile
classFile
private AttributeCode
codeAttribute
private DecompilerComments
comments
private ConstantPool
cp
private int
descriptorIndex
private Method.Visibility
hidden
private Method.MethodConstructor
isConstructor
private boolean
isOverride
private long
length
private java.util.Map<JavaRefTypeInstance,java.lang.String>
localClasses
private MethodPrototype
methodPrototype
private static long
OFFSET_OF_ACCESS_FLAGS
private static long
OFFSET_OF_ATTRIBUTES
private static long
OFFSET_OF_ATTRIBUTES_COUNT
private static long
OFFSET_OF_DESCRIPTOR_INDEX
private static long
OFFSET_OF_NAME_INDEX
private static AnnotationTableEntry
OVERRIDE_ANNOTATION
private java.util.Set<JavaTypeInstance>
thrownTypes
private VariableNamer
variableNamer
-
Constructor Summary
Constructors Constructor Description Method(ByteData raw, ClassFile classFile, ConstantPool cp, DCCommonState dcCommonState, ClassFileVersion classFileVersion)
-
Method Summary
-
-
-
Field Detail
-
OFFSET_OF_ACCESS_FLAGS
private static final long OFFSET_OF_ACCESS_FLAGS
- See Also:
- Constant Field Values
-
OFFSET_OF_NAME_INDEX
private static final long OFFSET_OF_NAME_INDEX
- See Also:
- Constant Field Values
-
OFFSET_OF_DESCRIPTOR_INDEX
private static final long OFFSET_OF_DESCRIPTOR_INDEX
- See Also:
- Constant Field Values
-
OFFSET_OF_ATTRIBUTES_COUNT
private static final long OFFSET_OF_ATTRIBUTES_COUNT
- See Also:
- Constant Field Values
-
OFFSET_OF_ATTRIBUTES
private static final long OFFSET_OF_ATTRIBUTES
- See Also:
- Constant Field Values
-
OVERRIDE_ANNOTATION
private static final AnnotationTableEntry OVERRIDE_ANNOTATION
-
length
private final long length
-
accessFlags
private final java.util.EnumSet<AccessFlagMethod> accessFlags
-
attributes
private final AttributeMap attributes
-
isConstructor
private Method.MethodConstructor isConstructor
-
descriptorIndex
private final int descriptorIndex
-
codeAttribute
private final AttributeCode codeAttribute
-
cp
private final ConstantPool cp
-
variableNamer
private final VariableNamer variableNamer
-
methodPrototype
private final MethodPrototype methodPrototype
-
classFile
private final ClassFile classFile
-
hidden
private Method.Visibility hidden
-
comments
private DecompilerComments comments
-
localClasses
private final java.util.Map<JavaRefTypeInstance,java.lang.String> localClasses
-
isOverride
private boolean isOverride
-
thrownTypes
private transient java.util.Set<JavaTypeInstance> thrownTypes
-
-
Constructor Detail
-
Method
public Method(ByteData raw, ClassFile classFile, ConstantPool cp, DCCommonState dcCommonState, ClassFileVersion classFileVersion)
-
-
Method Detail
-
releaseCode
void releaseCode()
-
hasDumpableAttributes
public boolean hasDumpableAttributes()
-
collectTypeUsages
public void collectTypeUsages(TypeUsageCollector collector)
- Specified by:
collectTypeUsages
in interfaceTypeUsageCollectable
-
copyLocalClassesFrom
public boolean copyLocalClassesFrom(Method other)
-
getAccessFlags
public java.util.Set<AccessFlagMethod> getAccessFlags()
-
hideSynthetic
public void hideSynthetic()
-
hideDead
public void hideDead()
-
hiddenState
public Method.Visibility hiddenState()
-
testAccessFlag
public boolean testAccessFlag(AccessFlagMethod flag)
-
getConstructorFlag
public Method.MethodConstructor getConstructorFlag()
-
setConstructorFlag
public void setConstructorFlag(Method.MethodConstructor flag)
-
getSignatureAttribute
AttributeSignature getSignatureAttribute()
-
getVariableNamer
public VariableNamer getVariableNamer()
-
getClassFile
public ClassFile getClassFile()
-
getRawByteLength
public long getRawByteLength()
- Specified by:
getRawByteLength
in interfaceKnowsRawSize
-
getName
public java.lang.String getName()
-
generateMethodPrototype
private MethodPrototype generateMethodPrototype(Options options, java.lang.String initialName, Method.MethodConstructor constructorFlag)
-
checkSigProto
private static boolean checkSigProto(MethodPrototype desproto, MethodPrototype sigproto, boolean isEnumConstructor, boolean isInnerConstructor)
-
fixupInnerClassSignature
private static void fixupInnerClassSignature(MethodPrototype descriptor, MethodPrototype signature)
-
getMethodPrototype
public MethodPrototype getMethodPrototype()
-
markOverride
void markOverride()
-
markUsedLocalClassType
public void markUsedLocalClassType(JavaTypeInstance javaTypeInstance, java.lang.String suggestedName)
-
markUsedLocalClassType
public void markUsedLocalClassType(JavaTypeInstance javaTypeInstance)
-
dumpMethodAnnotations
private void dumpMethodAnnotations(Dumper d, java.util.List<AnnotationTableEntry> nullableDeclAnnotations)
-
getDeclaredThrownTypes
private java.util.List<JavaTypeInstance> getDeclaredThrownTypes()
-
getAttributeDeclaredThrownTypes
private java.util.List<JavaTypeInstance> getAttributeDeclaredThrownTypes()
-
getThrownTypes
public java.util.Set<JavaTypeInstance> getThrownTypes()
-
dumpSignatureText
private void dumpSignatureText(boolean asClass, Dumper d)
-
getAnalysis
public Op04StructuredStatement getAnalysis()
-
isConstructor
public boolean isConstructor()
-
analyse
void analyse()
-
hasCodeAttribute
public boolean hasCodeAttribute()
-
getCodeAttribute
public AttributeCode getCodeAttribute()
-
dumpComments
private void dumpComments(Dumper d)
-
setComments
public void setComments(DecompilerComments comments)
-
addComment
private void addComment(DecompilerComment comment)
-
isVisibleTo
public boolean isVisibleTo(JavaRefTypeInstance maybeCaller)
-
dump
public void dump(Dumper d, boolean asClass)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-