|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.report.function.AbstractFunction
Base class for implementing new report functions. Provides empty implementations of all the methods in the Function interface.
The function is initialized when it gets added to the report. The method initialize
gets called to perform the required initializations. At this point, all function properties must
have been set to a valid state and the function must be named. If the initialisation fails, a
FunctionInitializeException is thrown and the function get not added to the report.
Field Summary |
Fields inherited from interface org.jfree.report.function.Expression |
AUTOACTIVATE_PROPERTY |
Constructor Summary | |
protected |
AbstractFunction()
Creates an unnamed function. |
protected |
AbstractFunction(java.lang.String name)
Creates an named function. |
Method Summary | |
java.lang.Object |
clone()
Clones the function. |
DataRow |
getDataRow()
returns the datarow for this function. |
int |
getDependencyLevel()
Returns the dependency level for the functions (controls evaluation order for expressions and functions). |
Expression |
getInstance()
Return a completly separated copy of this function. |
java.lang.String |
getName()
Returns the function name. |
java.util.Properties |
getProperties()
Gets a copy of the properties used in this function. |
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 |
groupFinished(ReportEvent event)
Receives notification that a group has finished. |
void |
groupStarted(ReportEvent event)
Receives notification that a group has started. |
void |
initialize()
Checks that the function has been correctly initialized. |
boolean |
isActive()
Returns true if this expression contains autoactive content and should be called by the system, regardless whether this expression is referenced in the datarow. |
void |
itemsAdvanced(ReportEvent event)
Receives notification that a row of data is being processed. |
void |
itemsFinished(ReportEvent event)
Receives notification that a group of item bands has been completed. |
void |
itemsStarted(ReportEvent event)
Receives notification that a group of item bands is about to be processed. |
void |
reportDone(ReportEvent event)
Receives notification that report generation has completed, the report footer was printed, no more output is done. |
void |
reportFinished(ReportEvent event)
Receives notification that the report has finished. |
void |
reportInitialized(ReportEvent event)
Receives notification that report generation initializes the current run. |
void |
reportStarted(ReportEvent event)
Receives notification that the report has started. |
void |
setDataRow(DataRow dataRow)
Defines the datarow for this function. |
void |
setDependencyLevel(int level)
Sets the dependency level for the function. |
void |
setName(java.lang.String name)
Sets the name of the function. |
void |
setProperties(java.util.Properties p)
Adds a property collection to the properties for this function (overwriting existing properties with the same name). |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property for the function. |
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 AbstractFunction()
setName(java.lang.String)
before the function is added to the report's function collection.
protected AbstractFunction(java.lang.String name)
name
- the name of the function.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()
isActive
in interface Expression
public 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)
Function parameters are recorded as properties. The required parameters (if any) will be specified in the documentation for the class that implements the function.
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()
getDataRow
in interface Expression
public void setDataRow(DataRow dataRow)
setDataRow
in interface Expression
dataRow
- assigns the datarow for this expression.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 function is not initialized properly.public void reportInitialized(ReportEvent event)
The event carries a ReportState.Started state. Use this to initialize the report.
reportInitialized
in interface ReportListener
event
- The event.public void reportStarted(ReportEvent event)
reportStarted
in interface ReportListener
event
- the event.public void reportFinished(ReportEvent event)
reportFinished
in interface ReportListener
event
- the event.public void groupStarted(ReportEvent event)
groupStarted
in interface ReportListener
event
- the event.public void groupFinished(ReportEvent event)
groupFinished
in interface ReportListener
event
- the event.public void itemsAdvanced(ReportEvent event)
itemsAdvanced
in interface ReportListener
event
- the event.public void itemsStarted(ReportEvent event)
The next events will be itemsAdvanced events until the itemsFinished event is raised.
itemsStarted
in interface ReportListener
event
- The event.public void itemsFinished(ReportEvent event)
The itemBand is finished, the report starts to close open groups.
itemsFinished
in interface ReportListener
event
- The event.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Be aware, this does not create a deep copy. If you have complex strucures contained in objects, you have to override this function.
clone
in interface Function
java.lang.CloneNotSupportedException
- this should never happen.public Expression getInstance()
getInstance
in interface Expression
public void reportDone(ReportEvent event)
reportDone
in interface ReportListener
event
- The event.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |