Package net.sf.jasperreports.jdt
Class JRJdtCompiler
java.lang.Object
net.sf.jasperreports.engine.design.JRAbstractCompiler
net.sf.jasperreports.engine.design.JRAbstractJavaCompiler
net.sf.jasperreports.jdt.JRJdtCompiler
- All Implemented Interfaces:
JRCompiler
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
FieldsFields inherited from class net.sf.jasperreports.engine.design.JRAbstractJavaCompiler
EXCEPTION_MESSAGE_KEY_EXPECTED_JAVA_LANGUAGE, EXCEPTION_MESSAGE_KEY_EXPRESSION_CLASS_NOT_LOADED, PROPERTY_EVALUATOR_CLASS_REFERENCE_FIX_ENABLEDFields inherited from class net.sf.jasperreports.engine.design.JRAbstractCompiler
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, reportClassFilterFields inherited from interface net.sf.jasperreports.engine.design.JRCompiler
COMPILER_CLASS, COMPILER_CLASSPATH, COMPILER_KEEP_JAVA_FILE, COMPILER_PREFIX, COMPILER_TEMP_DIR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckLanguage(String language) Checks that the report language is supported by the compiler.protected StringcompileUnits(JRCompilationUnit[] units, String classpath, File tempDirFile) Compiles several expression evaluator units.protected JRCompilationSourceCodegenerateSourceCode(JRSourceCompileTask sourceTask) Generates expression evaluator code.protected Stringprotected JRJdtCompiler.CompilerRequestorgetCompilerRequestor(JRCompilationUnit[] units) protected org.eclipse.jdt.internal.compiler.env.INameEnvironmentgetNameEnvironment(JRCompilationUnit[] units) protected InputStreamgetResource(String resourceName) protected StringgetSourceFileName(String unitName) Returns the name of the source file where generated source code for an unit is saved.protected Class<?> protected JRCompilationUnitrecreateCompileUnit(JRCompilationUnit compilationUnit, Set<Method> missingMethods) Methods inherited from class net.sf.jasperreports.engine.design.JRAbstractJavaCompiler
classCacheKey, directValueFilter, getClassFromCache, loadClass, loadClass, loadEvaluator, putClassInCache, toCompiledClassesMethods inherited from class net.sf.jasperreports.engine.design.JRAbstractCompiler
compileReport, createCompileData, createEvaluator, effectiveDirectValueFilter, getSourceFile, getUnitName, getUnitName, getUnitName, getUnitName, getUnitName, loadEvaluator, loadEvaluator, loadEvaluator
-
Field Details
-
EXCEPTION_MESSAGE_KEY_CLASS_LOADING_ERROR
- See Also:
-
EXCEPTION_MESSAGE_KEY_NAME_ENVIRONMENT_ANSWER_INSTANCE_ERROR
- See Also:
-
-
Constructor Details
-
JRJdtCompiler
-
-
Method Details
-
compileUnits
Description copied from class:JRAbstractCompilerCompiles several expression evaluator units.The result of the compilation should be set by calling
setCompileDataon all compile units.- Specified by:
compileUnitsin classJRAbstractCompiler- Parameters:
units- the compilation unitsclasspath- the compilation classpathtempDirFile- temporary directory- Returns:
- a string containing compilation errors, or null if the compilation was successfull
-
getNameEnvironment
protected org.eclipse.jdt.internal.compiler.env.INameEnvironment getNameEnvironment(JRCompilationUnit[] units) -
getCompilerRequestor
-
getJdtSettings
-
getResource
-
loadClass
- Throws:
ClassNotFoundException
-
checkLanguage
Description copied from class:JRAbstractCompilerChecks that the report language is supported by the compiler.- Specified by:
checkLanguagein classJRAbstractCompiler- Parameters:
language- the report language- Throws:
JRException
-
recreateCompileUnit
protected JRCompilationUnit recreateCompileUnit(JRCompilationUnit compilationUnit, Set<Method> missingMethods) -
generateSourceCode
protected JRCompilationSourceCode generateSourceCode(JRSourceCompileTask sourceTask) throws JRException Description copied from class:JRAbstractCompilerGenerates expression evaluator code.- Specified by:
generateSourceCodein classJRAbstractCompiler- Parameters:
sourceTask- the source code generation information- Returns:
- generated expression evaluator code
- Throws:
JRException
-
getSourceFileName
Description copied from class:JRAbstractCompilerReturns the name of the source file where generated source code for an unit is saved.If the compiler needs source files for compilation or
COMPILER_KEEP_JAVA_FILEis set, the generated source will be saved in a file having the name returned by this method.- Specified by:
getSourceFileNamein classJRAbstractCompiler- Parameters:
unitName- the unit name- Returns:
- the source file name
-
getCompilerClass
- Overrides:
getCompilerClassin classJRAbstractCompiler
-