Package org.apache.fop.fo
Class FOEventHandler
java.lang.Object
org.apache.fop.fo.FOEventHandler
- Direct Known Subclasses:
AreaTreeHandler,DelegatingFOEventHandler,RTFHandler
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
FieldsModifier and TypeFieldDescriptionprotected FontInfoThe Font information relevant for this documentprotected FOUserAgentThe FOUserAgent for this process -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor for sub-classes that do not need anFOUserAgentinstance.FOEventHandler(FOUserAgent foUserAgent) Main constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidProcess a Character.voidcharacters(FOText foText) Process character data.voidvoidvoidvoidvoidendColumn(TableColumn tc) voidThis method is called to indicate the end of a document run.voidendExternalDocument(ExternalDocument document) Process the end of the external-document extension.voidvoidendFooter(TableFooter footer) voidendFootnote(Footnote footnote) Process the ending of a footnote.voidendFootnoteBody(FootnoteBody body) Process the ending of a footnote body.voidendHeader(TableHeader header) voidvoidProcess the end of an InstreamForeignObject.voidProcess the end of a Leader.voidProcess end of a Link.voidvoidendListBody(ListItemBody listItemBody) Process end of a ListBody.voidendListItem(ListItem li) voidendListLabel(ListItemLabel listItemLabel) Process end of a ListLabel.voidProcess end of a Markup.voidendPageNumber(PageNumber pagenum) voidendPageNumberCitation(PageNumberCitation pageCite) voidvoidendPageSequence(PageSequence pageSeq) voidendRetrieveMarker(RetrieveMarker retrieveMarker) Process the ending of a retrieve-marker.voidendRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker) Process the ending of a retrieve-table-marker.voidCalled upon end of root element.voidvoidendStatic(StaticContent staticContent) Process end of a Static.voidvoidendWrapper(Wrapper wrapper) Process the ending of a wrapper.Retrieve the font information for this documentGet formatting results.Returns the User Agent object associated with this FOEventHandler.voidimage(ExternalGraphic eg) Process an ExternalGraphic.voidpageRef()Process a pageRef.voidrestoreState(RetrieveMarker retrieveMarker) Restore the state of this event handler as it was when the given fo:retrieve-marker element was processed.voidrestoreState(RetrieveTableMarker retrieveTableMarker) voidstartBlock(Block bl) voidvoidvoidvoidvoidThis method is called to indicate the start of a new document run.voidstartExternalDocument(ExternalDocument document) Process the start of the external-document extension.voidThis method is called to indicate the start of a new fo:flow or fo:static-content.voidstartFooter(TableFooter footer) voidstartFootnote(Footnote footnote) Process the start of a footnote.voidProcess the start of a footnote body.voidstartHeader(TableHeader header) voidstartInline(Inline inl) voidProcess the start of an InstreamForeignObject.voidProcess the start of a Leader.voidProcess start of a Link.voidvoidstartListBody(ListItemBody listItemBody) Process start of a ListBody.voidvoidstartListLabel(ListItemLabel listItemLabel) Process start of a ListLabel.voidProcess start of a Markup.voidstartPageNumber(PageNumber pagenum) voidstartPageNumberCitation(PageNumberCitation pageCite) voidvoidstartPageSequence(PageSequence pageSeq) voidstartRetrieveMarker(RetrieveMarker retrieveMarker) Process the start of a retrieve-marker.voidstartRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker) Process the start of a retrieve-table-marker.voidCalled upon start of root element.voidvoidstartStatic(StaticContent staticContent) Process start of a Static.voidstartTable(Table tbl) voidstartWrapper(Wrapper wrapper) Process the start of a wrapper.
-
Field Details
-
foUserAgent
The FOUserAgent for this process -
fontInfo
The Font information relevant for this document
-
-
Constructor Details
-
FOEventHandler
Main constructor- Parameters:
foUserAgent- the apps.FOUserAgent instance for this process
-
FOEventHandler
protected FOEventHandler()Constructor for sub-classes that do not need anFOUserAgentinstance.
-
-
Method Details
-
getUserAgent
Returns the User Agent object associated with this FOEventHandler.- Returns:
- the User Agent object
-
getFontInfo
Retrieve the font information for this document- Returns:
- the FontInfo instance for this document
-
startDocument
This method is called to indicate the start of a new document run.- Throws:
SAXException- In case of a problem
-
endDocument
This method is called to indicate the end of a document run.- Throws:
SAXException- In case of a problem
-
startRoot
Called upon start of root element.- Parameters:
root- element
-
endRoot
Called upon end of root element.- Parameters:
root- element
-
startPageSequence
- Parameters:
pageSeq- PageSequence that is starting.
-
endPageSequence
- Parameters:
pageSeq- PageSequence that is ending.
-
startPageNumber
- Parameters:
pagenum- PageNumber that is starting.
-
endPageNumber
- Parameters:
pagenum- PageNumber that is ending.
-
startPageNumberCitation
- Parameters:
pageCite- PageNumberCitation that is starting.
-
endPageNumberCitation
- Parameters:
pageCite- PageNumberCitation that is ending.
-
startPageNumberCitationLast
- Parameters:
pageLast- PageNumberCitationLast that is starting.
-
endPageNumberCitationLast
- Parameters:
pageLast- PageNumberCitationLast that is ending.
-
startStatic
Process start of a Static.- Parameters:
staticContent- StaticContent that is starting
-
endStatic
Process end of a Static.- Parameters:
staticContent- StaticContent that is ending
-
startFlow
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.
-
endFlow
- Parameters:
fl- Flow that is ending.
-
startBlock
- Parameters:
bl- Block that is starting.
-
endBlock
- Parameters:
bl- Block that is ending.
-
startBlockContainer
- Parameters:
blc- BlockContainer that is starting.
-
endBlockContainer
- Parameters:
blc- BlockContainer that is ending.
-
startInline
- Parameters:
inl- Inline that is starting.
-
endInline
- Parameters:
inl- Inline that is ending.
-
startTable
- Parameters:
tbl- Table that is starting.
-
endTable
- Parameters:
tbl- Table that is ending.
-
startColumn
- Parameters:
tc- TableColumn that is starting;
-
endColumn
- Parameters:
tc- TableColumn that is ending;
-
startHeader
- Parameters:
header- TableHeader that is starting;
-
endHeader
- Parameters:
header- TableHeader that is ending.
-
startBody
- Parameters:
body- TableBody that is starting.
-
endBody
- Parameters:
body- TableBody that is ending.
-
startRow
- Parameters:
tr- TableRow that is starting.
-
endRow
- Parameters:
tr- TableRow that is ending.
-
startCell
- Parameters:
tc- TableCell that is starting.
-
endCell
- Parameters:
tc- TableCell that is ending.
-
startList
- Parameters:
lb- ListBlock that is starting.
-
endList
- Parameters:
lb- ListBlock that is ending.
-
startListItem
- Parameters:
li- ListItem that is starting.
-
endListItem
- Parameters:
li- ListItem that is ending.
-
startListLabel
Process start of a ListLabel.- Parameters:
listItemLabel- ListItemLabel that is starting
-
endListLabel
Process end of a ListLabel.- Parameters:
listItemLabel- ListItemLabel that is ending
-
startListBody
Process start of a ListBody.- Parameters:
listItemBody- ListItemBody that is starting
-
endListBody
Process end of a ListBody.- Parameters:
listItemBody- ListItemBody that is ending
-
startMarkup
public void startMarkup()Process start of a Markup. -
endMarkup
public void endMarkup()Process end of a Markup. -
startLink
Process start of a Link.- Parameters:
basicLink- BasicLink that is starting
-
endLink
Process end of a Link.- Parameters:
basicLink- BasicLink that is ending
-
image
Process an ExternalGraphic.- Parameters:
eg- ExternalGraphic to process.
-
pageRef
public void pageRef()Process a pageRef. -
startInstreamForeignObject
Process the start of an InstreamForeignObject.- Parameters:
ifo- InstreamForeignObject that is starting
-
endInstreamForeignObject
Process the end of an InstreamForeignObject.- Parameters:
ifo- InstreamForeignObject that is ending
-
startFootnote
Process the start of a footnote.- Parameters:
footnote- Footnote that is starting
-
endFootnote
Process the ending of a footnote.- Parameters:
footnote- Footnote that is ending
-
startFootnoteBody
Process the start of a footnote body.- Parameters:
body- FootnoteBody that is starting
-
endFootnoteBody
Process the ending of a footnote body.- Parameters:
body- FootnoteBody that is ending
-
startLeader
Process the start of a Leader.- Parameters:
l- Leader that is starting
-
endLeader
Process the end of a Leader.- Parameters:
l- Leader that is ending
-
startWrapper
Process the start of a wrapper.- Parameters:
wrapper- wrapper that is starting
-
endWrapper
Process the ending of a wrapper.- Parameters:
wrapper- wrapper that is ending
-
startRetrieveMarker
Process the start of a retrieve-marker.- Parameters:
retrieveMarker- the retrieve-marker that is starting
-
endRetrieveMarker
Process the ending of a retrieve-marker.- Parameters:
retrieveMarker- the retrieve-marker that is ending
-
restoreState
Restore the state of this event handler as it was when the given fo:retrieve-marker element was processed. This method is called at marker retrieval time, so that events for the marker descendants are fired within the proper context.The default implementation of this method does nothing.
- Parameters:
retrieveMarker- the fo:retrieve-marker element that is retrieving markers
-
startRetrieveTableMarker
Process the start of a retrieve-table-marker.- Parameters:
retrieveTableMarker- the retrieve-table-marker that is starting
-
endRetrieveTableMarker
Process the ending of a retrieve-table-marker.- Parameters:
retrieveTableMarker- the retrieve-table-marker that is ending
-
restoreState
-
character
Process a Character.- Parameters:
c- Character to process.
-
characters
Process character data.- Parameters:
foText- text to process
-
startExternalDocument
Process the start of the external-document extension.- Parameters:
document- the external-document node
-
endExternalDocument
Process the end of the external-document extension.- Parameters:
document- the external-document node
-
getResults
Get formatting results.- Returns:
- the FormattingResults instance for this document
-