|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.report.function.AbstractExpression
An abstract base class for implementing new report expressions.
Expressions are stateless functions which have access to the report's DataRow
. All
expressions are named and the defined names have to be unique within the report's expressions,
functions and fields of the datasource. Expressions are configured using properties.
todo: define a property query interface similar to the JDBC-Property interface
Field Summary |
Fields inherited from interface org.jfree.report.function.Expression |
AUTOACTIVATE_PROPERTY |
Constructor Summary | |
protected |
AbstractExpression()
Creates an unnamed expression. |
Method Summary | |
java.lang.Object |
clone()
Clones the expression. |
DataRow |
getDataRow()
Returns the current DataRow . |
int |
getDependencyLevel()
Returns the dependency level for the expression (controls evaluation order for expressions and functions). |
Expression |
getInstance()
Return a completly separated copy of this function. |
java.lang.String |
getName()
Returns the name of the expression. |
java.util.Properties |
getProperties()
Returns a copy of the properties for this expression. |
java.lang.String |
getProperty(java.lang.String name)
Returns the value of a property, or null if no such property is defined. |
java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultVal)
Returns the value of a property, or defaultVal if no such property is defined. |
void |
initialize()
Checks that the expression has been correctly initialized. |
boolean |
isActive()
Returns true if this expression contains "auto-active" content and should be
called by the system regardless of whether this expression is referenced in the
DataRow . |
void |
setDataRow(DataRow row)
Sets the current DataRow for the expression. |
void |
setDependencyLevel(int level)
Sets the dependency level for the expression. |
void |
setName(java.lang.String name)
Sets the name of the expression. |
void |
setProperties(java.util.Properties p)
Adds a property collection to the properties for this expression (overwriting existing properties with the same name). |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property for the expression. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jfree.report.function.Expression |
getValue |
Constructor Detail |
protected AbstractExpression()
setName(java.lang.String)
before the expression is added to the report's expression collection.
Method Detail |
public java.lang.String getName()
getName
in interface Expression
public void setName(java.lang.String name)
The name should be unique among:
TableModel
;
You should not change the name of an expression once it has been added to the report's expression collection.
setName
in interface Expression
name
- the name (null
not permitted).public java.lang.String getProperty(java.lang.String name)
null
if no such property is defined.
name
- the property name.
public java.lang.String getProperty(java.lang.String name, java.lang.String defaultVal)
defaultVal
if no such property is defined.
name
- the property name.defaultVal
- the default value.
public boolean isActive()
true
if this expression contains "auto-active" content and should be
called by the system regardless of whether this expression is referenced in the
DataRow
.
isActive
in interface Expression
public final void setProperty(java.lang.String name, java.lang.String value)
null
, the property
will be removed from the property collection.
name
- the property name (null
not permitted).value
- the property value.public java.util.Properties getProperties()
getProperties
in interface Expression
public void setProperties(java.util.Properties p)
Expression parameters are recorded as properties. The required parameters (if any) will be specified in the documentation for the class that implements the expression.
setProperties
in interface Expression
p
- the properties.public int getDependencyLevel()
getDependencyLevel
in interface Expression
public void setDependencyLevel(int level)
The dependency level controls the order of evaluation for expressions and functions. Higher level expressions are evaluated before lower level expressions. Any level in the range 0 to Integer.MAX_VALUE is allowed. Negative values are reserved for system functions (printing and layouting).
setDependencyLevel
in interface Expression
level
- the level (must be greater than or equal to 0).public DataRow getDataRow()
DataRow
.
getDataRow
in interface Expression
public void setDataRow(DataRow row)
DataRow
for the expression. The data row is set when the report
processing starts and can be used to access the values of other expressions, functions, and
the report's TableModel
.
This method is used by the report processing engine, you shouldn't need to call it yourself.
setDataRow
in interface Expression
row
- the data row.public void initialize() throws FunctionInitializeException
The only check performed at present is to make sure the name is not null
.
initialize
in interface Expression
FunctionInitializeException
- in case the expression is not initialized properly.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Expressions maintain no state, cloning is done at the beginning of the report processing to disconnect the expression from any other object space.
clone
in interface Expression
java.lang.CloneNotSupportedException
- this should never happen.public Expression getInstance()
getInstance
in interface Expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |