FOEventHandler (Apache FOP 2.7 API)
Date: 2022-01-12

org.apache.fop.fo

## Class FOEventHandler

- java.lang.Object
- - org.apache.fop.fo.FOEventHandler

- Direct Known Subclasses:
    AreaTreeHandler, DelegatingFOEventHandler, 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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected FontInfo` | `fontInfo` The Font information relevant for this document
    `protected FOUserAgent` | `foUserAgent` The FOUserAgent for this process

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `FOEventHandler()` Constructor for sub-classes that do not need an `FOUserAgent` instance.
    `` | `FOEventHandler(FOUserAgent foUserAgent)` Main constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `character(Character c)` Process a Character.
    `void` | `characters(FOText foText)` Process character data.
    `void` | `endBlock(Block bl)`
    `void` | `endBlockContainer(BlockContainer blc)`
    `void` | `endBody(TableBody body)`
    `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(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` | `endInline(Inline inl)`
    `void` | `endInstreamForeignObject(InstreamForeignObject ifo)` Process the end of an InstreamForeignObject.
    `void` | `endLeader(Leader l)` Process the end of a Leader.
    `void` | `endLink(BasicLink basicLink)` Process end of a Link.
    `void` | `endList(ListBlock lb)`
    `void` | `endListBody(ListItemBody listItemBody)` Process end of a ListBody.
    `void` | `endListItem(ListItem li)`
    `void` | `endListLabel(ListItemLabel listItemLabel)` 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` | `endRetrieveMarker(RetrieveMarker retrieveMarker)` Process the ending of a retrieve-marker.
    `void` | `endRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker)` Process the ending of a retrieve-table-marker.
    `void` | `endRoot(Root root)` Called upon end of root element.
    `void` | `endRow(TableRow tr)`
    `void` | `endStatic(StaticContent staticContent)` Process end of a Static.
    `void` | `endTable(Table tbl)`
    `void` | `endWrapper(Wrapper wrapper)` Process the ending of a wrapper.
    `FontInfo` | `getFontInfo()` Retrieve the font information for this document
    `FormattingResults` | `getResults()` Get formatting results.
    `FOUserAgent` | `getUserAgent()` 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)` See `restoreState(RetrieveMarker)`.
    `void` | `startBlock(Block bl)`
    `void` | `startBlockContainer(BlockContainer blc)`
    `void` | `startBody(TableBody body)`
    `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(TableFooter footer)`
    `void` | `startFootnote(Footnote footnote)` Process the start of a footnote.
    `void` | `startFootnoteBody(FootnoteBody body)` Process the start of a footnote body.
    `void` | `startHeader(TableHeader header)`
    `void` | `startInline(Inline inl)`
    `void` | `startInstreamForeignObject(InstreamForeignObject ifo)` Process the start of an InstreamForeignObject.
    `void` | `startLeader(Leader l)` Process the start of a Leader.
    `void` | `startLink(BasicLink basicLink)` Process start of a Link.
    `void` | `startList(ListBlock lb)`
    `void` | `startListBody(ListItemBody listItemBody)` Process start of a ListBody.
    `void` | `startListItem(ListItem li)`
    `void` | `startListLabel(ListItemLabel listItemLabel)` 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` | `startRetrieveMarker(RetrieveMarker retrieveMarker)` Process the start of a retrieve-marker.
    `void` | `startRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker)` Process the start of a retrieve-table-marker.
    `void` | `startRoot(Root root)` Called upon start of root element.
    `void` | `startRow(TableRow tr)`
    `void` | `startStatic(StaticContent staticContent)` Process start of a Static.
    `void` | `startTable(Table tbl)`
    `void` | `startWrapper(Wrapper wrapper)` Process the start of a wrapper.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### foUserAgent

          protected FOUserAgent foUserAgent

      The FOUserAgent for this process

    - #### fontInfo

          protected FontInfo fontInfo

      The Font information relevant for this document

  - ### Constructor Detail

    - #### FOEventHandler

          public FOEventHandler(FOUserAgent foUserAgent)

      Main constructor
      Parameters:
        `foUserAgent` - the apps.FOUserAgent instance for this process

    - #### FOEventHandler

          protected FOEventHandler()

      Constructor for sub-classes that do not need an `FOUserAgent` instance.

  - ### Method Detail

    - #### getUserAgent

          public FOUserAgent getUserAgent()

      Returns the User Agent object associated with this FOEventHandler.
      Returns:
        the User Agent object

    - #### getFontInfo

          public FontInfo getFontInfo()

      Retrieve the font information for this document
      Returns:
        the FontInfo instance for this document

    - #### startDocument

          public void startDocument()
                             throws org.xml.sax.SAXException

      This method is called to indicate the start of a new document run.
      Throws:
        `org.xml.sax.SAXException` - In case of a problem

    - #### endDocument

          public void endDocument()
                           throws org.xml.sax.SAXException

      This method is called to indicate the end of a document run.
      Throws:
        `org.xml.sax.SAXException` - In case of a problem

    - #### startRoot

          public void startRoot(Root root)

      Called upon start of root element.
      Parameters:
        `root` - element

    - #### endRoot

          public void endRoot(Root root)

      Called upon end of root element.
      Parameters:
        `root` - element

    - #### startPageSequence

          public void startPageSequence(PageSequence pageSeq)

      Parameters:
        `pageSeq` - PageSequence that is starting.

    - #### endPageSequence

          public void endPageSequence(PageSequence pageSeq)

      Parameters:
        `pageSeq` - PageSequence that is ending.

    - #### startPageNumber

          public void startPageNumber(PageNumber pagenum)

      Parameters:
        `pagenum` - PageNumber that is starting.

    - #### endPageNumber

          public void endPageNumber(PageNumber pagenum)

      Parameters:
        `pagenum` - PageNumber that is ending.

    - #### startPageNumberCitation

          public void startPageNumberCitation(PageNumberCitation pageCite)

      Parameters:
        `pageCite` - PageNumberCitation that is starting.

    - #### endPageNumberCitation

          public void endPageNumberCitation(PageNumberCitation pageCite)

      Parameters:
        `pageCite` - PageNumberCitation that is ending.

    - #### startPageNumberCitationLast

          public void startPageNumberCitationLast(PageNumberCitationLast pageLast)

      Parameters:
        `pageLast` - PageNumberCitationLast that is starting.

    - #### endPageNumberCitationLast

          public void endPageNumberCitationLast(PageNumberCitationLast pageLast)

      Parameters:
        `pageLast` - PageNumberCitationLast that is ending.

    - #### startStatic

          public void startStatic(StaticContent staticContent)

      Process start of a Static.
      Parameters:
        `staticContent` - StaticContent that is starting

    - #### endStatic

          public void endStatic(StaticContent staticContent)

      Process end of a Static.
      Parameters:
        `staticContent` - StaticContent that is ending

    - #### 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.

    - #### endFlow

          public void endFlow(Flow fl)

      Parameters:
        `fl` - Flow that is ending.

    - #### startBlock

          public void startBlock(Block bl)

      Parameters:
        `bl` - Block that is starting.

    - #### endBlock

          public void endBlock(Block bl)

      Parameters:
        `bl` - Block that is ending.

    - #### startBlockContainer

          public void startBlockContainer(BlockContainer blc)

      Parameters:
        `blc` - BlockContainer that is starting.

    - #### endBlockContainer

          public void endBlockContainer(BlockContainer blc)

      Parameters:
        `blc` - BlockContainer that is ending.

    - #### startInline

          public void startInline(Inline inl)

      Parameters:
        `inl` - Inline that is starting.

    - #### endInline

          public void endInline(Inline inl)

      Parameters:
        `inl` - Inline that is ending.

    - #### startTable

          public void startTable(Table tbl)

      Parameters:
        `tbl` - Table that is starting.

    - #### endTable

          public void endTable(Table tbl)

      Parameters:
        `tbl` - Table that is ending.

    - #### startColumn

          public void startColumn(TableColumn tc)

      Parameters:
        `tc` - TableColumn that is starting;

    - #### endColumn

          public void endColumn(TableColumn tc)

      Parameters:
        `tc` - TableColumn that is ending;

    - #### startHeader

          public void startHeader(TableHeader header)

      Parameters:
        `header` - TableHeader that is starting;

    - #### endHeader

          public void endHeader(TableHeader header)

      Parameters:
        `header` - TableHeader that is ending.

    - #### startFooter

          public void startFooter(TableFooter footer)

      Parameters:
        `footer` - TableFooter that is starting.

    - #### endFooter

          public void endFooter(TableFooter footer)

      Parameters:
        `footer` - TableFooter that is ending.

    - #### startBody

          public void startBody(TableBody body)

      Parameters:
        `body` - TableBody that is starting.

    - #### endBody

          public void endBody(TableBody body)

      Parameters:
        `body` - TableBody that is ending.

    - #### startRow

          public void startRow(TableRow tr)

      Parameters:
        `tr` - TableRow that is starting.

    - #### endRow

          public void endRow(TableRow tr)

      Parameters:
        `tr` - TableRow that is ending.

    - #### startCell

          public void startCell(TableCell tc)

      Parameters:
        `tc` - TableCell that is starting.

    - #### endCell

          public void endCell(TableCell tc)

      Parameters:
        `tc` - TableCell that is ending.

    - #### startList

          public void startList(ListBlock lb)

      Parameters:
        `lb` - ListBlock that is starting.

    - #### endList

          public void endList(ListBlock lb)

      Parameters:
        `lb` - ListBlock that is ending.

    - #### startListItem

          public void startListItem(ListItem li)

      Parameters:
        `li` - ListItem that is starting.

    - #### endListItem

          public void endListItem(ListItem li)

      Parameters:
        `li` - ListItem that is ending.

    - #### startListLabel

          public void startListLabel(ListItemLabel listItemLabel)

      Process start of a ListLabel.
      Parameters:
        `listItemLabel` - ListItemLabel that is starting

    - #### endListLabel

          public void endListLabel(ListItemLabel listItemLabel)

      Process end of a ListLabel.
      Parameters:
        `listItemLabel` - ListItemLabel that is ending

    - #### startListBody

          public void startListBody(ListItemBody listItemBody)

      Process start of a ListBody.
      Parameters:
        `listItemBody` - ListItemBody that is starting

    - #### endListBody

          public void endListBody(ListItemBody listItemBody)

      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

          public void startLink(BasicLink basicLink)

      Process start of a Link.
      Parameters:
        `basicLink` - BasicLink that is starting

    - #### endLink

          public void endLink(BasicLink basicLink)

      Process end of a Link.
      Parameters:
        `basicLink` - BasicLink that is ending

    - #### image

          public void image(ExternalGraphic eg)

      Process an ExternalGraphic.
      Parameters:
        `eg` - ExternalGraphic to process.

    - #### pageRef

          public void pageRef()

      Process a pageRef.

    - #### startInstreamForeignObject

          public void startInstreamForeignObject(InstreamForeignObject ifo)

      Process the start of an InstreamForeignObject.
      Parameters:
        `ifo` - InstreamForeignObject that is starting

    - #### endInstreamForeignObject

          public void endInstreamForeignObject(InstreamForeignObject ifo)

      Process the end of an InstreamForeignObject.
      Parameters:
        `ifo` - InstreamForeignObject that is ending

    - #### startFootnote

          public void startFootnote(Footnote footnote)

      Process the start of a footnote.
      Parameters:
        `footnote` - Footnote that is starting

    - #### endFootnote

          public void endFootnote(Footnote footnote)

      Process the ending of a footnote.
      Parameters:
        `footnote` - Footnote that is ending

    - #### startFootnoteBody

          public void startFootnoteBody(FootnoteBody body)

      Process the start of a footnote body.
      Parameters:
        `body` - FootnoteBody that is starting

    - #### endFootnoteBody

          public void endFootnoteBody(FootnoteBody body)

      Process the ending of a footnote body.
      Parameters:
        `body` - FootnoteBody that is ending

    - #### startLeader

          public void startLeader(Leader l)

      Process the start of a Leader.
      Parameters:
        `l` - Leader that is starting

    - #### endLeader

          public void endLeader(Leader l)

      Process the end of a Leader.
      Parameters:
        `l` - Leader that is ending

    - #### startWrapper

          public void startWrapper(Wrapper wrapper)

      Process the start of a wrapper.
      Parameters:
        `wrapper` - wrapper that is starting

    - #### endWrapper

          public void endWrapper(Wrapper wrapper)

      Process the ending of a wrapper.
      Parameters:
        `wrapper` - wrapper that is ending

    - #### startRetrieveMarker

          public void startRetrieveMarker(RetrieveMarker retrieveMarker)

      Process the start of a retrieve-marker.
      Parameters:
        `retrieveMarker` - the retrieve-marker that is starting

    - #### endRetrieveMarker

          public void endRetrieveMarker(RetrieveMarker retrieveMarker)

      Process the ending of a retrieve-marker.
      Parameters:
        `retrieveMarker` - the retrieve-marker that is ending

    - #### restoreState

          public void restoreState(RetrieveMarker retrieveMarker)

      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

          public void startRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker)

      Process the start of a retrieve-table-marker.
      Parameters:
        `retrieveTableMarker` - the retrieve-table-marker that is starting

    - #### endRetrieveTableMarker

          public void endRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker)

      Process the ending of a retrieve-table-marker.
      Parameters:
        `retrieveTableMarker` - the retrieve-table-marker that is ending

    - #### restoreState

          public void restoreState(RetrieveTableMarker retrieveTableMarker)

      See `restoreState(RetrieveMarker)`.

    - #### character

          public void character(Character c)

      Process a Character.
      Parameters:
        `c` - Character to process.

    - #### characters

          public void characters(FOText foText)

      Process character data.
      Parameters:
        `foText` - text to process

    - #### startExternalDocument

          public void startExternalDocument(ExternalDocument document)

      Process the start of the external-document extension.
      Parameters:
        `document` - the external-document node

    - #### endExternalDocument

          public void endExternalDocument(ExternalDocument document)

      Process the end of the external-document extension.
      Parameters:
        `document` - the external-document node

    - #### getResults

          public FormattingResults getResults()

      Get formatting results.
      Returns:
        the FormattingResults instance for this document

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