|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.sadun.util.SimpleClassPackageExplorer
A package explorer implementation.
WARNING: Sealed Jars aren't supported yet.
| Nested Class Summary | |
static class |
SimpleClassPackageExplorer.PackageExplorationAdapter
An empty implementation of PackageExplorationListener. |
static interface |
SimpleClassPackageExplorer.PackageExplorationListener
Classes implementing this interface receive notifications of the explorer's activity. |
| Field Summary |
| Fields inherited from interface org.sadun.util.ClassPackageExplorer |
IN_DIRECTORY, IN_JAR, IN_JAR_SEALED |
| Constructor Summary | |
SimpleClassPackageExplorer()
Create a SimpleClassPackageExplorer on the system class path. |
|
SimpleClassPackageExplorer(java.lang.String classPath)
Create a SimpleClassPackageExplorer on the given class path. |
|
SimpleClassPackageExplorer(java.lang.String classPath,
java.lang.String[] classDirs)
Create a SimpleClassPackageExplorer on the given class path. |
|
| Method Summary | |
void |
addExplorationListener(SimpleClassPackageExplorer.PackageExplorationListener l)
Add a SimpleClassPackageExplorer.PackageExplorationListener to this object. |
java.lang.String |
getClassPath()
Returns the classPath. |
java.lang.String |
getErrorLog()
Return an error status for the explorer. |
java.io.File[] |
getPackageFiles(java.lang.String packageName)
Return the one or more files or directories where a package lives. |
int |
getStatus(java.lang.String packageName)
Return information on whether the package lives in a directory, a jar file, a sealed jar file or a combination. |
boolean |
hasErrorOccurred()
Return an error status for the explorer. |
java.lang.String[] |
listPackage(java.lang.String packageName)
Return the names of all the classes in the package. |
java.lang.String[] |
listPackage(java.lang.String packageName,
int status)
Return the names of the classes in the package. |
java.lang.String[] |
listPackageNames()
List the available packages. |
java.lang.String[] |
listPackageNames(boolean rescan)
List the available packages. |
static void |
main(java.lang.String[] args)
A test method |
void |
removeExplorationListener(SimpleClassPackageExplorer.PackageExplorationListener l)
Remove a SimpleClassPackageExplorer.PackageExplorationListener from this object. |
void |
setClassPath(java.lang.String classPath)
Sets the classPath. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SimpleClassPackageExplorer()
public SimpleClassPackageExplorer(java.lang.String classPath)
public SimpleClassPackageExplorer(java.lang.String classPath,
java.lang.String[] classDirs)
classDirs - an array of regular expression for the names of subdirectories to search for;
these patterns are not considered for JARs.| Method Detail |
public java.lang.String[] listPackage(java.lang.String packageName)
ClassPackageExplorer
listPackage in interface ClassPackageExplorerpackageName - the name of the package
ClassPackageExplorer.listPackage(String)public java.lang.String[] listPackageNames()
ClassPackageExplorer
listPackageNames in interface ClassPackageExplorerClassPackageExplorer.listPackageNames()public java.lang.String getClassPath()
public java.io.File[] getPackageFiles(java.lang.String packageName)
ClassPackageExplorerThis can take a long time on first invocation.
getPackageFiles in interface ClassPackageExplorerpackageName - the name of the package
ClassPackageExplorer.getPackageFiles(String)public int getStatus(java.lang.String packageName)
ClassPackageExplorerThis can take a long time on first invocation.
getStatus in interface ClassPackageExplorerpackageName - the name of the package
ClassPackageExplorer.getStatus(String)
public java.lang.String[] listPackage(java.lang.String packageName,
int status)
ClassPackageExplorer
listPackage in interface ClassPackageExplorerpackageName - the name of the package
ClassPackageExplorer.listPackage(String, int)public java.lang.String[] listPackageNames(boolean rescan)
ClassPackageExplorerThis can take a long time on first invocation or if rescan is true.
listPackageNames in interface ClassPackageExplorerrescan - forces a re-scanning
ClassPackageExplorer.listPackageNames(boolean)public void setClassPath(java.lang.String classPath)
classPath - The classPath to setpublic java.lang.String getErrorLog()
ClassPackageExplorer
getErrorLog in interface ClassPackageExplorerClassPackageExplorer.getErrorLog()public boolean hasErrorOccurred()
ClassPackageExplorer
hasErrorOccurred in interface ClassPackageExplorerClassPackageExplorer.hasErrorOccurred()public void addExplorationListener(SimpleClassPackageExplorer.PackageExplorationListener l)
SimpleClassPackageExplorer.PackageExplorationListener to this object.
l - the SimpleClassPackageExplorer.PackageExplorationListener to addpublic void removeExplorationListener(SimpleClassPackageExplorer.PackageExplorationListener l)
SimpleClassPackageExplorer.PackageExplorationListener from this object.
l - the SimpleClassPackageExplorer.PackageExplorationListener to remove
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||