Jode 1.90-CVS
Build Aug 6, 2004

net.sf.jode.decompiler
Class ImportHandler

java.lang.Object
  extended bynet.sf.jode.decompiler.ImportHandler

public class ImportHandler
extends java.lang.Object


Field Summary
static int DEFAULT_CLASS_LIMIT
          The default class limit. 1 means, import every class used here.
static int DEFAULT_PACKAGE_LIMIT
          The default package limit.
 
Constructor Summary
ImportHandler(ClassPath classPath)
           
ImportHandler(ClassPath classPath, int packageLimit, int classLimit)
           
 
Method Summary
 void dumpHeader(TabbedPrintWriter writer)
           
 void error(java.lang.String message)
           
 java.lang.String getClassString(ClassInfo clazz)
          Check if clazz is imported and maybe remove package delimiter from full qualified class name.
 java.lang.String getClassString(java.lang.String name)
          Check if clazz is imported and maybe remove package delimiter from full qualified class name.
 java.lang.String getTypeString(Type type)
           
 void init(java.lang.String className)
           
protected  int loadFileFlags()
           
 void useClass(ClassInfo clazz)
           
 void useClass(java.lang.String name)
           
 void useType(Type type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PACKAGE_LIMIT

public static final int DEFAULT_PACKAGE_LIMIT
The default package limit. MAX_VALUE means, do not import packages at all.

See Also:
Constant Field Values

DEFAULT_CLASS_LIMIT

public static final int DEFAULT_CLASS_LIMIT
The default class limit. 1 means, import every class used here.

See Also:
Constant Field Values
Constructor Detail

ImportHandler

public ImportHandler(ClassPath classPath)

ImportHandler

public ImportHandler(ClassPath classPath,
                     int packageLimit,
                     int classLimit)
Method Detail

dumpHeader

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

error

public void error(java.lang.String message)

init

public void init(java.lang.String className)

useClass

public void useClass(ClassInfo clazz)

useClass

public void useClass(java.lang.String name)

useType

public final void useType(Type type)

getClassString

public java.lang.String getClassString(ClassInfo clazz)
Check if clazz is imported and maybe remove package delimiter from full qualified class name.

Known Bug 1: If this is called before the imports are cleaned up, (that is only for debugging messages), the result is unpredictable.

Known Bug 2: It is not checked if the class name conflicts with a local variable, field or method name. This is very unlikely since the java standard has different naming convention for those names. (But maybe an intelligent obfuscator may use this fact.) This can only happen with static fields or static methods.

Returns:
a legal string representation of clazz.

getClassString

public java.lang.String getClassString(java.lang.String name)
Check if clazz is imported and maybe remove package delimiter from full qualified class name.

Known Bug 1: If this is called before the imports are cleaned up, (that is only for debugging messages), the result is unpredictable.

Known Bug 2: It is not checked if the class name conflicts with a local variable, field or method name. This is very unlikely since the java standard has different naming convention for those names. (But maybe an intelligent obfuscator may use this fact.) This can only happen with static fields or static methods.

Returns:
a legal string representation of clazz.

getTypeString

public java.lang.String getTypeString(Type type)

loadFileFlags

protected int loadFileFlags()

Jode 1.90-CVS
Build Aug 6, 2004

Copyright © 1998-2004 by Jochen Hoenicke.