public final class ClassLoaderFactory
extends java.lang.Object
Zephyr Business Solution
Modifier and Type | Class and Description |
---|---|
static interface |
ClassLoaderFactory.ErrorHandler
To handle errors during class loading.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CHILD_FIRST
The child-first string value.
|
static java.lang.String |
CHILD_ONLY
The child-only string value.
|
static java.lang.String |
PARENT_FIRST
The parent-first string value.
|
static java.lang.String |
PARENT_ONLY
The parent-only string value.
|
Constructor and Description |
---|
ClassLoaderFactory(java.io.File basedir,
ClassLoaderFactory.ErrorHandler handler,
java.lang.String policy)
Creates a ClassLoaderFactory object.
|
Modifier and Type | Method and Description |
---|---|
void |
addSysPackage(java.lang.String prefix) |
java.lang.ClassLoader |
createClassLoader(java.lang.ClassLoader parent,
java.lang.Object path)
Create a ClassLoader object by using the current ClassLoader
policy and the given class path.
|
java.lang.ClassLoader |
createClassLoader(java.lang.Object path)
Create a ClassLoader object by using the current ClassLoader
policy and the given class path.
|
public static final java.lang.String PARENT_FIRST
public static final java.lang.String CHILD_FIRST
public static final java.lang.String PARENT_ONLY
public static final java.lang.String CHILD_ONLY
public ClassLoaderFactory(java.io.File basedir, ClassLoaderFactory.ErrorHandler handler, java.lang.String policy) throws java.lang.IllegalArgumentException
basedir
- the base directory.handler
- the handler object that handles class loading problems.policy
- the class loader policy.java.lang.IllegalArgumentException
- when the policy is not a valid string.public java.lang.ClassLoader createClassLoader(java.lang.Object path)
path
- the class path. This can be either a String, a File,
or a list of paths.public java.lang.ClassLoader createClassLoader(java.lang.ClassLoader parent, java.lang.Object path)
parent
- the parent ClassLoader object.path
- the class path. This can be either a String, a File,
or a list of paths.public void addSysPackage(java.lang.String prefix)