@Configurable public class SimpleLoader extends Loader
Constructor and Description |
---|
SimpleLoader()
Null constructor for the simple loader.
|
SimpleLoader(java.lang.ClassLoader loader) |
SimpleLoader(DynamicClassLoader loader,
Path path)
Creates the simple loader with the specified path.
|
SimpleLoader(DynamicClassLoader loader,
Path path,
java.lang.String prefix)
Creates the simple loader with the specified path and prefix.
|
Modifier and Type | Method and Description |
---|---|
protected void |
buildClassPath(java.util.ArrayList<java.lang.String> pathList)
Adds the class of this resource.
|
static DynamicClassLoader |
create(java.lang.ClassLoader parent,
Path path)
Create a class loader based on the SimpleLoader
|
static DynamicClassLoader |
create(java.lang.ClassLoader parent,
Path path,
java.lang.String prefix)
Create a class loader based on the SimpleLoader
|
static DynamicClassLoader |
create(Path path)
Create a class loader based on the SimpleLoader
|
protected java.security.CodeSource |
getCodeSource(Path path)
Returns the code source for the directory.
|
Path |
getPath()
Gets the resource path.
|
Path |
getPath(java.lang.String name)
Given a class or resource name, returns a patch to that resource.
|
java.lang.String |
getPrefix()
Gets the resource prefix
|
void |
init()
Initializes the loader.
|
boolean |
isDirectoryLoader()
The simple-loader scans class directories.
|
void |
setLoader(DynamicClassLoader loader)
Sets the owning class loader.
|
void |
setPath(Path path)
Sets the resource directory.
|
void |
setPrefix(java.lang.String prefix)
Sets the resource prefix
|
java.lang.String |
toString()
Returns a printable representation of the loader.
|
buildSourcePath, destroy, getClassEntry, getClassLoader, getHashCrc, getResource, getResourceAsStream, getResources, loadClass, lookupPath, validate
public SimpleLoader()
public SimpleLoader(java.lang.ClassLoader loader)
public SimpleLoader(DynamicClassLoader loader, Path path)
path
- specifying the root of the resourcespublic SimpleLoader(DynamicClassLoader loader, Path path, java.lang.String prefix)
path
- specifying the root of the resourcesprefix
- the prefix that the resources must matchpublic static DynamicClassLoader create(java.lang.ClassLoader parent, Path path, java.lang.String prefix)
parent
- parent class loaderpath
- traditional classpathprefix
- the class prefix restrictionpublic static DynamicClassLoader create(java.lang.ClassLoader parent, Path path)
parent
- parent class loaderpath
- traditional classpathpublic static DynamicClassLoader create(Path path)
path
- traditional classpathpublic void setPath(Path path)
public Path getPath()
public void setPrefix(java.lang.String prefix)
public java.lang.String getPrefix()
public void setLoader(DynamicClassLoader loader)
public boolean isDirectoryLoader()
isDirectoryLoader
in class Loader
@PostConstruct public void init() throws ConfigException
init
in class Loader
ConfigException
public Path getPath(java.lang.String name)
protected java.security.CodeSource getCodeSource(Path path)
getCodeSource
in class Loader
protected void buildClassPath(java.util.ArrayList<java.lang.String> pathList)
buildClassPath
in class Loader
public java.lang.String toString()
toString
in class java.lang.Object