Class FObjMixed

All Implemented Interfaces:
Cloneable, Constants
Direct Known Subclasses:
AbstractRetrieveMarker, Block, InlineLevel, Marker, Wrapper

public abstract class FObjMixed extends FObj
Abstract base class for representation of mixed content formatting objects (= those that can contain both child FONodes and #PCDATA).
  • Field Details

    • currentTextNode

      protected FONode currentTextNode
      Used for white-space handling; start CharIterator at node ...
    • lastFOTextProcessed

      protected FOText lastFOTextProcessed
      Used in creating pointers between subsequent FOText nodes in the same Block (for handling text-transform)
  • Constructor Details

    • FObjMixed

      protected FObjMixed(FONode parent)
      Base constructor
      Parameters:
      parent - FONode that is the parent of this object
  • Method Details

    • clone

      public FONode clone(FONode parent, boolean removeChildren) throws FOPException
      Description copied from class: FObj
      Performs a shallow cloning operation, sets the clone's parent, and optionally cleans the list of child nodes
      Overrides:
      clone in class FObj
      Parameters:
      parent - the intended parent of the clone
      removeChildren - if true, clean the list of child nodes
      Returns:
      the cloned FO node
      Throws:
      FOPException - if there's a problem while cloning the node
    • characters

      protected void characters(char[] data, int start, int length, PropertyList pList, Locator locator) throws FOPException
      Adds characters. Does nothing by default. To be overridden in subclasses that allow #PCDATA content.
      Overrides:
      characters in class FONode
      Parameters:
      data - array of characters containing text to be added
      start - starting array element to add
      length - number of elements to add
      pList - currently applicable PropertyList
      locator - location in the XSL-FO source file.
      Throws:
      FOPException - if there's a problem during processing
    • endOfNode

      public void endOfNode() throws FOPException
      Primarily used for making final content model validation checks and/or informing the FOEventHandler that the end of this FO has been reached. The default implementation simply calls FONode.finalizeNode(), without sending any event to the FOEventHandler.

      Note: the recommended way to override this method in subclasses is

      super.endOfNode(); // invoke finalizeNode()

      getFOEventHandler().endXXX(); // send endOfNode() notification

      Overrides:
      endOfNode in class FObj
      Throws:
      FOPException - FOP Exception
    • handleWhiteSpaceFor

      protected static void handleWhiteSpaceFor(FObjMixed fobj, FONode nextChild)
      Handles white-space for the node that is passed in, starting at its current text-node (used by RetrieveMarker to trigger 'end-of-node' white-space handling)
      Parameters:
      fobj - the node for which to handle white-space
      nextChild - the next child to be added
    • addChildNode

      protected void addChildNode(FONode child) throws FOPException
      Adds a node as a child of this node. The default implementation of this method just ignores any child node being added.
      Overrides:
      addChildNode in class FObj
      Parameters:
      child - child node to be added to the childNodes of this node
      Throws:
      FOPException - if there's a problem during processing
    • removeChild

      public void removeChild(FONode child)
      Removes a child node. Used by the child nodes to remove themselves, for example table-body if it has no children.
      Overrides:
      removeChild in class FObj
      Parameters:
      child - child node to be removed
    • finalizeNode

      public void finalizeNode() throws FOPException
      Finalize this node. This method can be overridden by subclasses to perform finishing tasks (cleanup, validation checks, ...) without triggering endXXX() events in the FOEventHandler. The method is called by the default FONode.endOfNode() implementation.
      Overrides:
      finalizeNode in class FONode
      Throws:
      FOPException - in case there was an error
    • charIterator

      public CharIterator charIterator()
      Returns a CharIterator over this FO's character content
      Overrides:
      charIterator in class FONode
      Returns:
      iterator for this object