Class CustomJRJdtCompiler

  • All Implemented Interfaces:
    net.sf.jasperreports.engine.design.JRCompiler

    public class CustomJRJdtCompiler
    extends net.sf.jasperreports.engine.design.JRAbstractJavaCompiler
    This class is a fork of net.sf.jasperreports.engine.design.JRJdtCompiler from JasperReports 6.3.0. It was modified to support JDT 4.2.2 which is required by some of the other components in our class-path i.e. Drools and Jetty.
    Author:
    jwhite, Teodor Danciu (teodord@users.sourceforge.net)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String EXCEPTION_MESSAGE_KEY_CLASS_LOADING_ERROR  
      static java.lang.String EXCEPTION_MESSAGE_KEY_NAME_ENVIRONMENT_ANSWER_INSTANCE_ERROR  
      • Fields 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_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
      • 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 
      Constructor Description
      CustomJRJdtCompiler​(net.sf.jasperreports.engine.JasperReportsContext jasperReportsContext)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void checkLanguage​(java.lang.String language)  
      protected java.lang.String compileUnits​(net.sf.jasperreports.engine.design.JRCompilationUnit[] units, java.lang.String classpath, java.io.File tempDirFile)  
      protected net.sf.jasperreports.engine.design.JRCompilationSourceCode generateSourceCode​(net.sf.jasperreports.engine.design.JRSourceCompileTask sourceTask)  
      protected java.lang.String getCompilerClass()  
      protected CustomJRJdtCompiler.CompilerRequestor getCompilerRequestor​(net.sf.jasperreports.engine.design.JRCompilationUnit[] units)  
      protected org.eclipse.jdt.internal.compiler.impl.CompilerOptions getJdtSettings()  
      protected org.eclipse.jdt.internal.compiler.env.INameEnvironment getNameEnvironment​(net.sf.jasperreports.engine.design.JRCompilationUnit[] units)  
      protected java.io.InputStream getResource​(java.lang.String resourceName)  
      protected java.lang.String getSourceFileName​(java.lang.String unitName)  
      protected java.lang.Class<?> loadClass​(java.lang.String className)  
      protected net.sf.jasperreports.engine.design.JRCompilationUnit recreateCompileUnit​(net.sf.jasperreports.engine.design.JRCompilationUnit compilationUnit, java.util.Set<java.lang.reflect.Method> missingMethods)  
      • Methods inherited from class net.sf.jasperreports.engine.design.JRAbstractJavaCompiler

        classCacheKey, getClassFromCache, loadEvaluator, putClassInCache
      • Methods inherited from class net.sf.jasperreports.engine.design.JRAbstractCompiler

        compileReport, getSourceFile, getUnitName, getUnitName, getUnitName, getUnitName, getUnitName, loadEvaluator, loadEvaluator, loadEvaluator
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EXCEPTION_MESSAGE_KEY_CLASS_LOADING_ERROR

        public static final java.lang.String EXCEPTION_MESSAGE_KEY_CLASS_LOADING_ERROR
        See Also:
        Constant Field Values
      • EXCEPTION_MESSAGE_KEY_NAME_ENVIRONMENT_ANSWER_INSTANCE_ERROR

        public static final java.lang.String EXCEPTION_MESSAGE_KEY_NAME_ENVIRONMENT_ANSWER_INSTANCE_ERROR
        See Also:
        Constant Field Values
    • Constructor Detail

      • CustomJRJdtCompiler

        public CustomJRJdtCompiler​(net.sf.jasperreports.engine.JasperReportsContext jasperReportsContext)
    • Method Detail

      • compileUnits

        protected java.lang.String compileUnits​(net.sf.jasperreports.engine.design.JRCompilationUnit[] units,
                                                java.lang.String classpath,
                                                java.io.File tempDirFile)
        Specified by:
        compileUnits in class net.sf.jasperreports.engine.design.JRAbstractCompiler
      • getNameEnvironment

        protected org.eclipse.jdt.internal.compiler.env.INameEnvironment getNameEnvironment​(net.sf.jasperreports.engine.design.JRCompilationUnit[] units)
      • getJdtSettings

        protected org.eclipse.jdt.internal.compiler.impl.CompilerOptions getJdtSettings()
      • getResource

        protected java.io.InputStream getResource​(java.lang.String resourceName)
      • loadClass

        protected java.lang.Class<?> loadClass​(java.lang.String className)
                                        throws java.lang.ClassNotFoundException
        Throws:
        java.lang.ClassNotFoundException
      • checkLanguage

        protected void checkLanguage​(java.lang.String language)
                              throws net.sf.jasperreports.engine.JRException
        Specified by:
        checkLanguage in class net.sf.jasperreports.engine.design.JRAbstractCompiler
        Throws:
        net.sf.jasperreports.engine.JRException
      • recreateCompileUnit

        protected net.sf.jasperreports.engine.design.JRCompilationUnit recreateCompileUnit​(net.sf.jasperreports.engine.design.JRCompilationUnit compilationUnit,
                                                                                           java.util.Set<java.lang.reflect.Method> missingMethods)
      • generateSourceCode

        protected net.sf.jasperreports.engine.design.JRCompilationSourceCode generateSourceCode​(net.sf.jasperreports.engine.design.JRSourceCompileTask sourceTask)
                                                                                         throws net.sf.jasperreports.engine.JRException
        Specified by:
        generateSourceCode in class net.sf.jasperreports.engine.design.JRAbstractCompiler
        Throws:
        net.sf.jasperreports.engine.JRException
      • getSourceFileName

        protected java.lang.String getSourceFileName​(java.lang.String unitName)
        Specified by:
        getSourceFileName in class net.sf.jasperreports.engine.design.JRAbstractCompiler
      • getCompilerClass

        protected java.lang.String getCompilerClass()
        Overrides:
        getCompilerClass in class net.sf.jasperreports.engine.design.JRAbstractCompiler