Class listclass
java.lang.Object
|
+--listclass
- public class listclass
- extends java.lang.Object
Read class file(s) and display its contents. The command line usage is:
java listclass [-constants] [-code] [-brief] [-dependencies] [-nocontents] [-recurse] class... [-exclude ]
where
- -code List byte code of methods
- -brief List byte codes briefly
- -constants Print constants table (constant pool)
- -recurse Usually intended to be used along with
-dependencies When this flag is set, listclass will also print information
about all classes which the target class depends on.
- -dependencies Setting this flag makes listclass print a list of all
classes which the target class depends on. Generated from getting all
CONSTANT_Class constants from the constant pool.
- -exclude All non-flag arguments after this flag are added to an
'exclusion list'. Target classes are compared with the members of the
exclusion list. Any target class whose fully qualified name begins with a
name in the exclusion list will not be analyzed/listed. This is meant
primarily when using both -recurse to exclude java, javax, and sun classes,
and is recommended as otherwise the output from -recurse gets quite long and
most of it is not interesting. Note that -exclude prevents listing of
classes, it does not prevent class names from being printed in the
-dependencies list.
- -nocontents Do not print JavaClass.toString() for the class. I added
this because sometimes I'm only interested in dependency information.
Here's a couple examples of how I typically use listclass:
java listclass -code MyClass
Print information about the class and the byte code of the methods
java listclass -nocontents -dependencies MyClass
Print a list of all classes which MyClass depends on.
java listclass -nocontents -recurse MyClass -exclude java. javax. sun.
Print a recursive listing of all classes which MyClass depends on. Do not
analyze classes beginning with "java.", "javax.", or "sun.".
java listclass -nocontents -dependencies -recurse MyClass -exclude java.javax. sun.
Print a recursive listing of dependency information for MyClass and its
dependents. Do not analyze classes beginning with "java.", "javax.", or "sun."
- Version:
- $Id: listclass.java,v 1.8 2001/10/11 11:59:26 dahm Exp $
- Author:
- M. Dahm,
Thomas Wheeler
Constructor Summary |
listclass(boolean code,
boolean constants,
boolean verbose,
boolean classdep,
boolean nocontents,
boolean recurse,
java.util.Vector exclude_name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
listclass
public listclass(boolean code,
boolean constants,
boolean verbose,
boolean classdep,
boolean nocontents,
boolean recurse,
java.util.Vector exclude_name)
main
public static void main(java.lang.String[] argv)
list
public void list(java.lang.String name)
- Print the given class on screen
printClassDependencies
public static void printClassDependencies(ConstantPool pool)
- Dump the list of classes this class is dependent on
getClassDependencies
public static java.lang.String[] getClassDependencies(ConstantPool pool)
printCode
public static void printCode(Method[] methods,
boolean verbose)
- Dump the disassembled code of all methods in the class.