org.apache.fop.area

## Class AreaTreeParser

- java.lang.Object
- - org.apache.fop.area.AreaTreeParser

-     public class AreaTreeParser
      extends Object

  This is a parser for the area tree XML (intermediate format) which is used to reread an area tree (or part of it) into memory again for rendering to the final output format.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.apache.commons.logging.Log` | `log` Logger instance

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AreaTreeParser()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ContentHandler` | `getContentHandler(AreaTreeModel treeModel, FOUserAgent userAgent)` Creates a new ContentHandler instance that you can send the area tree XML to.
    `void` | `parse(Source src, AreaTreeModel treeModel, FOUserAgent userAgent)` Parses an intermediate file (area tree XML) into an AreaTreeModel instance by adding pages to it.

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

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

- - ### Field Detail

    - #### log

          protected static final org.apache.commons.logging.Log log

      Logger instance

  - ### Constructor Detail

    - #### AreaTreeParser

          public AreaTreeParser()

  - ### Method Detail

    - #### parse

          public void parse(Source src,
                            AreaTreeModel treeModel,
                            FOUserAgent userAgent)
                     throws TransformerException

      Parses an intermediate file (area tree XML) into an AreaTreeModel instance by adding pages to it.
      Parameters:
        `src` - the Source instance pointing to the intermediate file
        `treeModel` - the AreaTreeModel that the parsed pages are added to
        `userAgent` - the user agent
      Throws:
        `TransformerException` - if an error occurs while parsing the area tree XML

    - #### getContentHandler

          public ContentHandler getContentHandler(AreaTreeModel treeModel,
                                                  FOUserAgent userAgent)

      Creates a new ContentHandler instance that you can send the area tree XML to. The parsed pages are added to the AreaTreeModel instance you pass in as a parameter.
      Parameters:
        `treeModel` - the AreaTreeModel that the parsed pages are added to
        `userAgent` - the user agent
      Returns:
        the ContentHandler instance to receive the SAX stream from the area tree XML

Copyright © 2023 Apache Software Foundation. All rights reserved.