|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
org.deepfs.fsml.util.Loader
public final class Loader
Some utility methods for loading class files from folders, packages or jar files.
Method Summary | |
---|---|
static Class<?>[] |
load(Package pkg,
Class<?> superClass)
Loads all subclasses of superClass from the package
pkg . |
Methods inherited from class java.lang.ClassLoader |
---|
clearAssertionStatus, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Class<?>[] load(Package pkg, Class<?> superClass) throws IOException
Loads all subclasses of superClass
from the package
pkg
. The classes may either be in a directory or inside a java
archive file. If one of the classes is already loaded, nothing is done (but
the class will be included in the results).
superClass
may be an abstract class, an interface or a regular
class. Every class inside the package pkg
that implements the
interface or extends the class is loaded.
This method breaks after the first error. Subsequent classes are not loaded.
pkg
- the package to load the classes fromsuperClass
- either the interface that has to be implemented by the
classes or a class that has to be extended
IOException
- if the classes are located inside a JAR file and any
error occurs while reading from this file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |