info.informatica.report.block
Class AbstractBlock

java.lang.Object
  extended by info.informatica.report.block.AbstractBlock
All Implemented Interfaces:
Block
Direct Known Subclasses:
AbstractTableBlock, DefaultTemplateBlock, DynamicBlock, TextBlock

public abstract class AbstractBlock
extends Object
implements Block

Base for Report Blocks.

All blocks support the following attribute (XXX NO LONGER: FIX COMMENT):

Author:
Carlos Amengual (amengual at informatica.info)

Method Summary
 ReportElement filterChildReportElement(ReportElement element)
          When any ReportElement is added as a child of the peer ReportElement, it is filtered through this method.
 info.informatica.doc.dom4j.CSSStylableElement filterChildXHTMLElement(info.informatica.doc.dom4j.CSSStylableElement element)
          When any CSSStylableElement is added as a child of the peer ReportElement, it is filtered through this method.
 info.informatica.util.ConditionalExpression getCondition()
           
 ReportElement getPeerElement()
           
 ReportDataSpec getReportDataSpec()
          Gets the dataspec which references this block, in case of a DynamicBlock.
 Properties getTransformParameters()
           
abstract  void init()
          Arranges the block for printing.
 boolean isHidden(Dataset dataset)
          Should this dataspec be printed ?
 void printSample(ReportWriter rw)
          Print a sample of this block.
 void setCondition(info.informatica.util.ConditionalExpression conditional)
           
 void setReportDataSpec(ReportDataSpec spec)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPeerElement

public ReportElement getPeerElement()
Specified by:
getPeerElement in interface Block

getTransformParameters

public Properties getTransformParameters()
Specified by:
getTransformParameters in interface Block

getReportDataSpec

public ReportDataSpec getReportDataSpec()
Gets the dataspec which references this block, in case of a DynamicBlock.

Specified by:
getReportDataSpec in interface Block
Returns:
the dataspec to which this block is referenced, or null if none.

setReportDataSpec

public void setReportDataSpec(ReportDataSpec spec)
Specified by:
setReportDataSpec in interface Block

isHidden

public boolean isHidden(Dataset dataset)
Should this dataspec be printed ?

Specified by:
isHidden in interface Block
Parameters:
dataset - the Dataset to be rendered.
Returns:
true if the dataspec should not be printed, false otherwise.

setCondition

public void setCondition(info.informatica.util.ConditionalExpression conditional)
Specified by:
setCondition in interface Block

getCondition

public info.informatica.util.ConditionalExpression getCondition()
Specified by:
getCondition in interface Block

filterChildXHTMLElement

public info.informatica.doc.dom4j.CSSStylableElement filterChildXHTMLElement(info.informatica.doc.dom4j.CSSStylableElement element)
Description copied from interface: Block
When any CSSStylableElement is added as a child of the peer ReportElement, it is filtered through this method.

If the method returns null, the element will not be added.

Specified by:
filterChildXHTMLElement in interface Block
Parameters:
element - the child element.
Returns:
the child element, maybe modified, or null if it must not be added as child.

filterChildReportElement

public ReportElement filterChildReportElement(ReportElement element)
Description copied from interface: Block
When any ReportElement is added as a child of the peer ReportElement, it is filtered through this method.

If the method returns null, the element will not be added.

Specified by:
filterChildReportElement in interface Block
Parameters:
element - the child element.
Returns:
the child element, maybe modified, or null if it must not be added as child.

init

public abstract void init()
                   throws info.informatica.doc.DocumentFormatException
Arranges the block for printing. This method must be called before printing.

Note that blocks implementing NativeBlock must also call initRender(), after init().

This method needs to be called only once, typically before generating the data to be able to check for configuration errors.

Specified by:
init in interface Block
Throws:
info.informatica.doc.DocumentFormatException

printSample

public void printSample(ReportWriter rw)
                 throws info.informatica.doc.RenderingException
Description copied from interface: Block
Print a sample of this block. This operation is optional.

Specified by:
printSample in interface Block
Parameters:
rw - the ReportWriter to write to.
Throws:
info.informatica.doc.RenderingException - if cannot render the sample.