Package org.apache.bsf

Examples of org.apache.bsf.BSFManager.declareBean()


/** Returns BSFManager for <var>language</var>. */
public BSFManager getBsfManager(String language) throws BSFException {
    BSFManager manager = (BSFManager)managers.get(language);
    if (manager == null) {
  manager = new BSFManager();
  manager.declareBean("report", report, Report.class);
  BSFManager.registerScriptingEngine(language,
             (String)languages.get(language), null);
  managers.put(language, manager);
    }
    return manager;
View Full Code Here


    runtimeWrapper.update(null, getRuntime());
    legacyDataRowWrapper.setParent(getDataRow());
    try
    {
      final BSFManager interpreter = new BSFManager();
      interpreter.declareBean("chart", originalChart, JFreeChart.class); //$NON-NLS-1$
      interpreter.declareBean("runtime", runtimeWrapper, ExpressionRuntime.class); //$NON-NLS-1$
      interpreter.declareBean("dataRow", legacyDataRowWrapper, DataRow.class); //$NON-NLS-1$
      final Object o = interpreter.eval
          (postProcessingLanguage, "expression", 1, 1, postProcessingScript); //$NON-NLS-1$
      if (o instanceof JFreeChart)
View Full Code Here

    legacyDataRowWrapper.setParent(getDataRow());
    try
    {
      final BSFManager interpreter = new BSFManager();
      interpreter.declareBean("chart", originalChart, JFreeChart.class); //$NON-NLS-1$
      interpreter.declareBean("runtime", runtimeWrapper, ExpressionRuntime.class); //$NON-NLS-1$
      interpreter.declareBean("dataRow", legacyDataRowWrapper, DataRow.class); //$NON-NLS-1$
      final Object o = interpreter.eval
          (postProcessingLanguage, "expression", 1, 1, postProcessingScript); //$NON-NLS-1$
      if (o instanceof JFreeChart)
      {
View Full Code Here

    try
    {
      final BSFManager interpreter = new BSFManager();
      interpreter.declareBean("chart", originalChart, JFreeChart.class); //$NON-NLS-1$
      interpreter.declareBean("runtime", runtimeWrapper, ExpressionRuntime.class); //$NON-NLS-1$
      interpreter.declareBean("dataRow", legacyDataRowWrapper, DataRow.class); //$NON-NLS-1$
      final Object o = interpreter.eval
          (postProcessingLanguage, "expression", 1, 1, postProcessingScript); //$NON-NLS-1$
      if (o instanceof JFreeChart)
      {
        return (JFreeChart) o;
View Full Code Here

    }

    try
    {
      final BSFManager interpreter = new BSFManager();
      interpreter.declareBean("definition", definition, MasterReport.class); //$NON-NLS-1$
      interpreter.declareBean("flowController", flowController, DefaultFlowController.class); //$NON-NLS-1$
      final Object o = interpreter.eval(getLanguage(), "expression", 1, 1, script);
      if (o instanceof MasterReport == false)
      {
        throw new ReportDataFactoryException("Not a MasterReport");
View Full Code Here

    try
    {
      final BSFManager interpreter = new BSFManager();
      interpreter.declareBean("definition", definition, MasterReport.class); //$NON-NLS-1$
      interpreter.declareBean("flowController", flowController, DefaultFlowController.class); //$NON-NLS-1$
      final Object o = interpreter.eval(getLanguage(), "expression", 1, 1, script);
      if (o instanceof MasterReport == false)
      {
        throw new ReportDataFactoryException("Not a MasterReport");
      }
View Full Code Here

    }

    try
    {
      final BSFManager interpreter = new BSFManager();
      interpreter.declareBean("definition", definition, SubReport.class); //$NON-NLS-1$
      interpreter.declareBean("flowController", flowController, DefaultFlowController.class); //$NON-NLS-1$
      final Object o = interpreter.eval(getLanguage(), "expression", 1, 1, script);
      if (o instanceof SubReport == false)
      {
        throw new ReportDataFactoryException("Not a MasterReport");
View Full Code Here

    try
    {
      final BSFManager interpreter = new BSFManager();
      interpreter.declareBean("definition", definition, SubReport.class); //$NON-NLS-1$
      interpreter.declareBean("flowController", flowController, DefaultFlowController.class); //$NON-NLS-1$
      final Object o = interpreter.eval(getLanguage(), "expression", 1, 1, script);
      if (o instanceof SubReport == false)
      {
        throw new ReportDataFactoryException("Not a MasterReport");
      }
View Full Code Here

            BSFManager mgr = getManager();
            if (mgr == null) {
                log.error("Problem creating BSF manager");
                return;
            }
            mgr.declareBean("sampleEvent", event, SampleEvent.class);
            SampleResult result = event.getResult();
            mgr.declareBean("sampleResult", result, SampleResult.class);
            processFileOrScript(mgr);
            mgr.terminate();
        } catch (BSFException e) {
View Full Code Here

                log.error("Problem creating BSF manager");
                return;
            }
            mgr.declareBean("sampleEvent", event, SampleEvent.class);
            SampleResult result = event.getResult();
            mgr.declareBean("sampleResult", result, SampleResult.class);
            processFileOrScript(mgr);
            mgr.terminate();
        } catch (BSFException e) {
            log.warn("Problem in BSF script "+e);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.