com.jrefinery.report.filter
Class ExpressionDataSource

java.lang.Object
  |
  +--com.jrefinery.report.filter.ExpressionDataSource
All Implemented Interfaces:
java.lang.Cloneable, DataRowConnectable, DataSource, java.io.Serializable

Deprecated. use DataRowDataSource as unified access class instead

public class ExpressionDataSource
extends java.lang.Object
implements DataSource, DataRowConnectable, java.io.Serializable

A datasource that queries the datarow and computes a value using an expression. Expressions are simple stateless functions which do not maintain any state and get not informed of reportstate changes. All informations for expressions are queried using the datarow given in the connectDataRow method.

Author:
Thomas Morgner
See Also:
Expression, Serialized Form

Constructor Summary
ExpressionDataSource()
          Deprecated. Default constructor.
ExpressionDataSource(java.lang.String expression)
          Deprecated. Constructs a new expression data source.
 
Method Summary
 java.lang.Object clone()
          Deprecated. Clones this data source.
 void connectDataRow(DataRow row)
          Deprecated. Connects the DataRowBackend with the named DataSource or DataFilter.
 void disconnectDataRow(DataRow row)
          Deprecated. Releases the connection to the datarow.
protected  DataRow getDataRow()
          Deprecated. Gets the assigned dataRow.
 java.lang.String getExpression()
          Deprecated. Returns the name of the expression bound to this datasource.
 java.lang.Object getValue()
          Deprecated. Returns the value of the expression.
 void setExpression(java.lang.String field)
          Deprecated. Sets the expression.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionDataSource

public ExpressionDataSource()
Deprecated. 
Default constructor. The expression name is empty ("", not null), the value initially null.


ExpressionDataSource

public ExpressionDataSource(java.lang.String expression)
Deprecated. 
Constructs a new expression data source.

Parameters:
expression - The expression.
Method Detail

setExpression

public void setExpression(java.lang.String field)
Deprecated. 
Sets the expression.

Parameters:
field - the name of the expression as defined in the expression collection.

getExpression

public java.lang.String getExpression()
Deprecated. 
Returns the name of the expression bound to this datasource.

Returns:
the registered expression name

getValue

public java.lang.Object getValue()
Deprecated. 
Returns the value of the expression. The value is evaluated from the given DataRow.

Specified by:
getValue in interface DataSource
Returns:
The value.
Throws:
java.lang.IllegalStateException - if there is no datarow connected.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Deprecated. 
Clones this data source.

Specified by:
clone in interface DataSource
Overrides:
clone in class java.lang.Object
Returns:
a clone of this ExpressionDataSource.
Throws:
java.lang.CloneNotSupportedException - if the cloning is not supported.

connectDataRow

public void connectDataRow(DataRow row)
                    throws java.lang.IllegalStateException
Deprecated. 
Connects the DataRowBackend with the named DataSource or DataFilter. The filter is now able to query the other DataSources to compute the result.

If there is already a datarow connected, an IllegalStateException is thrown.

Specified by:
connectDataRow in interface DataRowConnectable
Parameters:
row - the datarow to be connected.
Throws:
java.lang.NullPointerException - if the given row is null
java.lang.IllegalStateException - if there is a datarow already connected.

disconnectDataRow

public void disconnectDataRow(DataRow row)
                       throws java.lang.IllegalStateException
Deprecated. 
Releases the connection to the datarow. If no datarow is connected, an IllegalStateException is thrown to indicate the programming error.

Specified by:
disconnectDataRow in interface DataRowConnectable
Parameters:
row - the datarow to be disconnected.
Throws:
java.lang.NullPointerException - if the given row is null
java.lang.IllegalStateException - if there is currently no datarow connected.

getDataRow

protected DataRow getDataRow()
Deprecated. 
Gets the assigned dataRow.

Returns:
the datarow connected with this datasource.