Search in sources :

Example 1 with JRCompilationSourceCode

use of net.sf.jasperreports.engine.design.JRCompilationSourceCode in project opennms by OpenNMS.

the class CustomJRJdtCompiler method recreateCompileUnit.

protected JRCompilationUnit recreateCompileUnit(JRCompilationUnit compilationUnit, Set<Method> missingMethods) {
    String unitName = compilationUnit.getName();
    JRSourceCompileTask sourceTask = compilationUnit.getCompileTask();
    JRCompilationSourceCode sourceCode = JRClassGenerator.modifySource(sourceTask, missingMethods, compilationUnit.getSourceCode());
    File sourceFile = compilationUnit.getSourceFile();
    File saveSourceDir = sourceFile == null ? null : sourceFile.getParentFile();
    sourceFile = getSourceFile(saveSourceDir, unitName, sourceCode);
    return new JRCompilationUnit(unitName, sourceCode, sourceFile, compilationUnit.getExpressions(), sourceTask);
}
Also used : JRSourceCompileTask(net.sf.jasperreports.engine.design.JRSourceCompileTask) JRCompilationUnit(net.sf.jasperreports.engine.design.JRCompilationUnit) JRCompilationSourceCode(net.sf.jasperreports.engine.design.JRCompilationSourceCode) ClassFile(org.eclipse.jdt.internal.compiler.ClassFile) File(java.io.File)

Aggregations

File (java.io.File)1 JRCompilationSourceCode (net.sf.jasperreports.engine.design.JRCompilationSourceCode)1 JRCompilationUnit (net.sf.jasperreports.engine.design.JRCompilationUnit)1 JRSourceCompileTask (net.sf.jasperreports.engine.design.JRSourceCompileTask)1 ClassFile (org.eclipse.jdt.internal.compiler.ClassFile)1