@Override public void processProblems() { for (int i = 0; i < units.length; i++) { JRCompilationSourceCode sourceCode = units[i].getCompilationSource(); IProblem[] problems = unitResults[i].getProblems(); if (problems != null) { for (int j = 0; j < problems.length; j++) { IProblem problem = problems[j]; int line = problem.getSourceLineNumber(); JRExpression expression = sourceCode.getExpressionAtLine(line); if (expression == null) errorHandler.addMarker(problem, null); else if (!addExpressionError(expression)) errorHandler.addMarker(problem, digester.getLocation(expression), expression); } } } }
@Override protected JRCompilationSourceCode generateSourceCode( JRSourceCompileTask sourceTask) throws JRException { //no source code return null; }
@Override protected JRCompilationSourceCode generateSourceCode( JRSourceCompileTask sourceTask) throws JRException { // TODO (12.04.2013, Donat, Open Software Solutions): Create a evaluator instance per call and serialize it JEvalExpressionEvaluator evaluator = new JEvalExpressionEvaluator(); evaluator.initializeWithDefaults(sourceTask); evaluator.parseExpressions(sourceTask); evaluators.put(sourceTask.getUnitName(), evaluator); return new JRDefaultCompilationSourceCode(sourceTask.getUnitName(),null); }
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); }
public void acceptResult(CompilationResult result) { super.acceptResult(result); if (result.hasErrors()) { String className = String.valueOf(result.getCompilationUnit().getMainTypeName()); JRCompilationUnit unit = null; for (int classIdx = 0; classIdx < units.length; ++classIdx) { if (className.equals(units[classIdx].getName())) { unit = units[classIdx]; break; } } IProblem[] errors = result.getErrors(); for (int i = 0; i < errors.length; i++) { IProblem problem = errors[i]; int line = problem.getSourceLineNumber(); JRCompilationSourceCode sourceCode = unit.getCompilationSource(); JRExpression expression = sourceCode.getExpressionAtLine(line); if (expression == null) { getErrorHandler().addMarker( problem, null); } else if (addExpressionError(expression, problem)) { SourceLocation location = getDigester().getLocation(expression); getErrorHandler().addMarker(problem, expression, location); } } } }
@Override protected JRCompilationSourceCode generateSourceCode(JRSourceCompileTask sourceTask) throws JRException { return new JRDefaultCompilationSourceCode(JRBshGenerator.generateScript(sourceTask), null); }
@Override protected JRCompilationSourceCode generateSourceCode(JRSourceCompileTask sourceTask) throws JRException { return new JRDefaultCompilationSourceCode(JRGroovyGenerator.generateClass(sourceTask), null); }
protected JRCompilationSourceCode generateSourceCode(JRSourceCompileTask sourceTask) throws JRException { return JRClassGenerator.generateClass(sourceTask); }
/** * @see net.sf.jasperreports.engine.design.JRAbstractCompiler#generateSourceCode(net.sf.jasperreports.engine.design.JRSourceCompileTask) */ @Override protected JRCompilationSourceCode generateSourceCode( JRSourceCompileTask sourceTask) throws JRException { return new JRDefaultCompilationSourceCode(JRScalaGenerator.generateClass(sourceTask), null); }