Class LayoutMasterSet

java.lang.Object
org.apache.fop.fo.FONode
org.apache.fop.fo.FObj
org.apache.fop.fo.pagination.LayoutMasterSet
All Implemented Interfaces:
Cloneable, Constants

public class LayoutMasterSet extends FObj
Class modelling the fo:layout-master-set object. This class maintains the set of simple page master and page sequence masters. The masters are stored so that the page sequence can obtain the required page master to create a page. The page sequence masters can be reset as they hold state information for a page sequence.
  • Constructor Details

    • LayoutMasterSet

      public LayoutMasterSet(FONode parent)
      Create a LayoutMasterSet instance that is a child of the given parent FONode.
      Parameters:
      parent - FONode that is the parent of this object
  • Method Details

    • bind

      public void bind(PropertyList pList) throws FOPException
      Bind property values from the property list to the FO node. Must be overridden in all FObj subclasses that have properties applying to it.
      Overrides:
      bind in class FObj
      Parameters:
      pList - the PropertyList where the properties can be found.
      Throws:
      FOPException - if there is a problem binding the values
    • startOfNode

      public void startOfNode() throws FOPException
      Called after processNode() is called. Subclasses can do additional processing.
      Overrides:
      startOfNode in class FObj
      Throws:
      FOPException - FOP Exception
    • 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
    • validateChildNode

      protected void validateChildNode(Locator loc, String nsURI, String localName) throws ValidationException
      Checks to make sure, during SAX processing of input document, that the incoming node is valid for this (parent) node (e.g., checking to see that fo:table is not an immediate child of fo:root) called from FOTreeBuilder.startElement(String, String, String, Attributes) before constructing the child FObj.
      XSL/FOP: (simple-page-master|page-sequence-master)+
      Overrides:
      validateChildNode in class FONode
      Parameters:
      loc - location in the FO source file
      nsURI - namespace of incoming node
      localName - name of the incoming node (without namespace prefix)
      Throws:
      ValidationException - if incoming node not valid for parent
    • addSimplePageMaster

      protected void addSimplePageMaster(SimplePageMaster sPM) throws ValidationException
      Add a simple page master. The name is checked to throw an error if already added.
      Parameters:
      sPM - simple-page-master to add
      Throws:
      ValidationException - if there's a problem with name uniqueness
    • getSimplePageMaster

      public SimplePageMaster getSimplePageMaster(String masterName)
      Get a simple page master by name. This is used by the page sequence to get a page master for creating pages.
      Parameters:
      masterName - the name of the page master
      Returns:
      the requested simple-page-master
    • addPageSequenceMaster

      protected void addPageSequenceMaster(String masterName, PageSequenceMaster pSM) throws ValidationException
      Add a page sequence master. The name is checked to throw an error if already added.
      Parameters:
      masterName - name for the master
      pSM - PageSequenceMaster instance
      Throws:
      ValidationException - if there's a problem with name uniqueness
    • getPageSequenceMaster

      public PageSequenceMaster getPageSequenceMaster(String masterName)
      Get a page sequence master by name. This is used by the page sequence to get a page master for creating pages.
      Parameters:
      masterName - name of the master
      Returns:
      the requested PageSequenceMaster instance
    • regionNameExists

      public boolean regionNameExists(String regionName)
      Checks whether or not a region name exists in this master set.
      Parameters:
      regionName - name of the region
      Returns:
      true when the region name specified has a region in this LayoutMasterSet
    • getLocalName

      public String getLocalName()
      Returns the local name (i.e. without namespace prefix) of the node
      Specified by:
      getLocalName in class FONode
      Returns:
      the local name of this node
    • getNameId

      public int getNameId()
      Returns the Constants class integer value of this node
      Overrides:
      getNameId in class FONode
      Returns:
      Constants.FO_LAYOUT_MASTER_SET
    • getDefaultRegionNameFor

      public String getDefaultRegionNameFor(String flowName)
      Returns the default name of the region to which the flow or static-content having the given flow-name is assigned.
      Parameters:
      flowName - the value of the flow-name property
      Returns:
      the default region name ("xsl-region-body", "xsl-region-before", etc.)