org.pentaho.reporting.engine.classic.core.states
Class ReportDefinitionImpl

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.Element
      extended by org.pentaho.reporting.engine.classic.core.Section
          extended by org.pentaho.reporting.engine.classic.core.states.ReportDefinitionImpl
All Implemented Interfaces:
Serializable, Cloneable, DataTarget, ReportDefinition, ReportElement

public class ReportDefinitionImpl
extends Section
implements ReportDefinition

A report definition. This the working copy of the JFreeReport object. This object is not serializable, as it is used internally. This implementation is not intended to be known outside. Whatever you planned to do with it - dont do it!

Its only pupose is to be used and manipulated in the report states, there is no reason to do it outside.

Author:
Thomas Morgner.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.pentaho.reporting.engine.classic.core.Element
ANONYMOUS_ELEMENT_PREFIX
 
Constructor Summary
ReportDefinitionImpl(ReportDefinition report, PageDefinition pageDefinition)
          Creates a report definition from a report object.
 
Method Summary
 Object clone()
          Creates and returns a copy of this object.
 Element derive(boolean preserveElementInstanceIds)
          Creates a deep copy of this element and regenerates all instance-ids.
 SubReport findSubReport(InstanceID reportID)
           
 DetailsFooter getDetailsFooter()
          Returns the details header band.
 DetailsHeader getDetailsHeader()
          Returns the details header band.
 ReportElement getElement(int index)
          Returns the element stored add the given index.
 int getElementCount()
          Returns the number of elements in this section.
 Group getGroup(int groupIndex)
          Returns the group at the specified index or null, if there is no such group.
 int getGroupCount()
          Returns the number of groups in this report.
 ItemBand getItemBand()
          Returns the item band.
 NoDataBand getNoDataBand()
          Returns the "no-data" band, which is displayed if there is no data available.
 PageDefinition getPageDefinition()
          Returns the page definition assigned to the report definition.
 PageFooter getPageFooter()
          Returns the page footer.
 PageHeader getPageHeader()
          Returns the page header.
 ReportProperties getProperties()
          Deprecated. Access to the properties should be done using the datarow.
 String getQuery()
          Returns the query name that should be used when processing the report.
 int getQueryLimit()
           
 int getQueryTimeout()
           
 ReportDefinition getReportDefinition()
          Returns the currently assigned report definition.
 ReportFooter getReportFooter()
          Returns the report footer.
 ReportHeader getReportHeader()
          Returns the report header.
 Group getRootGroup()
          Returns the list of groups for the report.
 StyleSheetCollection getStyleSheetCollection()
          Returns the stylesheet collection of this report definition.
 Watermark getWatermark()
          Returns the watermark band.
 void setElementAt(int position, Element element)
           
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.Element
derive, getAttribute, getAttributeExpression, getAttributeExpressionNames, getAttributeExpressionNamespaces, getAttributeNames, getAttributeNamespaces, getAttributes, getChangeTracker, getContentBase, getDataSource, getDefinitionSource, getElementType, getElementTypeName, getHRefTarget, getId, getMetaData, getName, getObjectID, getParent, getParentSection, getStyle, getStyleExpression, getStyleExpressions, getTreeLock, getValue, isDynamicContent, isVisible, notifyNodeChildAdded, notifyNodeChildRemoved, notifyNodePropertiesChanged, notifyNodePropertiesChanged, notifyNodeStructureChanged, setAttribute, setAttribute, setAttributeExpression, setDataSource, setDynamicContent, setElementType, setHRefTarget, setId, setName, setStyleExpression, setVisible, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pentaho.reporting.engine.classic.core.ReportElement
getAttribute, getAttributeExpression, getAttributeExpressionNames, getAttributeExpressionNamespaces, getAttributeNames, getAttributeNamespaces, getAttributes, getId, getMetaData, getName, getObjectID, getParentSection, getStyle, getStyleExpression, getStyleExpressions, getTreeLock, setAttribute, setAttributeExpression, setStyleExpression
 

Constructor Detail

ReportDefinitionImpl

public ReportDefinitionImpl(ReportDefinition report,
                            PageDefinition pageDefinition)
                     throws ReportProcessingException
Creates a report definition from a report object.

Parameters:
report - the report.
pageDefinition - the current page definition.
Throws:
ReportProcessingException - if there is a problem cloning.
Method Detail

getQueryLimit

public int getQueryLimit()
Specified by:
getQueryLimit in interface ReportDefinition

getQueryTimeout

public int getQueryTimeout()
Specified by:
getQueryTimeout in interface ReportDefinition

getQuery

public String getQuery()
Description copied from interface: ReportDefinition
Returns the query name that should be used when processing the report.

Specified by:
getQuery in interface ReportDefinition
Returns:
the query string.

getReportHeader

public ReportHeader getReportHeader()
Returns the report header.

Specified by:
getReportHeader in interface ReportDefinition
Returns:
The report header.

getReportFooter

public ReportFooter getReportFooter()
Returns the report footer.

Specified by:
getReportFooter in interface ReportDefinition
Returns:
The report footer.

getPageHeader

public PageHeader getPageHeader()
Returns the page header.

Specified by:
getPageHeader in interface ReportDefinition
Returns:
The page header.

getPageFooter

public PageFooter getPageFooter()
Returns the page footer.

Specified by:
getPageFooter in interface ReportDefinition
Returns:
The page footer.

getItemBand

public ItemBand getItemBand()
Returns the item band.

Specified by:
getItemBand in interface ReportDefinition
Returns:
The item band.

getDetailsHeader

public DetailsHeader getDetailsHeader()
Returns the details header band.

Specified by:
getDetailsHeader in interface ReportDefinition
Returns:
The details header band.

getDetailsFooter

public DetailsFooter getDetailsFooter()
Returns the details header band.

Specified by:
getDetailsFooter in interface ReportDefinition
Returns:
The details header band.

getRootGroup

public Group getRootGroup()
Description copied from interface: ReportDefinition
Returns the list of groups for the report.

Specified by:
getRootGroup in interface ReportDefinition
Returns:
The list of groups.

getNoDataBand

public NoDataBand getNoDataBand()
Returns the "no-data" band, which is displayed if there is no data available.

Specified by:
getNoDataBand in interface ReportDefinition
Returns:
The no-data band.

getProperties

public ReportProperties getProperties()
Deprecated. Access to the properties should be done using the datarow.

Returns the report properties.

Specified by:
getProperties in interface ReportDefinition
Returns:
The report properties.

getGroupCount

public int getGroupCount()
Returns the number of groups in this report.

Every report has at least one group defined.

Specified by:
getGroupCount in interface ReportDefinition
Returns:
the group count.

getGroup

public Group getGroup(int groupIndex)
Returns the group at the specified index or null, if there is no such group.

Specified by:
getGroup in interface ReportDefinition
Parameters:
groupIndex - the group index.
Returns:
the requested group.
Throws:
IllegalArgumentException - if the count is negative.
IndexOutOfBoundsException - if the count is greater than the number of defined groups.

clone

public Object clone()
             throws CloneNotSupportedException
Creates and returns a copy of this object.

Specified by:
clone in interface DataTarget
Overrides:
clone in class Element
Returns:
a clone of this instance.
Throws:
CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
See Also:
Cloneable

derive

public Element derive(boolean preserveElementInstanceIds)
               throws CloneNotSupportedException
Description copied from class: Element
Creates a deep copy of this element and regenerates all instance-ids.

Overrides:
derive in class Element
Parameters:
preserveElementInstanceIds - defines whether this call generates new instance-ids for the derived elements. Instance-IDs are used by the report processor to recognize reoccurring elements and must not changed within the report run. Outside of the report processors new instance ids should be generated at all times to separate instances and to make them uniquely identifiable.
Returns:
the copy of the element.
Throws:
CloneNotSupportedException

getStyleSheetCollection

public StyleSheetCollection getStyleSheetCollection()
Returns the stylesheet collection of this report definition. The stylesheet collection is fixed for the report definition and all elements of the report. When a band or group is added to the report it will get registered with this stylesheet collection and cannot be used in an different report.

Specified by:
getStyleSheetCollection in interface ReportDefinition
Returns:
the stylesheet collection of the report, never null.

getWatermark

public Watermark getWatermark()
Description copied from interface: ReportDefinition
Returns the watermark band.

Specified by:
getWatermark in interface ReportDefinition
Returns:
The watermark band.

getPageDefinition

public PageDefinition getPageDefinition()
Description copied from interface: ReportDefinition
Returns the page definition assigned to the report definition. The page definition defines the report area and how the report is subdivided by the child pages.

Specified by:
getPageDefinition in interface ReportDefinition
Returns:
the page definition.

getReportDefinition

public ReportDefinition getReportDefinition()
Returns the currently assigned report definition.

Specified by:
getReportDefinition in interface ReportElement
Overrides:
getReportDefinition in class Element
Returns:
the report definition or null, if no report has been assigned.

setElementAt

public void setElementAt(int position,
                         Element element)
Specified by:
setElementAt in class Section

getElementCount

public int getElementCount()
Description copied from class: Section
Returns the number of elements in this section.

Specified by:
getElementCount in class Section
Returns:
the number of elements of this section.

getElement

public ReportElement getElement(int index)
Description copied from class: Section
Returns the element stored add the given index.

Specified by:
getElement in class Section
Parameters:
index - the element position within this section
Returns:
the element

findSubReport

public SubReport findSubReport(InstanceID reportID)