org.jfree.report
Class ReportBuilderHints

java.lang.Object
  extended byorg.jfree.report.ReportBuilderHints
All Implemented Interfaces:
java.io.Serializable

public class ReportBuilderHints
extends java.lang.Object
implements java.io.Serializable

The report builder hints can be used to store extra information for an JFreeReport instance. This information can be used to support automated processes on the JFreeReport definition.

The XML parsers use this collection to store comments and other metadata for their reports.

The report builder hints are not copied when a report is cloned and are not available during the report processing.

Author:
Thomas Morgner
See Also:
Serialized Form

Nested Class Summary
static class ReportBuilderHints.ParserHintKey
          The parser hint key is a compound key to combine a string key name with an arbitary target object.
 
Constructor Summary
ReportBuilderHints()
          Creates a new ReportBuilderHints instance.
 
Method Summary
 void addHintList(java.io.Serializable target, java.lang.String hint, java.io.Serializable hintValue)
          Adds an hint into an ArrayList.
 void addHintList(java.io.Serializable target, java.lang.String hint, java.io.Serializable hintValue, boolean unique)
          Adds an hint into an ArrayList.
 java.lang.Object getHint(java.io.Serializable target, java.lang.String hint)
          Queries the object to get a stored hint from this collcetion.
 java.lang.Object getHint(java.io.Serializable target, java.lang.String hint, java.lang.Class objectType)
          Queries the object to get a stored hint from this collcetion and checks that the target object has the correct type.
 void putHint(java.io.Serializable target, java.lang.String hint, java.io.Serializable hintValue)
          Stores a new hint, replacing all previously stored hints for that key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportBuilderHints

public ReportBuilderHints()
Creates a new ReportBuilderHints instance.

Method Detail

putHint

public void putHint(java.io.Serializable target,
                    java.lang.String hint,
                    java.io.Serializable hintValue)
Stores a new hint, replacing all previously stored hints for that key.

Parameters:
target - the target object, to which the hint is assigned.
hint - the name of the hint.
hintValue - the value of the hint.

getHint

public java.lang.Object getHint(java.io.Serializable target,
                                java.lang.String hint)
Queries the object to get a stored hint from this collcetion.

Parameters:
target - the target object, to which the hint is assigned.
hint - the name of the hint.
Returns:
the stored hint or null, if no such hint is stored for that object.

getHint

public java.lang.Object getHint(java.io.Serializable target,
                                java.lang.String hint,
                                java.lang.Class objectType)
Queries the object to get a stored hint from this collcetion and checks that the target object has the correct type. This will return null, if the hintobject is not assignable from the given object type.

Parameters:
target - the target object, to which the hint is assigned.
hint - the name of the hint.
objectType - the expected type of the stored hint.
Returns:
the stored hint or null, if no such hint is stored for that object.

addHintList

public void addHintList(java.io.Serializable target,
                        java.lang.String hint,
                        java.io.Serializable hintValue)
Adds an hint into an ArrayList. If the hint is no list hint, a IllegalArgumentException is thrown. If the speocified hint value is already contained in that list, no action is taken.

Parameters:
target - the target object for which the hint is specified.
hint - the hint name
hintValue - the hint value (not null)
Throws:
java.lang.IllegalArgumentException - if the specified hint is no list type.

addHintList

public void addHintList(java.io.Serializable target,
                        java.lang.String hint,
                        java.io.Serializable hintValue,
                        boolean unique)
Adds an hint into an ArrayList. If the hint is no list hint, a IllegalArgumentException is thrown. If the speocified hint value is already contained in that list, no action is taken.

Parameters:
target - the target object for which the hint is specified.
hint - the hint name
hintValue - the hint value (not null)
unique - true, if the value should be unique within the list
Throws:
java.lang.IllegalArgumentException - if the specified hint is no list type.