Jode 1.90-CVS
Build Aug 6, 2004

net.sf.jode.decompiler
Class ClassAnalyzer

java.lang.Object
  extended bynet.sf.jode.decompiler.ClassAnalyzer
All Implemented Interfaces:
ClassDeclarer, Declarable, Scope

public class ClassAnalyzer
extends java.lang.Object
implements Scope, Declarable, ClassDeclarer


Field Summary
 
Fields inherited from interface net.sf.jode.decompiler.Scope
AMBIGUOUSNAME, CLASSNAME, CLASSSCOPE, FIELDNAME, LOCALNAME, METHODNAME, METHODSCOPE, NOSUPERFIELDNAME, NOSUPERMETHODNAME, PACKAGENAME
 
Constructor Summary
ClassAnalyzer(ClassDeclarer parent, ClassInfo clazz, ImportHandler imports)
           
ClassAnalyzer(ClassDeclarer parent, ClassInfo clazz, ImportHandler imports, Expression[] outerValues)
           
ClassAnalyzer(ClassInfo clazz, ImportHandler imports)
           
 
Method Summary
 void addBlockInitializer(int index, StructuredBlock initializer)
           
 void addClassAnalyzer(ClassAnalyzer clazzAna)
           
 void analyze(ProgressListener pl, double done, double scale)
           
 void analyzeInnerClasses(ProgressListener pl, double done, double scale)
           
 boolean conflicts(java.lang.String name, int usageType)
           
 void dumpBlock(TabbedPrintWriter writer)
           
 void dumpBlock(TabbedPrintWriter writer, ProgressListener pl, double done, double scale)
           
 void dumpDeclaration(TabbedPrintWriter writer)
           
 void dumpDeclaration(TabbedPrintWriter writer, ProgressListener pl, double done, double scale)
           
 void dumpJavaFile(TabbedPrintWriter writer)
           
 void dumpJavaFile(TabbedPrintWriter writer, ProgressListener pl)
           
 void dumpSource(TabbedPrintWriter writer)
           
 void dumpSource(TabbedPrintWriter writer, ProgressListener pl, double done, double scale)
           
 void fillDeclarables(java.util.Collection used)
          We add the named method scoped classes to the declarables.
 ClassAnalyzer getClassAnalyzer(ClassInfo cinfo)
          Get the class analyzer for the given class info.
 ClassPath getClassPath()
           
 ClassInfo getClazz()
           
 double getComplexity()
          Gets the complexity of this class.
 FieldAnalyzer getField(int index)
           
 int getFieldIndex(java.lang.String fieldName, Type fieldType)
           
 ClassAnalyzer getInnerClassAnalyzer(java.lang.String name)
          Get the class analyzer for the given inner class.
 MethodAnalyzer getMethod(java.lang.String methodName, MethodType methodType)
           
 int getModifiers()
           
 java.lang.String getName()
          Get the name of this declarable.
 Expression getOuterInstance()
           
 OuterValues getOuterValues()
           
 ClassDeclarer getParent()
          Get the parent of this ClassDeclarer.
 void initialize()
           
 boolean isScopeOf(java.lang.Object obj, int scopeType)
          Tells if this is the scope of the given object, which is of scopeType.
 boolean isStatic()
           
 boolean isStrictFP()
           
 void makeDeclaration(java.util.Set done)
           
 void makeNameUnique()
          Set the name of this local.
 void setName(java.lang.String name)
           
 void setParent(ClassDeclarer newParent)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassAnalyzer

public ClassAnalyzer(ClassDeclarer parent,
                     ClassInfo clazz,
                     ImportHandler imports,
                     Expression[] outerValues)
              throws ClassFormatException,
                     java.io.IOException

ClassAnalyzer

public ClassAnalyzer(ClassDeclarer parent,
                     ClassInfo clazz,
                     ImportHandler imports)
              throws ClassFormatException,
                     java.io.IOException

ClassAnalyzer

public ClassAnalyzer(ClassInfo clazz,
                     ImportHandler imports)
              throws ClassFormatException,
                     java.io.IOException
Method Detail

getClassPath

public ClassPath getClassPath()

isStatic

public final boolean isStatic()

isStrictFP

public final boolean isStrictFP()

getField

public FieldAnalyzer getField(int index)

getFieldIndex

public int getFieldIndex(java.lang.String fieldName,
                         Type fieldType)

getMethod

public MethodAnalyzer getMethod(java.lang.String methodName,
                                MethodType methodType)

getModifiers

public int getModifiers()

getParent

public ClassDeclarer getParent()
Description copied from interface: ClassDeclarer
Get the parent of this ClassDeclarer.

Specified by:
getParent in interface ClassDeclarer
Returns:
null if this is the outermost instance.

setParent

public void setParent(ClassDeclarer newParent)

getClazz

public ClassInfo getClazz()

getName

public java.lang.String getName()
Description copied from interface: Declarable
Get the name of this declarable.

Specified by:
getName in interface Declarable

setName

public void setName(java.lang.String name)

getOuterValues

public OuterValues getOuterValues()

getOuterInstance

public Expression getOuterInstance()

addBlockInitializer

public void addBlockInitializer(int index,
                                StructuredBlock initializer)

initialize

public void initialize()

getComplexity

public double getComplexity()
Gets the complexity of this class. Must be called after it has been initialized. This is used for a nice progress bar.


analyze

public void analyze(ProgressListener pl,
                    double done,
                    double scale)

analyzeInnerClasses

public void analyzeInnerClasses(ProgressListener pl,
                                double done,
                                double scale)

makeDeclaration

public void makeDeclaration(java.util.Set done)

dumpDeclaration

public void dumpDeclaration(TabbedPrintWriter writer)
                     throws java.io.IOException
Specified by:
dumpDeclaration in interface Declarable
Throws:
java.io.IOException

dumpDeclaration

public void dumpDeclaration(TabbedPrintWriter writer,
                            ProgressListener pl,
                            double done,
                            double scale)
                     throws java.io.IOException
Throws:
java.io.IOException

dumpBlock

public void dumpBlock(TabbedPrintWriter writer)
               throws java.io.IOException
Throws:
java.io.IOException

dumpBlock

public void dumpBlock(TabbedPrintWriter writer,
                      ProgressListener pl,
                      double done,
                      double scale)
               throws java.io.IOException
Throws:
java.io.IOException

dumpSource

public void dumpSource(TabbedPrintWriter writer)
                throws java.io.IOException
Throws:
java.io.IOException

dumpSource

public void dumpSource(TabbedPrintWriter writer,
                       ProgressListener pl,
                       double done,
                       double scale)
                throws java.io.IOException
Throws:
java.io.IOException

dumpJavaFile

public void dumpJavaFile(TabbedPrintWriter writer)
                  throws java.io.IOException
Throws:
java.io.IOException

dumpJavaFile

public void dumpJavaFile(TabbedPrintWriter writer,
                         ProgressListener pl)
                  throws java.io.IOException
Throws:
java.io.IOException

isScopeOf

public boolean isScopeOf(java.lang.Object obj,
                         int scopeType)
Description copied from interface: Scope
Tells if this is the scope of the given object, which is of scopeType.

Specified by:
isScopeOf in interface Scope
Parameters:
obj - the object for which the scope
Returns:
true if the given object is in this scope.

makeNameUnique

public void makeNameUnique()
Description copied from interface: Declarable
Set the name of this local.

Specified by:
makeNameUnique in interface Declarable

conflicts

public boolean conflicts(java.lang.String name,
                         int usageType)
Specified by:
conflicts in interface Scope

getClassAnalyzer

public ClassAnalyzer getClassAnalyzer(ClassInfo cinfo)
Get the class analyzer for the given class info. This searches the method scoped/anonymous classes in this method and all outer methods and the outer classes for the class analyzer.

Specified by:
getClassAnalyzer in interface ClassDeclarer
Parameters:
cinfo - the classinfo for which the analyzer is searched.
Returns:
the class analyzer, or null if there is not an outer class that equals cinfo, and not a method scope/inner class in an outer method.

getInnerClassAnalyzer

public ClassAnalyzer getInnerClassAnalyzer(java.lang.String name)
Get the class analyzer for the given inner class.

Parameters:
name - the short name of the inner class
Returns:
the class analyzer, or null if there is no inner class with the given name.

fillDeclarables

public void fillDeclarables(java.util.Collection used)
We add the named method scoped classes to the declarables.


addClassAnalyzer

public void addClassAnalyzer(ClassAnalyzer clazzAna)
Specified by:
addClassAnalyzer in interface ClassDeclarer

toString

public java.lang.String toString()

Jode 1.90-CVS
Build Aug 6, 2004

Copyright © 1998-2004 by Jochen Hoenicke.