org.apache.fop.fo

Class FOEventHandler

Known Direct Subclasses:
AreaTreeHandler, MIFHandler, RTFHandler

public abstract class FOEventHandler
extends java.lang.Object

Abstract class defining what should be done with SAX events that map to XSL-FO input. The events are actually captured by fo/FOTreeBuilder, passed to the various fo Objects, which in turn, if needed, pass them to an instance of FOEventHandler. Sub-classes will generally fall into one of two categories: 1) a handler that actually builds an FO Tree from the events, or 2) a handler that builds a structured (as opposed to formatted) document, such as our MIF and RTF output targets.

Field Summary

protected FOUserAgent
foUserAgent
The FOUserAgent for this process
protected FontInfo
fontInfo
The Font information relevant for this document
protected PropertyListMaker
propertyListMaker
The property list maker.
protected XMLWhiteSpaceHandler
whiteSpaceHandler
The XMLWhitespaceHandler for this tree

Constructor Summary

FOEventHandler(FOUserAgent foUserAgent)
Main constructor

Method Summary

void
character(Character c)
Process a Character.
void
characters(data[] , int start, int length)
Process character data.
void
endBlock(Block bl)
void
endBlockContainer(BlockContainer blc)
void
endBody(TableBody tb)
void
endCell(TableCell tc)
void
endColumn(TableColumn tc)
void
endDocument()
This method is called to indicate the end of a document run.
void
endExternalDocument(ExternalDocument document)
Process the end of the external-document extension.
void
endFlow(Flow fl)
void
endFooter(TableBody tf)
void
endFootnote(Footnote footnote)
Process the ending of a footnote.
void
endFootnoteBody(FootnoteBody body)
Process the ending of a footnote body.
void
endHeader(TableBody th)
void
endInline(Inline inl)
void
endLink()
Process end of a Link.
void
endList(ListBlock lb)
void
endListBody()
Process end of a ListBody.
void
endListItem(ListItem li)
void
endListLabel()
Process end of a ListLabel.
void
endMarkup()
Process end of a Markup.
void
endPageNumber(PageNumber pagenum)
void
endPageNumberCitation(PageNumberCitation pageCite)
void
endPageNumberCitationLast(PageNumberCitationLast pageLast)
void
endPageSequence(PageSequence pageSeq)
void
endRow(TableRow tr)
void
endStatic()
Process end of a Static.
void
endTable(Table tbl)
void
foreignObject(InstreamForeignObject ifo)
Process an InstreamForeignObject.
FontInfo
getFontInfo()
Retrieve the font information for this document
Set
getIDReferences()
Retuns the set of ID references.
PropertyListMaker
getPropertyListMaker()
Return the propertyListMaker.
FOUserAgent
getUserAgent()
Returns the User Agent object associated with this FOEventHandler.
XMLWhiteSpaceHandler
getXMLWhiteSpaceHandler()
Return the XMLWhiteSpaceHandler
void
image(ExternalGraphic eg)
Process an ExternalGraphic.
protected boolean
inMarker()
Check whether in marker context
void
leader(Leader l)
Process a Leader.
void
pageRef()
Process a pageRef.
void
setPropertyListMaker(PropertyListMaker propertyListMaker)
Set a new propertyListMaker.
void
startBlock(Block bl)
void
startBlockContainer(BlockContainer blc)
void
startBody(TableBody tb)
void
startCell(TableCell tc)
void
startColumn(TableColumn tc)
void
startDocument()
This method is called to indicate the start of a new document run.
void
startExternalDocument(ExternalDocument document)
Process the start of the external-document extension.
void
startFlow(Flow fl)
This method is called to indicate the start of a new fo:flow or fo:static-content.
void
startFooter(TableBody tf)
void
startFootnote(Footnote footnote)
Process the start of a footnote.
void
startFootnoteBody(FootnoteBody body)
Process the start of a footnote body.
void
startHeader(TableBody th)
void
startInline(Inline inl)
void
startLink(BasicLink basicLink)
Process start of a Link.
void
startList(ListBlock lb)
void
startListBody()
Process start of a ListBody.
void
startListItem(ListItem li)
void
startListLabel()
Process start of a ListLabel.
void
startMarkup()
Process start of a Markup.
void
startPageNumber(PageNumber pagenum)
void
startPageNumberCitation(PageNumberCitation pageCite)
void
startPageNumberCitationLast(PageNumberCitationLast pageLast)
void
startPageSequence(PageSequence pageSeq)
void
startRow(TableRow tr)
void
startStatic()
Process start of a Static.
void
startTable(Table tbl)
protected void
switchMarkerContext(boolean inMarker)
Switch to or from marker context (used by FOTreeBuilder when processing a marker)

Field Details

foUserAgent

protected FOUserAgent foUserAgent
The FOUserAgent for this process

fontInfo

protected FontInfo fontInfo
The Font information relevant for this document

propertyListMaker

protected PropertyListMaker propertyListMaker
The property list maker.

whiteSpaceHandler

protected XMLWhiteSpaceHandler whiteSpaceHandler
The XMLWhitespaceHandler for this tree

Constructor Details

FOEventHandler

public FOEventHandler(FOUserAgent foUserAgent)
Main constructor
Parameters:
foUserAgent - the apps.FOUserAgent instance for this process

Method Details

character

public void character(Character c)
Process a Character.
Parameters:
c - Character to process.

characters

public void characters(data[] ,
                       int start,
                       int length)
Process character data.
Parameters:
start - Offset for characters to process.
length - Portion of array to process.

endBlock

public void endBlock(Block bl)
Parameters:
bl - Block that is ending.

endBlockContainer

public void endBlockContainer(BlockContainer blc)
Parameters:
blc - BlockContainer that is ending.

endBody

public void endBody(TableBody tb)
Parameters:
tb - TableBody that is ending.

endCell

public void endCell(TableCell tc)
Parameters:
tc - TableCell that is ending.

endColumn

public void endColumn(TableColumn tc)
Parameters:
tc - TableColumn that is ending;

endDocument

public void endDocument()
            throws SAXException
This method is called to indicate the end of a document run.

endExternalDocument

public void endExternalDocument(ExternalDocument document)
Process the end of the external-document extension.
Parameters:
document - the external-document node

endFlow

public void endFlow(Flow fl)
Parameters:
fl - Flow that is ending.

endFooter

public void endFooter(TableBody tf)
Parameters:
tf - TableFooter that is ending.

endFootnote

public void endFootnote(Footnote footnote)
Process the ending of a footnote.
Parameters:
footnote - Footnote that is ending

endFootnoteBody

public void endFootnoteBody(FootnoteBody body)
Process the ending of a footnote body.
Parameters:
body - FootnoteBody that is ending

endHeader

public void endHeader(TableBody th)
Parameters:
th - TableBody that is ending.

endInline

public void endInline(Inline inl)
Parameters:
inl - Inline that is ending.

endLink

public void endLink()
Process end of a Link.

endList

public void endList(ListBlock lb)
Parameters:
lb - ListBlock that is ending.

endListBody

public void endListBody()
Process end of a ListBody.

endListItem

public void endListItem(ListItem li)
Parameters:
li - ListItem that is ending.

endListLabel

public void endListLabel()
Process end of a ListLabel.

endMarkup

public void endMarkup()
Process end of a Markup.

endPageNumber

public void endPageNumber(PageNumber pagenum)
Parameters:
pagenum - PageNumber that is ending.

endPageNumberCitation

public void endPageNumberCitation(PageNumberCitation pageCite)
Parameters:
pageCite - PageNumberCitation that is ending.

endPageNumberCitationLast

public void endPageNumberCitationLast(PageNumberCitationLast pageLast)
Parameters:
pageLast - PageNumberCitationLast that is ending.

endPageSequence

public void endPageSequence(PageSequence pageSeq)
Parameters:
pageSeq - PageSequence that is ending.

endRow

public void endRow(TableRow tr)
Parameters:
tr - TableRow that is ending.

endStatic

public void endStatic()
Process end of a Static.

endTable

public void endTable(Table tbl)
Parameters:
tbl - Table that is ending.

foreignObject

public void foreignObject(InstreamForeignObject ifo)
Process an InstreamForeignObject.
Parameters:
ifo - InstreamForeignObject to process.

getFontInfo

public FontInfo getFontInfo()
Retrieve the font information for this document
Returns:
the FontInfo instance for this document

getIDReferences

public Set getIDReferences()
Retuns the set of ID references.
Returns:
the ID references

getPropertyListMaker

public PropertyListMaker getPropertyListMaker()
Return the propertyListMaker.

getUserAgent

public FOUserAgent getUserAgent()
Returns the User Agent object associated with this FOEventHandler.
Returns:
the User Agent object

getXMLWhiteSpaceHandler

public XMLWhiteSpaceHandler getXMLWhiteSpaceHandler()
Return the XMLWhiteSpaceHandler
Returns:
the whiteSpaceHandler

image

public void image(ExternalGraphic eg)
Process an ExternalGraphic.
Parameters:
eg - ExternalGraphic to process.

inMarker

protected boolean inMarker()
Check whether in marker context

leader

public void leader(Leader l)
Process a Leader.
Parameters:
l - Leader to process.

pageRef

public void pageRef()
Process a pageRef.

setPropertyListMaker

public void setPropertyListMaker(PropertyListMaker propertyListMaker)
Set a new propertyListMaker.

startBlock

public void startBlock(Block bl)
Parameters:
bl - Block that is starting.

startBlockContainer

public void startBlockContainer(BlockContainer blc)
Parameters:
blc - BlockContainer that is starting.

startBody

public void startBody(TableBody tb)
Parameters:
tb - TableBody that is starting.

startCell

public void startCell(TableCell tc)
Parameters:
tc - TableCell that is starting.

startColumn

public void startColumn(TableColumn tc)
Parameters:
tc - TableColumn that is starting;

startDocument

public void startDocument()
            throws SAXException
This method is called to indicate the start of a new document run.

startExternalDocument

public void startExternalDocument(ExternalDocument document)
Process the start of the external-document extension.
Parameters:
document - the external-document node

startFlow

public void startFlow(Flow fl)
This method is called to indicate the start of a new fo:flow or fo:static-content. This method also handles fo:static-content tags, because the StaticContent class is derived from the Flow class.
Parameters:
fl - Flow that is starting.

startFooter

public void startFooter(TableBody tf)
Parameters:
tf - TableFooter that is starting.

startFootnote

public void startFootnote(Footnote footnote)
Process the start of a footnote.
Parameters:
footnote - Footnote that is starting

startFootnoteBody

public void startFootnoteBody(FootnoteBody body)
Process the start of a footnote body.
Parameters:
body - FootnoteBody that is starting

startHeader

public void startHeader(TableBody th)
Parameters:
th - TableBody that is starting;

startInline

public void startInline(Inline inl)
Parameters:
inl - Inline that is starting.

startLink

public void startLink(BasicLink basicLink)
Process start of a Link.
Parameters:
basicLink - BasicLink that is ending

startList

public void startList(ListBlock lb)
Parameters:
lb - ListBlock that is starting.

startListBody

public void startListBody()
Process start of a ListBody.

startListItem

public void startListItem(ListItem li)
Parameters:
li - ListItem that is starting.

startListLabel

public void startListLabel()
Process start of a ListLabel.

startMarkup

public void startMarkup()
Process start of a Markup.

startPageNumber

public void startPageNumber(PageNumber pagenum)
Parameters:
pagenum - PageNumber that is starting.

startPageNumberCitation

public void startPageNumberCitation(PageNumberCitation pageCite)
Parameters:
pageCite - PageNumberCitation that is starting.

startPageNumberCitationLast

public void startPageNumberCitationLast(PageNumberCitationLast pageLast)
Parameters:
pageLast - PageNumberCitationLast that is starting.

startPageSequence

public void startPageSequence(PageSequence pageSeq)
Parameters:
pageSeq - PageSequence that is starting.

startRow

public void startRow(TableRow tr)
Parameters:
tr - TableRow that is starting.

startStatic

public void startStatic()
Process start of a Static.

startTable

public void startTable(Table tbl)
Parameters:
tbl - Table that is starting.

switchMarkerContext

protected void switchMarkerContext(boolean inMarker)
Switch to or from marker context (used by FOTreeBuilder when processing a marker)

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.