public static String[] getExpressionLanguages(JasperReportsConfiguration jconfig) { Set<String> compilers = new HashSet<String>(); compilers.add(JRReport.LANGUAGE_JAVA); Map<String, String> params = jconfig.getProperties(); for (String key : params.keySet()) { if (key.startsWith(JRCompiler.COMPILER_PREFIX)) { try { if (jconfig.getClassLoader() != null) { Class<?> clazz = jconfig.getClassLoader().loadClass(params.get(key)); if (JRCompiler.class.isAssignableFrom(clazz)) compilers.add(key.substring(JRCompiler.COMPILER_PREFIX.length()).toLowerCase()); } } catch (ClassNotFoundException e) { } } } String[] langs = new String[compilers.size() + 1]; langs[0] = ""; //$NON-NLS-1$ int i = 1; for (String lang : compilers) langs[i++] = lang; return langs; }
@SuppressWarnings("deprecation") private void setCompilerClass(String compile) { if (compiler != null) { jasperReportsContext.setProperty(JRCompiler.COMPILER_CLASS, compiler); } }
/** * */ @SuppressWarnings("deprecation") protected void loadSystemProperties() { loadSystemProperty("jasper.reports.compiler.class", JRCompiler.COMPILER_CLASS); loadSystemProperty("jasper.reports.compile.xml.validation", JRReportSaxParserFactory.COMPILER_XML_VALIDATION); loadSystemProperty("jasper.reports.export.xml.validation", PrintSaxParserFactory.EXPORT_XML_VALIDATION); loadSystemProperty("jasper.reports.compile.keep.java.file", JRCompiler.COMPILER_KEEP_JAVA_FILE); loadSystemProperty("jasper.reports.compile.temp", JRCompiler.COMPILER_TEMP_DIR); loadSystemProperty("jasper.reports.compile.class.path", JRCompiler.COMPILER_CLASSPATH); }
/** * */ public JREvaluator getEvaluator(JasperReport jasperReport, JRDataset dataset) throws JRException { JRCompiler compiler = getCompiler(jasperReport); JREvaluator evaluator = compiler.loadEvaluator(jasperReport, dataset); initialize(evaluator); return evaluator; }
/** * */ public JREvaluator getEvaluator(JasperReport jasperReport, JRCrosstab crosstab) throws JRException { JRCompiler compiler = getCompiler(jasperReport); JREvaluator evaluator = compiler.loadEvaluator(jasperReport, crosstab); initialize(evaluator); return evaluator; }
/** * */ @SuppressWarnings("deprecation") private String getCompilerClassProperty() { return JRPropertiesUtil.getInstance(jasperReportsContext).getProperty(JRCompiler.COMPILER_CLASS); }
private void clean() { // System.out.println("------------------------------------------"); map = new HashMap<String, JRCompiler>(); mtype = new HashMap<String, byte[]>(); mpack = new HashMap<String, Boolean>(); }