public class JavaClassGenerator
extends java.lang.Object
Constructor and Description |
---|
JavaClassGenerator() |
Modifier and Type | Method and Description |
---|---|
void |
addPendingFile(java.lang.String javaPath) |
void |
addPendingFiles(java.lang.String[] files) |
static java.lang.String |
cleanClassName(java.lang.String className)
Sets the full generated class.
|
java.lang.Class |
compile(java.lang.String fullClassName)
Compiles the Java code
|
void |
compileJava(java.lang.String fullClassName)
Compiles the class.
|
void |
compilePendingJava()
Compiles the pending files
|
void |
generate(GenClass javaClass)
Call to generate the java source.
|
Path |
getClassFilePath(java.lang.String className) |
java.lang.ClassLoader |
getClassLoader()
Gets the class loader.
|
static Path |
getDefaultSearchPath()
Returns the default merge path
|
java.lang.ClassLoader |
getParentLoader()
Sets the parent class loader.
|
java.lang.String[] |
getPendingFiles()
Returns the pending Java files.
|
java.lang.ClassLoader |
getPreloadLoader()
Sets the parent class loader.
|
Path |
getSearchPath()
Returns the assigned search path.
|
Path |
getWorkDir()
Returns the class dir for the generated class.
|
boolean |
isModified(java.lang.Class<?> cl)
Returns true if the class is modified.
|
java.lang.Class<?> |
load(java.lang.String fullClassName)
Try to preload the class.
|
java.lang.Class<?> |
loadClass(java.lang.String fullClassName)
Loads the generated class.
|
java.lang.Class<?> |
loadClass(java.lang.String fullClassName,
boolean preload)
Loads the generated class.
|
java.lang.Class<?> |
loadClassParentLoader(java.lang.String fullClassName,
java.lang.Class<?> parentClass)
Loads the generated class into the parent loader.
|
java.lang.Class<?> |
preload(java.lang.String fullClassName)
Try to preload the class.
|
java.lang.Class<?> |
preloadClassParentLoader(java.lang.String fullClassName,
java.lang.Class<?> parentClass)
Loads the generated class into the parent loader.
|
boolean |
preloadExists(java.lang.String fullClassName)
Checks if the preload exists
|
void |
setEncoding(java.lang.String encoding) |
void |
setLoader(java.lang.ClassLoader loader)
Sets the class loader.
|
void |
setParentLoader(java.lang.ClassLoader loader)
Sets the parent class loader.
|
void |
setSearchPath(Path path)
Sets the search path.
|
void |
setWorkDir(Path workPath)
Sets the work path for the generated class.
|
public static java.lang.String cleanClassName(java.lang.String className)
public static Path getDefaultSearchPath()
public void setSearchPath(Path path)
public Path getSearchPath()
public void setEncoding(java.lang.String encoding)
public void setParentLoader(java.lang.ClassLoader loader)
loader
- parent class loaderpublic void setLoader(java.lang.ClassLoader loader)
loader
- parent class loaderpublic java.lang.ClassLoader getClassLoader()
public java.lang.ClassLoader getParentLoader()
public java.lang.ClassLoader getPreloadLoader()
public void setWorkDir(Path workPath)
public Path getWorkDir()
public java.lang.Class<?> preload(java.lang.String fullClassName)
public java.lang.Class<?> load(java.lang.String fullClassName)
public Path getClassFilePath(java.lang.String className)
public void generate(GenClass javaClass) throws java.lang.Exception
java.lang.Exception
public void addPendingFile(java.lang.String javaPath)
public java.lang.Class compile(java.lang.String fullClassName) throws java.lang.Exception
java.lang.Exception
public void compileJava(java.lang.String fullClassName) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.String[] getPendingFiles()
public void addPendingFiles(java.lang.String[] files)
public void compilePendingJava() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.Class<?> loadClass(java.lang.String fullClassName) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public boolean preloadExists(java.lang.String fullClassName)
public java.lang.Class<?> loadClass(java.lang.String fullClassName, boolean preload) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public java.lang.Class<?> preloadClassParentLoader(java.lang.String fullClassName, java.lang.Class<?> parentClass)
public java.lang.Class<?> loadClassParentLoader(java.lang.String fullClassName, java.lang.Class<?> parentClass) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public boolean isModified(java.lang.Class<?> cl)