public class SimpleCompiler extends Cookable implements ISimpleCompiler
BOOT_CLASS_LOADER, SYSTEM_PROPERTY_SOURCE_DEBUGGING_DIR, SYSTEM_PROPERTY_SOURCE_DEBUGGING_ENABLE
Constructor and Description |
---|
SimpleCompiler() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertCooked()
Throw an
IllegalStateException if this Cookable is not yet cooked. |
protected void |
assertNotCooked()
Throw an
IllegalStateException if this Cookable is already cooked. |
protected void |
cook(javax.tools.JavaFileObject compilationUnit) |
void |
cook(String optionalFileName,
Reader r)
Reads, scans, parses and compiles Java tokens from the given
Reader . |
ClassLoader |
getClassLoader()
Returns a
ClassLoader object through which the previously compiled classes can be accessed. |
void |
setDebuggingInformation(boolean debugSource,
boolean debugLines,
boolean debugVars)
Determines what kind of debugging information is included in the generates classes.
|
void |
setParentClassLoader(ClassLoader optionalParentClassLoader)
The "parent class loader" is used to load referenced classes.
|
void |
setParentClassLoader(ClassLoader optionalParentClassLoader,
Class<?>[] auxiliaryClasses)
Deprecated.
|
cook, cook, cook, cook, cook, cook, cook, cookFile, cookFile, cookFile, cookFile, readString
public ClassLoader getClassLoader()
ISimpleCompiler
ClassLoader
object through which the previously compiled classes can be accessed. This ClassLoader
can be used for subsequent ISimpleCompiler
s in order to compile compilation units that use
types (e.g. declare derived types) declared in the previous one.
This method must only be called after exactly on of the ICookable.cook(String, java.io.Reader)
methods was called.
getClassLoader
in interface ISimpleCompiler
public void cook(String optionalFileName, Reader r) throws CompileException, IOException
ICookable
Reader
.cook
in interface ICookable
cook
in class Cookable
optionalFileName
- Used when reporting errors and warnings.CompileException
IOException
protected void cook(javax.tools.JavaFileObject compilationUnit) throws CompileException, IOException
CompileException
IOException
public void setDebuggingInformation(boolean debugSource, boolean debugLines, boolean debugVars)
ICookable
setDebuggingInformation
in interface ICookable
public void setParentClassLoader(ClassLoader optionalParentClassLoader)
ICookable
System.getSystemClassLoader() |
The running JVM's class path |
Thread.currentThread().getContextClassLoader() or null |
The class loader effective for the invoking thread |
ICookable.BOOT_CLASS_LOADER |
The running JVM's boot class path |
setParentClassLoader
in interface ICookable
@Deprecated public void setParentClassLoader(ClassLoader optionalParentClassLoader, Class<?>[] auxiliaryClasses)
optionalParentClassLoader
- auxiliaryClasses
- protected void assertCooked()
IllegalStateException
if this Cookable
is not yet cooked.protected void assertNotCooked()
IllegalStateException
if this Cookable
is already cooked.Copyright © 2001–2014. All rights reserved.