001    /**
002     * ========================================
003     * JFreeReport : a free Java report library
004     * ========================================
005     *
006     * Project Info:  http://reporting.pentaho.org/
007     *
008     * (C) Copyright 2000-2007, by Object Refinery Limited, Pentaho Corporation and Contributors.
009     *
010     * This library is free software; you can redistribute it and/or modify it under the terms
011     * of the GNU Lesser General Public License as published by the Free Software Foundation;
012     * either version 2.1 of the License, or (at your option) any later version.
013     *
014     * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
015     * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016     * See the GNU Lesser General Public License for more details.
017     *
018     * You should have received a copy of the GNU Lesser General Public License along with this
019     * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
020     * Boston, MA 02111-1307, USA.
021     *
022     * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
023     * in the United States and other countries.]
024     *
025     * ------------
026     * $Id: LayoutExpressionRuntime.java 2725 2007-04-01 18:49:29Z taqua $
027     * ------------
028     * (C) Copyright 2000-2005, by Object Refinery Limited.
029     * (C) Copyright 2005-2007, by Pentaho Corporation.
030     */
031    package org.jfree.report.flow;
032    
033    import org.jfree.report.DataRow;
034    import org.jfree.report.ReportData;
035    import org.jfree.report.expressions.ExpressionRuntime;
036    import org.jfree.report.i18n.ResourceBundleFactory;
037    import org.jfree.util.Configuration;
038    
039    /**
040     * Creation-Date: 04.03.2006, 16:41:49
041     *
042     * @author Thomas Morgner
043     */
044    public class LayoutExpressionRuntime implements ExpressionRuntime
045    {
046      private DataRow dataRow;
047      private Configuration configuration;
048      private ReportData reportData;
049      private Object declaringParent;
050      private int currentRow;
051      private ReportContext reportContext;
052    
053      public LayoutExpressionRuntime()
054      {
055      }
056    
057      public void setCurrentRow(final int currentRow)
058      {
059        this.currentRow = currentRow;
060      }
061    
062      public void setDataRow(final DataRow dataRow)
063      {
064        this.dataRow = dataRow;
065      }
066    
067      public void setConfiguration(final Configuration configuration)
068      {
069        this.configuration = configuration;
070      }
071    
072      public void setData(final ReportData reportData)
073      {
074        this.reportData = reportData;
075      }
076    
077      public void setDeclaringParent(final Object declaringParent)
078      {
079        this.declaringParent = declaringParent;
080      }
081    
082    
083      /**
084       * Returns the datarow.
085       *
086       * @return
087       */
088      public DataRow getDataRow()
089      {
090        return dataRow;
091      }
092    
093      public Configuration getConfiguration()
094      {
095        return configuration;
096      }
097    
098      public ResourceBundleFactory getResourceBundleFactory()
099      {
100        return reportContext.getResourceBundleFactory();
101      }
102    
103      /**
104       * Returns the report data used in this section. If subreports are used, this
105       * does not reflect the complete report data.
106       * <p/>
107       * All access to the report data must be properly synchronized. Failure to do
108       * so may result in funny results. Do not assume that the report data will be
109       * initialized on the current cursor positon.
110       *
111       * @return
112       */
113      public ReportData getData()
114      {
115        return reportData;
116      }
117    
118      public Object getDeclaringParent()
119      {
120        return declaringParent;
121      }
122    
123      public int getCurrentRow()
124      {
125        return currentRow;
126      }
127    
128      public ReportContext getReportContext()
129      {
130        return reportContext;
131      }
132    
133      public void setReportContext (final ReportContext reportContext)
134      {
135        this.reportContext = reportContext;
136      }
137    }