Constructor and Description |
---|
CompilingLoader() |
CompilingLoader(java.lang.ClassLoader loader) |
CompilingLoader(java.lang.ClassLoader loader,
Path classDir)
Creates a new compiling class loader
|
CompilingLoader(java.lang.ClassLoader loader,
Path classDir,
Path sourceDir,
java.lang.String args,
java.lang.String encoding)
Creates a new compiling class loader
|
Modifier and Type | Method and Description |
---|---|
void |
addArg(java.lang.String arg)
Adds an argument.
|
protected void |
buildClassPath(java.util.ArrayList<java.lang.String> pathList)
Adds the classpath we're responsible for to the classpath
|
static DynamicClassLoader |
create(java.lang.ClassLoader parent,
Path classDir,
Path sourceDir,
java.lang.String args,
java.lang.String encoding)
Creates a new compiling class loader
|
static DynamicClassLoader |
create(Path path)
Create a class loader based on the compiling loader
|
protected ClassEntry |
getClassEntry(java.lang.String name,
java.lang.String pathName)
Loads the specified class, compiling if necessary.
|
java.lang.String |
getClassPath() |
protected java.security.CodeSource |
getCodeSource(Path path)
Returns the code source for the directory.
|
protected long |
getHashCrc(long crc64) |
Path |
getPath()
Gets the class path.
|
Path |
getPath(java.lang.String name)
Returns the path for the given name.
|
Path |
getSource()
Sets the source path.
|
void |
init()
Initialize.
|
boolean |
isDirectoryLoader() |
void |
make()
Compiles all changed files in the class directory.
|
protected java.lang.String |
prefixClassPath(java.lang.String tail) |
void |
setArgs(java.lang.String arg)
Sets the arguments.
|
void |
setBatch(boolean isBatch)
Sets true if compilation should batch as many files as possible.
|
void |
setCompiler(java.lang.String compiler)
Sets the compiler.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding.
|
void |
setPath(Path path)
Sets the class path.
|
void |
setRequireSource(boolean requireSource)
Sets true if source is required.
|
void |
setSource(Path path)
Sets the source path.
|
void |
setSourceExtension(java.lang.String ext)
Sets the source extension.
|
java.lang.String |
toString() |
buildSourcePath, destroy, getClassLoader, getResource, getResourceAsStream, getResources, loadClass, lookupPath, setLoader, validate
public CompilingLoader()
public CompilingLoader(java.lang.ClassLoader loader)
public CompilingLoader(java.lang.ClassLoader loader, Path classDir)
classDir
- generated class directory rootpublic CompilingLoader(java.lang.ClassLoader loader, Path classDir, Path sourceDir, java.lang.String args, java.lang.String encoding)
classDir
- generated class directory rootsourceDir
- Java source directory rootargs
- Javac argumentsencoding
- javac encodingpublic static DynamicClassLoader create(Path path)
path
- traditional classpathpublic void setPath(Path path)
public Path getPath()
public void setSource(Path path)
public void setSourceExtension(java.lang.String ext) throws ConfigException
ConfigException
public void setCompiler(java.lang.String compiler) throws ConfigException
ConfigException
public Path getSource()
public void setArgs(java.lang.String arg)
public void addArg(java.lang.String arg)
public void setEncoding(java.lang.String encoding)
public void setRequireSource(boolean requireSource)
public void setBatch(boolean isBatch)
public boolean isDirectoryLoader()
isDirectoryLoader
in class Loader
@PostConstruct public void init() throws ConfigException
init
in class Loader
ConfigException
public static DynamicClassLoader create(java.lang.ClassLoader parent, Path classDir, Path sourceDir, java.lang.String args, java.lang.String encoding)
classDir
- generated class directory rootsourceDir
- Java source directory rootargs
- Javac argumentsencoding
- javac encodingpublic java.lang.String getClassPath()
public void make() throws java.io.IOException, java.lang.ClassNotFoundException
protected ClassEntry getClassEntry(java.lang.String name, java.lang.String pathName) throws java.lang.ClassNotFoundException
getClassEntry
in class Loader
name
- name of the classjava.lang.ClassNotFoundException
protected java.security.CodeSource getCodeSource(Path path)
getCodeSource
in class Loader
public Path getPath(java.lang.String name)
protected long getHashCrc(long crc64)
getHashCrc
in class Loader
protected void buildClassPath(java.util.ArrayList<java.lang.String> pathList)
buildClassPath
in class Loader
head
- the overriding classpathprotected java.lang.String prefixClassPath(java.lang.String tail)
public java.lang.String toString()
toString
in class java.lang.Object