org.jfree.layouting.normalizer.content

Class RecordingContentNormalizer

Implemented Interfaces:
Normalizer, StatefullComponent

public final class RecordingContentNormalizer
extends ChainingComponent
implements Normalizer

This class records all incoming calls and replays them later.
Author:
Thomas Morgner

Nested Class Summary

Nested classes/interfaces inherited from class org.jfree.layouting.util.ChainingComponent

ChainingComponent.RecordedCall

Field Summary

Fields inherited from class org.jfree.layouting.util.ChainingComponent

STATE_DONE, STATE_ERROR, STATE_FRESH

Constructor Summary

RecordingContentNormalizer()

Method Summary

void
addText(String text)
Adds text content to the current element.
void
clear()
void
endDocument()
Ends the document.
void
endElement()
Ends the current element.
int
getElementDepth()
Renderer
getRenderer()
Returns the renderer.
StyleResolver
getStyleResolver()
String
getText()
void
handlePageBreak(CSSValue pageName, PseudoPage[] pseudoPages)
protected void
invoke(Object target, int methodId, Object params)
State
saveState()
void
startDocument()
Start document is the first call to the normalizer.
void
startElement(String namespace, String tag, AttributeMap attributes)
Starts a new element.

Methods inherited from class org.jfree.layouting.util.ChainingComponent

addCall, clear, invoke, replay, retrieveRecordedCalls, setRecordedCalls

Constructor Details

RecordingContentNormalizer

public RecordingContentNormalizer()

Method Details

addText

public void addText(String text)
Adds text content to the current element.
Specified by:
addText in interface Normalizer
Parameters:
text -

clear

public void clear()
Overrides:
clear in interface ChainingComponent

endDocument

public void endDocument()
Ends the document. No other events will be fired against this normalizer once this method has been called.
Specified by:
endDocument in interface Normalizer

endElement

public void endElement()
Ends the current element. The namespace and tagname are given for convienience.
Specified by:
endElement in interface Normalizer
Parameters:

getElementDepth

public int getElementDepth()

getRenderer

public Renderer getRenderer()
Returns the renderer. The renderer is the last step in the processing chain. The ModelBuilder and ContentGenerator steps are considered internal, as they may refeed the normalizer.
Specified by:
getRenderer in interface Normalizer
Returns:

getStyleResolver

public StyleResolver getStyleResolver()

getText

public String getText()

handlePageBreak

public void handlePageBreak(CSSValue pageName,
                            PseudoPage[] pseudoPages)
Specified by:
handlePageBreak in interface Normalizer

invoke

protected void invoke(Object target,
                      int methodId,
                      Object params)
            throws Exception
Overrides:
invoke in interface ChainingComponent

saveState

public State saveState()
Specified by:
saveState in interface StatefullComponent

startDocument

public void startDocument()
Start document is the first call to the normalizer. At this point, all meta-data has been given and the document context is filled correctly.

Starting the document also starts a new PageContext.

Specified by:
startDocument in interface Normalizer

startElement

public void startElement(String namespace,
                         String tag,
                         AttributeMap attributes)
Starts a new element. The element uses the given namespace and tagname. The element's attributes are given as collection, each attribute is keyed with a namespace and attributename. The values contained in the attributes are not defined.
Specified by:
startElement in interface Normalizer
Parameters:
namespace -
tag -
attributes -