org.jfree.report.filter.templates
Class StringFieldTemplate

java.lang.Object
  |
  +--org.jfree.report.filter.templates.AbstractTemplate
        |
        +--org.jfree.report.filter.templates.StringFieldTemplate

public class StringFieldTemplate
extends AbstractTemplate
implements ReportConnectable, RawDataSource

A string field template.

Author:
Thomas Morgner
See Also:
Serialized Form

Constructor Summary
StringFieldTemplate()
          Creates a new string field template.
 
Method Summary
 java.lang.Object clone()
          Clones the template.
protected  DataRowDataSource getDataRowDataSource()
          Returns the datarow data source used in this template.
 java.lang.String getField()
          Returns the field name.
 java.lang.String getNullValue()
          Returns the value displayed by the field when the data source value is null.
 java.lang.Object getRawValue()
          Returns the unformated raw value.
 java.lang.Object getValue()
          Returns the current value for the data source.
 void registerReportDefinition(ReportDefinition reportDefinition)
          Connects the connectable to the given report definition.
 void setField(java.lang.String field)
          Sets the field name.
 void setNullValue(java.lang.String nullValue)
          Sets the value displayed by the field when the data source value is null.
 void unregisterReportDefinition(ReportDefinition reportDefinition)
          Disconnects this ReportConnectable from the report definition.
 
Methods inherited from class org.jfree.report.filter.templates.AbstractTemplate
getInstance, getName, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringFieldTemplate

public StringFieldTemplate()
Creates a new string field template.
Method Detail

getField

public java.lang.String getField()
Returns the field name.
Returns:
The field name.

setField

public void setField(java.lang.String field)
Sets the field name.
Parameters:
field - the field name.

getNullValue

public java.lang.String getNullValue()
Returns the value displayed by the field when the data source value is null.
Returns:
A value to represent null.

setNullValue

public void setNullValue(java.lang.String nullValue)
Sets the value displayed by the field when the data source value is null.
Parameters:
nullValue - the value that represents null.

getValue

public java.lang.Object getValue()
Returns the current value for the data source.
Returns:
the value.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the template.
Overrides:
clone in class AbstractTemplate
Returns:
the clone.
Throws:
java.lang.CloneNotSupportedException - this should never happen.

registerReportDefinition

public void registerReportDefinition(ReportDefinition reportDefinition)
Connects the connectable to the given report definition.
Specified by:
registerReportDefinition in interface ReportConnectable
Parameters:
reportDefinition - the reportDefinition for this report connectable.

unregisterReportDefinition

public void unregisterReportDefinition(ReportDefinition reportDefinition)
Disconnects this ReportConnectable from the report definition.
Specified by:
unregisterReportDefinition in interface ReportConnectable
Parameters:
reportDefinition - the ReportDefinition.

getDataRowDataSource

protected DataRowDataSource getDataRowDataSource()
Returns the datarow data source used in this template.
Returns:
the datarow data source.

getRawValue

public java.lang.Object getRawValue()
Description copied from interface: RawDataSource
Returns the unformated raw value. Whether that raw value is useable for the export is beyond the scope of this API definition, but providing access to Number or Date objects is a good idea.
Specified by:
getRawValue in interface RawDataSource
Tags copied from interface: RawDataSource
Returns:
the raw data.