Class JRAbstractJavaCompiler
- java.lang.Object
-
- net.sf.jasperreports.engine.design.JRAbstractCompiler
-
- net.sf.jasperreports.engine.design.JRAbstractJavaCompiler
-
- All Implemented Interfaces:
JRCompiler
- Direct Known Subclasses:
JRAbstractClassCompiler
,JRGroovyCompiler
,JRJdtCompiler
public abstract class JRAbstractJavaCompiler extends JRAbstractCompiler
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXCEPTION_MESSAGE_KEY_EXPECTED_JAVA_LANGUAGE
static String
EXCEPTION_MESSAGE_KEY_EXPRESSION_CLASS_NOT_LOADED
static String
PROPERTY_EVALUATOR_CLASS_REFERENCE_FIX_ENABLED
Property that indicates whether a legacy fix for a JVM issue related to evaluator classes generated by JasperReports is enabled.-
Fields 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, reportClassFilter
-
Fields 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 Modifier Constructor Description protected
JRAbstractJavaCompiler(JasperReportsContext jasperReportsContext, boolean needsSourceFiles)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static Object
classCacheKey()
protected DirectExpressionValueFilter
directValueFilter()
protected static Class<?>
getClassFromCache(String className)
protected Class<?>
loadClass(String className, byte[] compileData)
protected Class<?>
loadClass(String className, CompiledClasses classes)
protected JREvaluator
loadEvaluator(Serializable compileData, String className)
Creates an expression evaluator instance from data saved when the report was compiled.protected static void
putClassInCache(String className, Class<?> loadedClass)
protected CompiledClasses
toCompiledClasses(String className, Serializable compileData)
-
Methods inherited from class net.sf.jasperreports.engine.design.JRAbstractCompiler
checkLanguage, compileReport, compileUnits, createCompileData, createEvaluator, effectiveDirectValueFilter, generateSourceCode, getCompilerClass, getSourceFile, getSourceFileName, getUnitName, getUnitName, getUnitName, getUnitName, getUnitName, loadEvaluator, loadEvaluator, loadEvaluator
-
-
-
-
Field Detail
-
PROPERTY_EVALUATOR_CLASS_REFERENCE_FIX_ENABLED
public static final String PROPERTY_EVALUATOR_CLASS_REFERENCE_FIX_ENABLED
Property that indicates whether a legacy fix for a JVM issue related to evaluator classes generated by JasperReports is enabled. The fix is enabled by default. Due to the fix, the garbage collector might not be able to collect a classloader that loaded JasperReports classes. This would be inconvenient in scenarios in which JasperReports classes are repeatedly loaded by different classloaders, e.g. when JasperReports is part of the classpath of a web application which is often reloaded. In such scenarios, set this property to false.- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_EXPECTED_JAVA_LANGUAGE
public static final String EXCEPTION_MESSAGE_KEY_EXPECTED_JAVA_LANGUAGE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_EXPRESSION_CLASS_NOT_LOADED
public static final String EXCEPTION_MESSAGE_KEY_EXPRESSION_CLASS_NOT_LOADED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JRAbstractJavaCompiler
protected JRAbstractJavaCompiler(JasperReportsContext jasperReportsContext, boolean needsSourceFiles)
-
-
Method Detail
-
directValueFilter
protected DirectExpressionValueFilter directValueFilter()
- Overrides:
directValueFilter
in classJRAbstractCompiler
-
loadEvaluator
protected JREvaluator loadEvaluator(Serializable compileData, String className) throws JRException
Description copied from class:JRAbstractCompiler
Creates an expression evaluator instance from data saved when the report was compiled.- Specified by:
loadEvaluator
in classJRAbstractCompiler
- Parameters:
compileData
- the data saved when the report was compiledclassName
- the evaluator unit name- Returns:
- an expression evaluator instance
- Throws:
JRException
-
toCompiledClasses
protected CompiledClasses toCompiledClasses(String className, Serializable compileData)
-
loadClass
protected Class<?> loadClass(String className, CompiledClasses classes)
-
classCacheKey
protected static Object classCacheKey()
-
-