Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jbreport.core
Class ReportCompositeImpl  view ReportCompositeImpl download ReportCompositeImpl.java

java.lang.Object
  extended byjbreport.core.AbstractReportElement
      extended byjbreport.core.ReportCompositeImpl
All Implemented Interfaces:
java.lang.Cloneable, jbreport.ReportComposite, jbreport.ReportElement, Traversable, XMLAware
Direct Known Subclasses:
Group, RepositoryImpl, Style, Table, TableColumn, TableHeaderRow, TLine

public class ReportCompositeImpl
extends AbstractReportElement
implements jbreport.ReportComposite

The default concrete implementation of the ReportComposite interface. This is public as classes in other packages might need to extend this.

Version:
$Revision: 1.1 $

Field Summary
private  java.util.List children
          The list of elements that exist as children of this Composite
 
Fields inherited from class jbreport.core.AbstractReportElement
attrType, cdata, className, elementType, factory, name, xmlHandler
 
Fields inherited from interface jbreport.ReportElement
DEEP, SHALLOW
 
Constructor Summary
ReportCompositeImpl()
           
 
Method Summary
 void accept(ReportVisitor visitor, ReportVisitorState state)
          This defines the operation that the Traversable instance must perform at each node in the traversal.
 void addElement(jbreport.ReportElement elem)
          Adds an element as a child of this element.
protected  void clearElements()
           
 jbreport.ReportElement copy(boolean deep)
          This will copy (clone) the current element, returning the copied element.
 java.util.List getList(java.lang.String property)
          Returns the List instance for the given property name.
 void loadData()
          This will initiate the loading of the data into the report.
 void updateData(jbreport.data.QueryResult queryResult)
          This is called for every successful next() method call on the QueryResult contained by a group.
 void xmlEndChild(jbreport.ReportElement elem)
          This method is called for every child element that is defined during xml tree traversal.
 
Methods inherited from class jbreport.core.AbstractReportElement
assert, assertNotNull, boundParameters, breakEventNotify, clone, copy, getBoundParamValue, getElement, getFactory, getName, getParent, getRepository, getString, getStylesheet, getType, inOrderIterator, inOrderTraverse, postOrderIterator, postOrderTraverse, preLoadData, preOrderIterator, preOrderTraverse, setParent, setString, xmlEnd, xmlInitialize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jbreport.ReportElement
boundParameters, copy, getBoundParamValue, getElement, getFactory, getName, getParent, getRepository, getString, getStylesheet, getType, setParent, setString, xmlEnd, xmlInitialize
 

Field Detail

children

private java.util.List children
The list of elements that exist as children of this Composite

Constructor Detail

ReportCompositeImpl

public ReportCompositeImpl()
Method Detail

addElement

public void addElement(jbreport.ReportElement elem)
Description copied from interface: jbreport.ReportComposite
Adds an element as a child of this element. This should be ordered in the same way as they were inserted.

Specified by:
addElement in interface jbreport.ReportComposite

copy

public jbreport.ReportElement copy(boolean deep)
Description copied from interface: jbreport.ReportElement
This will copy (clone) the current element, returning the copied element.

Should the deep parameter be set, the children of this element are cloned as well, otherwise, the references are copied. This is not strictly true, as there might be classes of elements where a clone does not make sense.

Specified by:
copy in interface jbreport.ReportElement
Overrides:
copy in class AbstractReportElement

getList

public java.util.List getList(java.lang.String property)
Description copied from interface: jbreport.ReportElement
Returns the List instance for the given property name.

Specified by:
getList in interface jbreport.ReportElement
Overrides:
getList in class AbstractReportElement

loadData

public void loadData()
              throws jbreport.ReportException
Description copied from interface: jbreport.ReportElement
This will initiate the loading of the data into the report.

Specified by:
loadData in interface jbreport.ReportElement
Overrides:
loadData in class AbstractReportElement

updateData

public void updateData(jbreport.data.QueryResult queryResult)
                throws jbreport.ReportException
Description copied from class: AbstractReportElement
This is called for every successful next() method call on the QueryResult contained by a group.

Overrides:
updateData in class AbstractReportElement

xmlEndChild

public void xmlEndChild(jbreport.ReportElement elem)
                 throws jbreport.ReportException
Description copied from interface: jbreport.ReportElement
This method is called for every child element that is defined during xml tree traversal. In order to preserve the tree, it will only be called at the end of the child definition.

Specified by:
xmlEndChild in interface jbreport.ReportElement
Overrides:
xmlEndChild in class AbstractReportElement

accept

public void accept(ReportVisitor visitor,
                   ReportVisitorState state)
            throws jbreport.ReportException
Description copied from interface: Traversable
This defines the operation that the Traversable instance must perform at each node in the traversal. It should be coded such that it calls an appropriate method on the ReportVisitor instance. Should an appropriate method not exist, one should be coded.

The accept method should not recurse into its children, it is the contract of the iterator to perform that function.

eg:- For node type Section the method on this node should be as follows.

   public void accept(ReportVisitor visitor, ReportVisitorState state) 
      throws ReportException {
      visitor.visitSection(this, state);
   }

Specified by:
accept in interface Traversable
Overrides:
accept in class AbstractReportElement

clearElements

protected void clearElements()