public abstract class CompilerStrategy extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CompilerStrategy.SourceCodeGenerationException |
| Modifier and Type | Field and Description |
|---|---|
protected String |
pathToWriteClassFiles |
protected String |
pathToWriteSourceFiles |
protected static String |
WRITE_RELATIVE_TO_CLASSPATH |
protected boolean |
writeClassFiles |
protected boolean |
writeSourceFiles |
| Modifier | Constructor and Description |
|---|---|
protected |
CompilerStrategy(String writeSourceByDefault,
String writeClassByDefault) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
assureTypeIsAccessible(Class<?> type)
Verify that the Class provided is accessible to the compiler/generator.
|
abstract Class<?> |
compileClass(SourceCodeContext sourceCode)
Compile and return the (generated) class; this will also cause the
generated class to be detached from the class-pool, and any (optional)
source and/or class files to be written.
|
protected File |
preparePackageOutputPath(String basePath,
String packageName)
Prepares the output path for a given package based on the provided base path string.
|
protected final boolean writeSourceFiles
protected final boolean writeClassFiles
protected final String pathToWriteSourceFiles
protected final String pathToWriteClassFiles
protected static final String WRITE_RELATIVE_TO_CLASSPATH
public abstract Class<?> compileClass(SourceCodeContext sourceCode) throws CompilerStrategy.SourceCodeGenerationException
CompilerStrategy.SourceCodeGenerationExceptionpublic abstract void assureTypeIsAccessible(Class<?> type) throws CompilerStrategy.SourceCodeGenerationException
type - CompilerStrategy.SourceCodeGenerationException - if the type is not accessibleprotected File preparePackageOutputPath(String basePath, String packageName) throws IOException
basePath - packageName - IOExceptionCopyright © 2017 Glasnost. All Rights Reserved.