org.jcon.text
Class HierarchicalReportEngine

java.lang.Object
  extended by org.jcon.text.AbstractReportEngine
      extended by org.jcon.text.BeanReportEngine
          extended by org.jcon.text.HierarchicalReportEngine
All Implemented Interfaces:
java.io.Serializable, TextReportEngine

public class HierarchicalReportEngine
extends BeanReportEngine

A BeanReportEngine that allows you to run subreports on specified properties. This is essential to reporting complex objects. For example, if one of the properties of an object is a list, you use a HierarchicalReportEngine with an IteratingReportEngine subreport for that property.

Author:
Paul Reavis
See Also:
Serialized Form

Constructor Summary
HierarchicalReportEngine()
           
HierarchicalReportEngine(java.lang.String format, java.util.ArrayList fieldNames)
           
 
Method Summary
 java.util.Map getSubReports()
          A dictionary mapping property names to the TextReportEngines you want applied to them.
 void printField(java.lang.Object source, java.lang.String fieldName, java.io.PrintWriter writer)
          Overrides fields with associated subreports; runs the report on them directly.
 void setSubReports(java.util.Map newSubs)
           
 
Methods inherited from class org.jcon.text.BeanReportEngine
getFieldNames, getFormat, getTextSubstitutions, isVariableWidthOnly, setFieldNames, setFormat, setTextSubstitutions, setVariableWidthOnly, writeReport
 
Methods inherited from class org.jcon.text.AbstractReportEngine
generateReportFor, writeReport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchicalReportEngine

public HierarchicalReportEngine()

HierarchicalReportEngine

public HierarchicalReportEngine(java.lang.String format,
                                java.util.ArrayList fieldNames)
Method Detail

printField

public void printField(java.lang.Object source,
                       java.lang.String fieldName,
                       java.io.PrintWriter writer)
Overrides fields with associated subreports; runs the report on them directly. Any without subreports are included as for BeanReportEngine.

Overrides:
printField in class BeanReportEngine

getSubReports

public java.util.Map getSubReports()
A dictionary mapping property names to the TextReportEngines you want applied to them. These subreports are run first, then the results inserted into the report where you indicated via a backtick or hashmarked field in the "format" property.


setSubReports

public void setSubReports(java.util.Map newSubs)