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
Modifier and TypeFieldDescriptionprotected FontInfo
The Font information relevant for this documentprotected FOUserAgent
The FOUserAgent for this process -
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor for sub-classes that do not need anFOUserAgent
instance.FOEventHandler
(FOUserAgent foUserAgent) Main constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
Process a Character.void
characters
(FOText foText) Process character data.void
void
void
void
void
endColumn
(TableColumn tc) void
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
void
endFooter
(TableFooter footer) void
endFootnote
(Footnote footnote) Process the ending of a footnote.void
endFootnoteBody
(FootnoteBody body) Process the ending of a footnote body.void
endHeader
(TableHeader header) void
void
Process the end of an InstreamForeignObject.void
Process the end of a Leader.void
Process end of a Link.void
void
endListBody
(ListItemBody listItemBody) Process end of a ListBody.void
endListItem
(ListItem li) void
endListLabel
(ListItemLabel listItemLabel) Process end of a ListLabel.void
Process end of a Markup.void
endPageNumber
(PageNumber pagenum) void
endPageNumberCitation
(PageNumberCitation pageCite) void
void
endPageSequence
(PageSequence pageSeq) void
endRetrieveMarker
(RetrieveMarker retrieveMarker) Process the ending of a retrieve-marker.void
endRetrieveTableMarker
(RetrieveTableMarker retrieveTableMarker) Process the ending of a retrieve-table-marker.void
Called upon end of root element.void
void
endStatic
(StaticContent staticContent) Process end of a Static.void
void
endWrapper
(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.void
image
(ExternalGraphic eg) Process an ExternalGraphic.void
pageRef()
Process a pageRef.void
restoreState
(RetrieveMarker retrieveMarker) Restore the state of this event handler as it was when the given fo:retrieve-marker element was processed.void
restoreState
(RetrieveTableMarker retrieveTableMarker) void
startBlock
(Block bl) void
void
void
void
void
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
This method is called to indicate the start of a new fo:flow or fo:static-content.void
startFooter
(TableFooter footer) void
startFootnote
(Footnote footnote) Process the start of a footnote.void
Process the start of a footnote body.void
startHeader
(TableHeader header) void
startInline
(Inline inl) void
Process the start of an InstreamForeignObject.void
Process the start of a Leader.void
Process start of a Link.void
void
startListBody
(ListItemBody listItemBody) Process start of a ListBody.void
void
startListLabel
(ListItemLabel listItemLabel) Process start of a ListLabel.void
Process start of a Markup.void
startPageNumber
(PageNumber pagenum) void
startPageNumberCitation
(PageNumberCitation pageCite) void
void
startPageSequence
(PageSequence pageSeq) void
startRetrieveMarker
(RetrieveMarker retrieveMarker) Process the start of a retrieve-marker.void
startRetrieveTableMarker
(RetrieveTableMarker retrieveTableMarker) Process the start of a retrieve-table-marker.void
Called upon start of root element.void
void
startStatic
(StaticContent staticContent) Process start of a Static.void
startTable
(Table tbl) void
startWrapper
(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 anFOUserAgent
instance.
-
-
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
-