|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jode.decompiler.MethodAnalyzer
public class MethodAnalyzer
A method analyzer is the main class for analyzation of methods. There is exactly one MethodAnalyzer object for each method (even for abstract methods), that should be decompiled. Method analyzation is done in three passes:
analyze()
analyzeInners()
analyze()
and analyzeInners()
methods.makeDeclaration()
Field Summary |
---|
Fields inherited from interface net.sf.jode.decompiler.Scope |
---|
AMBIGUOUSNAME, CLASSNAME, CLASSSCOPE, FIELDNAME, LOCALNAME, METHODNAME, METHODSCOPE, NOSUPERFIELDNAME, NOSUPERMETHODNAME, PACKAGENAME |
Constructor Summary | |
---|---|
MethodAnalyzer(ClassAnalyzer cla,
MethodInfo minfo,
ImportHandler imports)
This is the default constructor. |
Method Summary | |
---|---|
void |
addAnonymousConstructor(InvokeOperator cop)
Registers an anonymous constructor invokation. |
void |
addClassAnalyzer(ClassAnalyzer clazzAna)
|
void |
analyze(ProgressListener pl,
double done,
double scale)
This is the first pass of the analyzation. |
void |
analyzeInnerClasses()
This is the second pass of the analyzation. |
void |
analyzeInvokeOperator(InvokeOperator cop)
|
boolean |
conflicts(String name,
int usageType)
Checks if the specified name conflicts with an object in this scope. |
void |
dumpSource(TabbedPrintWriter writer)
Dumps the source code for this method to the specified writer. |
void |
fillDeclarables(Collection used)
We add the named method scoped classes to the declarables. |
ClassAnalyzer |
findAnonClass(String name)
Checks if a method scoped class with the given name exists in this method (not in a parent method). |
LocalInfo |
findLocal(String name)
Checks if the variable set contains a local with the given name. |
BasicBlocks |
getBasicBlocks()
Returns the bytecode info for this method. |
ClassAnalyzer |
getClassAnalyzer()
Get the class analyzer for the class containing this method. |
ClassAnalyzer |
getClassAnalyzer(ClassInfo cinfo)
Get the class analyzer for the given class info. |
ClassInfo |
getClazz()
Get the class info for the class containing this method. |
double |
getComplexity()
Gets the complexity of this class. |
ImportHandler |
getImportHandler()
Returns the import handler. |
LocalInfo |
getLocalInfo(LocalVariableInfo lvi)
Create a local info for a local variable located at an instruction with the given address. |
FlowBlock |
getMethodHeader()
Returns the first flow block of the code. |
MethodInfo |
getMethodInfo()
|
String |
getName()
Returns the name of this method. |
int |
getParamCount()
Return the number of parameters for this method. |
LocalInfo |
getParamInfo(int nr)
Get the local info for a parameter. |
ClassDeclarer |
getParent()
Gets the parent scope, i.e. |
Type |
getReturnType()
Get the return type of this method. |
SyntheticAnalyzer |
getSynthetic()
Get the synthetic analyzer for this method. |
MethodType |
getType()
Returns the type of this method. |
void |
insertStructuredBlock(StructuredBlock insertBlock)
Inserts a structured block to the beginning of the method. |
boolean |
isAnonymousConstructor()
Checks if this constructor can be omited, since it is implicit. |
boolean |
isConstructor()
Checks if this method is a constructor, i.e. |
boolean |
isMoreOuterThan(ClassDeclarer declarer)
|
boolean |
isScopeOf(Object obj,
int scopeType)
Checks if the specified object lies in this scope. |
boolean |
isStatic()
Checks if this method is static. |
boolean |
isStrictFP()
Checks if this method is strictfp |
boolean |
isSynthetic()
Checks if this method is synthetic, i.e. |
void |
makeDeclaration(Set done)
This is the third and last pass of the analyzation. |
void |
setAnonymousConstructor(boolean value)
Tells if this constructor can be omited, since it is implicit. |
void |
setHasOuterValue(boolean value)
Tells if this (constructor$xx) method has as first (implicit) parameter the instance of the outer class. |
void |
setJikesBlockInitializer(boolean value)
Tells if this method is the block$xx method generated by jikes. |
void |
setJikesConstructor(MethodAnalyzer realConstr)
Tells if this method is the constructor$xx method generated by jikes. |
boolean |
skipWriting()
Tells if this method is synthetic or implicit or something else, so that it doesn't have to be written to the source code. |
String |
toString()
|
void |
useType(Type type)
Registers a type at the import handler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MethodAnalyzer(ClassAnalyzer cla, MethodInfo minfo, ImportHandler imports)
cla
- the ClassAnalyzer of the class that contains this method.minfo
- the method info structure for this method.imports
- the import handler that should be informed about types.Method Detail |
---|
public String getName()
public MethodType getType()
public FlowBlock getMethodHeader()
public final BasicBlocks getBasicBlocks()
public final MethodInfo getMethodInfo()
public final ImportHandler getImportHandler()
public final void useType(Type type)
type
- the type that should be registered.public void insertStructuredBlock(StructuredBlock insertBlock)
insertBlock
- the structured block that should be inserted.public final boolean isConstructor()
public final boolean isStatic()
public final boolean isSynthetic()
public final boolean isStrictFP()
public final void setJikesConstructor(MethodAnalyzer realConstr)
realConstr
- true, iff this method is the jikes constructor.public final void setJikesBlockInitializer(boolean value)
value
- true, iff this method is the jikes block initializer.public final void setHasOuterValue(boolean value)
value
- true, this method has the implicit parameter.public final void setAnonymousConstructor(boolean value)
value
- true, this method is the implicit constructor.public final boolean isAnonymousConstructor()
public final SyntheticAnalyzer getSynthetic()
public Type getReturnType()
public ClassAnalyzer getClassAnalyzer()
public ClassInfo getClazz()
public final LocalInfo getParamInfo(int nr)
nr
- the index of the parameter (start by zero and
count the implicit this param for nonstatic method).
getLocalInfo(net.sf.jode.bytecode.LocalVariableInfo)
public final int getParamCount()
public LocalInfo getLocalInfo(LocalVariableInfo lvi)
lvi
- the local variable info of the bytecode package.
public double getComplexity()
public void analyze(ProgressListener pl, double done, double scale) throws ClassFormatError
ClassFormatError
public void analyzeInnerClasses() throws ClassFormatError
ClassFormatError
public void makeDeclaration(Set done)
public boolean skipWriting()
public void dumpSource(TabbedPrintWriter writer) throws IOException
writer
- the tabbed print writer the code should be written to.
IOException,
- if writer throws an exception.
IOException
public LocalInfo findLocal(String name)
public ClassAnalyzer findAnonClass(String name)
public boolean isScopeOf(Object obj, int scopeType)
isScopeOf
in interface Scope
obj
- the object.scopeType
- the type of this object.
public boolean conflicts(String name, int usageType)
conflicts
in interface Scope
name
- the name to check.usageType
- the usage type of this name, AMBIGUOUSNAME if it is
ambiguous.public ClassDeclarer getParent()
getParent
in interface ClassDeclarer
public void addAnonymousConstructor(InvokeOperator cop)
cop
- the constructor invokation, that creates the method scoped
class.public void analyzeInvokeOperator(InvokeOperator cop)
public ClassAnalyzer getClassAnalyzer(ClassInfo cinfo)
getClassAnalyzer
in interface ClassDeclarer
cinfo
- the classinfo for which the analyzer is searched.
public void addClassAnalyzer(ClassAnalyzer clazzAna)
addClassAnalyzer
in interface ClassDeclarer
public void fillDeclarables(Collection used)
public boolean isMoreOuterThan(ClassDeclarer declarer)
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |