01: /**
02: * ===========================================
03: * JFreeReport : a free Java reporting library
04: * ===========================================
05: *
06: * Project Info: http://reporting.pentaho.org/
07: *
08: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
09: *
10: * This library is free software; you can redistribute it and/or modify it under the terms
11: * of the GNU Lesser General Public License as published by the Free Software Foundation;
12: * either version 2.1 of the License, or (at your option) any later version.
13: *
14: * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15: * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16: * See the GNU Lesser General Public License for more details.
17: *
18: * You should have received a copy of the GNU Lesser General Public License along with this
19: * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20: * Boston, MA 02111-1307, USA.
21: *
22: * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
23: * in the United States and other countries.]
24: *
25: * ------------
26: * ExpressionRuntime.java
27: * ------------
28: * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
29: */package org.jfree.report.function;
30:
31: import javax.swing.table.TableModel;
32:
33: import org.jfree.report.DataRow;
34: import org.jfree.report.ResourceBundleFactory;
35: import org.jfree.util.Configuration;
36:
37: /**
38: * The expression runtime encapsulates all properties of the current report processing run that might be needed to
39: * successfully evaluate an expression. The runtime grants access to the DataRow, the TableModel of the current report
40: * and the ProcessingContext.
41: *
42: * @author Thomas Morgner
43: */
44: public interface ExpressionRuntime {
45: /**
46: * Returns the current data-row. The datarow can be used to access the computed values of all expressions and
47: * functions and the current row in the tablemodel.
48: *
49: * @return the data-row.
50: */
51: public DataRow getDataRow();
52:
53: /**
54: * Returns the report configuration that was used to initiate this processing run.
55: *
56: * @return the report configuration.
57: */
58: public Configuration getConfiguration();
59:
60: /**
61: * Returns the resource-bundle factory of current processing context.
62: *
63: * @return the current resource-bundle factory.
64: */
65: public ResourceBundleFactory getResourceBundleFactory();
66:
67: /**
68: * Grants access to the tablemodel was granted using report properties, now direct.
69: *
70: * @return the current tablemodel used in the report.
71: */
72: public TableModel getData();
73:
74: /**
75: * Returns the number of the row in the tablemodel that is currently being processed.
76: *
77: * @return the current row number.
78: */
79: public int getCurrentRow();
80:
81: /**
82: * Returns the current export descriptor as returned by the OutputProcessorMetaData object. The output descriptor is a
83: * simple string collections consisting of the following components: exportclass/type/subtype
84: * <p/>
85: * For example, the PDF export would be: pageable/pdf and the StreamHTML export would return table/html/stream
86: *
87: * @return the export descriptor.
88: */
89: public String getExportDescriptor();
90:
91: /**
92: * Returns the current processing context.
93: *
94: * @return the processing context.
95: */
96: public ProcessingContext getProcessingContext();
97: }
|