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

Quick Search    Search Deep

org.jdaemon.six
Class ReportBuilder  view ReportBuilder download ReportBuilder.java

java.lang.Object
  extended byorg.jdaemon.six.BuilderDelegator
      extended byorg.jdaemon.six.TransformerStack
          extended byorg.jdaemon.six.ReportBuilder
All Implemented Interfaces:
Builder

public class ReportBuilder
extends TransformerStack

ReportBuilder provides utility methods for creation of report documents.

Generally ReportBuilder will be used to create XML documents. A number of XML element types are implicitly defined by the ReportBuilder API:

report
header
row
group
cell
sort
free-text

These element types are primarily morphological in as much as they define how documents generated by ReportBuilder are laid out: For example, header elements can contain header-row elements but not datum elements.

Most of these elements also support a class attribute. This allows element types which have the same morphological characteristics to be distinguished when they are used for different purposes. For example, the decision was made not to have separate 'header' and 'footer' element types. Instead we have one 'header' tag, to which we can add a range of different classes: 'begin-report', 'end-report', 'begin-section', and 'end-section'.

Users of this class are free to make use of the 'class' attribute. Any arbitrary string value could be of use when creating an XSL stylesheet to render the generated document.

It should be noted that certain transformers included in the six package (yet to be implemented) will only be useful if the suggested naming conventions for class attributes are followed.

Version:
0.1

Field Summary
 
Fields inherited from class org.jdaemon.six.TransformerStack
stack
 
Fields inherited from class org.jdaemon.six.BuilderDelegator
delegate
 
Constructor Summary
ReportBuilder(Builder builder)
          Creates new ReportBuilder
 
Method Summary
 void endCell()
          End a Cell element
 void endFreeText()
          End a FreeText element.
 void endGroup()
          End a Detail element
 void endHeader()
          End a Header element
 void endReport()
          End a Report element
private  void endReportElement(java.lang.String type)
          End a generic Report element.
 void endRow()
          End a Datum element
 void endSort()
          End a Detail element
 void startCell(java.lang.String class_id, org.jdaemon.util.AttributeList attributes)
          Begin a Cell element.
 void startFreeText(java.lang.String class_id, org.jdaemon.util.AttributeList attributes)
          Begin a FreeText element.
 void startGroup(org.jdaemon.util.AttributeList attributes)
          Begin a Group element.
 void startHeader(java.lang.String class_id, org.jdaemon.util.AttributeList attributes)
          Begin a Header element.
 void startReport(java.lang.String class_id, org.jdaemon.util.AttributeList attributes)
          Begin a Report element.
private  void startReportElement(java.lang.String type, java.lang.String class_id, org.jdaemon.util.AttributeList attributes)
          Begin a generic Report element.
 void startRow(java.lang.String class_id, org.jdaemon.util.AttributeList attributes)
          Begin a Row element.
 void startSort(java.lang.String class_id, org.jdaemon.util.AttributeList attributes)
          Begin a Sort element.
 
Methods inherited from class org.jdaemon.six.TransformerStack
pop, push
 
Methods inherited from class org.jdaemon.six.BuilderDelegator
endElement, flush, startElement, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportBuilder

public ReportBuilder(Builder builder)
Creates new ReportBuilder

Method Detail

startReport

public void startReport(java.lang.String class_id,
                        org.jdaemon.util.AttributeList attributes)
Begin a Report element.

A Report element has a type 'report' and a mandatory 'class' attribute. A Report element can contain:

header elements
group elements
sort elements
free-text elements

No ordering is enforced but it is envisaged that a typical report will contain a header element, followed by a detail element, and then possibly another header or free-text element at the bottom.


endReport

public void endReport()
End a Report element


startHeader

public void startHeader(java.lang.String class_id,
                        org.jdaemon.util.AttributeList attributes)
Begin a Header element.

A Header element has a type 'header' and a mandatory 'class' attribute. Users of this element are free to choose arbitrary values for the class attribute. However the following standard values will help ensure Stylesheet compatibility:

begin-report
end-report
begin-section
end-section

A Header element can contain:

row elements only


endHeader

public void endHeader()
End a Header element


startFreeText

public void startFreeText(java.lang.String class_id,
                          org.jdaemon.util.AttributeList attributes)
Begin a FreeText element.

A FreeText element has a type 'free-text' and a mandatory 'class' attribute. The class attribute can be given any arbitrary value. However, the following standard values will help ensure stylesheet comparibility:

disclaimer
information
explanation
memo
instruction

It is anticipated that various text-formatting elements will be allowed within the FreeText element but these are not yet specified.


endFreeText

public void endFreeText()
End a FreeText element.


startGroup

public void startGroup(org.jdaemon.util.AttributeList attributes)
Begin a Group element.

A group element can contain the following elements:

row elements sort elements

Note that a group defines a selection of rows where each row has the same value of certain common attributes. For example, in a report where data is sorted by a name attibute, a group would contain only rows with a given value of name.


endGroup

public void endGroup()
End a Detail element


startSort

public void startSort(java.lang.String class_id,
                      org.jdaemon.util.AttributeList attributes)
Begin a Sort element.

A Sort element has a type 'sort' and mandatory class_id attribute. Within a sort element, all row elements will be contained by group elements. The all rows within each group must share a common value of a particular cell, and the groups will be sorted according in order of that cell value. The class_id of the sort element should be the same as the class_id of the cell which forms the basis of the sort.

A sort element can contain the following elements:

a sort element group elements


endSort

public void endSort()
End a Detail element


startRow

public void startRow(java.lang.String class_id,
                     org.jdaemon.util.AttributeList attributes)
Begin a Row element.

A Datum element has a type 'datum' and a mandatory 'class' attribute. The class attribute can be given any arbitrary value. However, the following standard values will help ensure stylesheet comparibility:

data
aggregate
header

A row element can contain the following elements:

Many cell elements


endRow

public void endRow()
End a Datum element


startCell

public void startCell(java.lang.String class_id,
                      org.jdaemon.util.AttributeList attributes)
Begin a Cell element. A Cell element has a type 'cell' and a mandatory 'class' attribute. A Cell element can contain no other elements.


endCell

public void endCell()
End a Cell element


startReportElement

private void startReportElement(java.lang.String type,
                                java.lang.String class_id,
                                org.jdaemon.util.AttributeList attributes)
Begin a generic Report element. *


endReportElement

private void endReportElement(java.lang.String type)
End a generic Report element.