public class JRJdtCompiler extends JRAbstractJavaCompiler
Modifier and Type | Class and Description |
---|---|
static class |
JRJdtCompiler.CompilationUnit |
static class |
JRJdtCompiler.CompilationUnitResult |
static class |
JRJdtCompiler.CompilerRequestor |
Modifier and Type | Field and Description |
---|---|
static String |
EXCEPTION_MESSAGE_KEY_CLASS_LOADING_ERROR |
static String |
EXCEPTION_MESSAGE_KEY_NAME_ENVIRONMENT_ANSWER_INSTANCE_ERROR |
EXCEPTION_MESSAGE_KEY_EXPECTED_JAVA_LANGUAGE, EXCEPTION_MESSAGE_KEY_EXPRESSION_CLASS_NOT_LOADED, PROPERTY_EVALUATOR_CLASS_REFERENCE_FIX_ENABLED
EXCEPTION_MESSAGE_KEY_CROSSTAB_ID_NOT_FOUND, EXCEPTION_MESSAGE_KEY_DESIGN_COMPILE_ERROR, EXCEPTION_MESSAGE_KEY_LANGUAGE_NOT_SUPPORTED, EXCEPTION_MESSAGE_KEY_REPORT_EXPRESSIONS_COMPILE_ERROR, EXCEPTION_MESSAGE_KEY_TEMP_DIR_NOT_FOUND, jasperReportsContext
COMPILER_CLASS, COMPILER_CLASSPATH, COMPILER_KEEP_JAVA_FILE, COMPILER_PREFIX, COMPILER_TEMP_DIR
Constructor and Description |
---|
JRJdtCompiler(JasperReportsContext jasperReportsContext) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkLanguage(String language)
Checks that the report language is supported by the compiler.
|
protected String |
compileUnits(JRCompilationUnit[] units,
String classpath,
File tempDirFile)
Compiles several expression evaluator units.
|
protected JRCompilationSourceCode |
generateSourceCode(JRSourceCompileTask sourceTask)
Generates expression evaluator code.
|
protected String |
getCompilerClass() |
protected JRJdtCompiler.CompilerRequestor |
getCompilerRequestor(JRCompilationUnit[] units) |
protected Map<String,String> |
getJdtSettings() |
protected org.eclipse.jdt.internal.compiler.env.INameEnvironment |
getNameEnvironment(JRCompilationUnit[] units) |
protected InputStream |
getResource(String resourceName) |
protected String |
getSourceFileName(String unitName)
Returns the name of the source file where generated source code for an unit is saved.
|
protected Class<?> |
loadClass(String className) |
protected JRCompilationUnit |
recreateCompileUnit(JRCompilationUnit compilationUnit,
Set<Method> missingMethods) |
classCacheKey, getClassFromCache, loadEvaluator, putClassInCache
compileReport, getSourceFile, getUnitName, getUnitName, getUnitName, getUnitName, getUnitName, loadEvaluator, loadEvaluator, loadEvaluator
public static final String EXCEPTION_MESSAGE_KEY_CLASS_LOADING_ERROR
public static final String EXCEPTION_MESSAGE_KEY_NAME_ENVIRONMENT_ANSWER_INSTANCE_ERROR
public JRJdtCompiler(JasperReportsContext jasperReportsContext)
protected String compileUnits(JRCompilationUnit[] units, String classpath, File tempDirFile)
JRAbstractCompiler
The result of the compilation should be set by calling
setCompileData
on all compile units.
compileUnits
in class JRAbstractCompiler
units
- the compilation unitsclasspath
- the compilation classpathtempDirFile
- temporary directoryprotected org.eclipse.jdt.internal.compiler.env.INameEnvironment getNameEnvironment(JRCompilationUnit[] units)
protected JRJdtCompiler.CompilerRequestor getCompilerRequestor(JRCompilationUnit[] units)
protected InputStream getResource(String resourceName)
protected Class<?> loadClass(String className) throws ClassNotFoundException
ClassNotFoundException
protected void checkLanguage(String language) throws JRException
JRAbstractCompiler
checkLanguage
in class JRAbstractCompiler
language
- the report languageJRException
protected JRCompilationUnit recreateCompileUnit(JRCompilationUnit compilationUnit, Set<Method> missingMethods)
protected JRCompilationSourceCode generateSourceCode(JRSourceCompileTask sourceTask) throws JRException
JRAbstractCompiler
generateSourceCode
in class JRAbstractCompiler
sourceTask
- the source code generation informationJRException
protected String getSourceFileName(String unitName)
JRAbstractCompiler
If the compiler needs source files for compilation
or COMPILER_KEEP_JAVA_FILE
is set, the generated source
will be saved in a file having the name returned by this method.
getSourceFileName
in class JRAbstractCompiler
unitName
- the unit nameprotected String getCompilerClass()
getCompilerClass
in class JRAbstractCompiler
Copyright © 2017. All rights reserved.