|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectclassUtils.pack.util.SimpleClassPackageExplorer
public class SimpleClassPackageExplorer
A package explorer implementation.
WARNING: Sealed Jars aren't supported yet.
| Field Summary |
|---|
| Fields inherited from interface classUtils.pack.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 | |
|---|---|
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 |
setClassPath(java.lang.String classPath)
Sets the classPath. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleClassPackageExplorer()
public SimpleClassPackageExplorer(java.lang.String classPath)
classPath - string to iterate on
public SimpleClassPackageExplorer(java.lang.String classPath,
java.lang.String[] classDirs)
classPath - string to iterate onclassDirs - 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 packagestatus - bit mask (see status constant masks) indicating which files to list.
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 static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exceptionpublic boolean hasErrorOccurred()
ClassPackageExplorer
hasErrorOccurred in interface ClassPackageExplorerClassPackageExplorer.hasErrorOccurred()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||