org.jfree.report.filter.templates
Class MessageFieldTemplate

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

public class MessageFieldTemplate
extends AbstractTemplate
implements ReportConnectable

The message field template simplifies the on-the-fly creation of strings.

Author:
Thomas Morgner
See Also:
MessageFormatSupport, Serialized Form

Constructor Summary
MessageFieldTemplate()
          Creates a new string field template.
 
Method Summary
 java.lang.Object clone()
          Clones the template.
 java.lang.String getFormat()
          Returns the format string used in the message format filter.
 java.lang.String getNullValue()
          Returns the value displayed by the field when the data source value is null.
 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 setFormat(java.lang.String format)
          Redefines the format string for the message format.
 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

MessageFieldTemplate

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

getFormat

public java.lang.String getFormat()
Returns the format string used in the message format filter. This is a raw value which contains untranslated references to column names. It cannot be used directly in java.text.MessageFormat objects.
Returns:
the format string.

setFormat

public void setFormat(java.lang.String format)
Redefines the format string for the message format. The assigned message format string must be given as raw value, where column references are given in the format $(COLNAME).
Parameters:
format - the new format string.

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.