|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.util.classutil.ClassLoaderBuilder
public class ClassLoaderBuilder
A ClassLoaderBuilder is used to build an alternate class loader that includes additional jar files, zip files and/or directories in its load path. It's basically a convenient wrapper around java.net.URLClassLoader.
| Constructor Summary | |
|---|---|
ClassLoaderBuilder()
Create a new ClassLoaderBuilder. |
|
| Method Summary | |
|---|---|
int |
add(java.util.Collection<java.io.File> files)
Add a Collection of jar files, zip files or directories to the list of places the not-yet-constructed class loader will search. |
boolean |
add(java.io.File file)
Add a jar file, zip file or directory to the list of places the not-yet-constructed class loader will search. |
int |
add(java.io.File[] files)
Add an array of jar files, zip files or directories to the list of places the not-yet-constructed class loader will search. |
void |
addClassPath()
Add the contents of the classpath. |
void |
clear()
Clear the stored files in this object. |
java.lang.ClassLoader |
createClassLoader()
Create and return a class loader that will search the additional places defined in this builder. |
java.lang.ClassLoader |
createClassLoader(java.lang.ClassLoader parentLoader)
Create and return a class loader that will search the additional places defined in this builder. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassLoaderBuilder()
| Method Detail |
|---|
public boolean add(java.io.File file)
file - the jar file, zip file or directory
public int add(java.io.File[] files)
files - the array
public int add(java.util.Collection<java.io.File> files)
files - the collection
public void addClassPath()
public void clear()
public java.lang.ClassLoader createClassLoader()
throws java.lang.SecurityException
java.lang.SecurityException - if a security manager exists and its
checkCreateClassLoader() method
does not allow creation of a class loader
public java.lang.ClassLoader createClassLoader(java.lang.ClassLoader parentLoader)
throws java.lang.SecurityException
parentLoader - the desired parent class loader
java.lang.SecurityException - if a security manager exists and its
checkCreateClassLoader() method
does not allow creation of a class loader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||