edu.yale.emailet
Class ClassLister
java.lang.Object
|
+--edu.yale.emailet.ClassLister
- public class ClassLister
- extends java.lang.Object
Gather the set of classes referenced by a set of seed classes.
- Author:
- Hong Jiang
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassLister
public ClassLister(java.io.InputStream in)
- Parameters:
in
- An InputStream from which the class bytecode will be read.
ClassLister
public ClassLister(java.lang.String filename)
throws java.io.IOException
- Parameters:
filename
- Name of a JAVA class file
- Throws:
java.io.IOException
addIgnorePrefix
public void addIgnorePrefix(java.lang.String pref)
- Add an internal prefix. Classes of the form
<pref$gt;.name
will be ignored by getReferencedClassNames.
- Parameters:
pref
- the prefix to add.
addIgnorePrefixes
public void addIgnorePrefixes(java.util.Set prefs)
- Parameters:
prefs
- A set of class name prefixes to be ignored. For example, add
"java.", "javax." etc. to ignore standard classes and only list custom
classes
inIgnore
protected boolean inIgnore(java.lang.String name)
getReferencedClassNames
public java.util.Set getReferencedClassNames()
throws java.io.IOException,
java.lang.ClassNotFoundException
- Returns:
- The names of the referenced classes, expect those with the prefix
specified to be ignored.
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- The
main()
function will list referenced classes given a class
file. Class names begin with "java." and "edu.yale.emailet." are ignored.
- Parameters:
args
- The command line arguments are the name of the class file to be
analyzed.
- Throws:
java.lang.Exception