Class SinglePageMasterReference

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

public class SinglePageMasterReference extends FObj implements SubSequenceSpecifier
Class modelling the fo:single-page-master-reference object. This is a reference for a single page. It returns the master name only once until reset.
  • Constructor Details

    • SinglePageMasterReference

      public SinglePageMasterReference(FONode parent)
      Creates a new SinglePageMasterReference instance that is a child of the given 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
    • 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 Content Model: empty
      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
    • getNextPageMaster

      public SimplePageMaster getNextPageMaster(boolean isOddPage, boolean isFirstPage, boolean isLastPage, boolean isBlankPage, boolean skipPagePositionOnly)
      Returns the name of the next page master.
      Specified by:
      getNextPageMaster in interface SubSequenceSpecifier
      Parameters:
      isOddPage - True if the next page number is odd
      isFirstPage - True if the next page is the first
      isLastPage - True if the next page is the last
      isBlankPage - True if the next page is blank
      Returns:
      the page master name
    • getLastPageMaster

      public SimplePageMaster getLastPageMaster(boolean isOddPage, boolean isFirstPage, boolean isBlankPage, BlockLevelEventProducer blockLevelEventProducer)
      Specified by:
      getLastPageMaster in interface SubSequenceSpecifier
    • reset

      public void reset()
      Called before a new page sequence is rendered so subsequences can reset any state they keep during the formatting process.
      Specified by:
      reset in interface SubSequenceSpecifier
    • goToPrevious

      public boolean goToPrevious()
      Used to set the "cursor position" to the previous item.
      Specified by:
      goToPrevious in interface SubSequenceSpecifier
      Returns:
      true if there is a previous item, false if the current one was the first one.
    • hasPagePositionLast

      public boolean hasPagePositionLast()
      Specified by:
      hasPagePositionLast in interface SubSequenceSpecifier
      Returns:
      true if the subsequence has a page master for page-position "last"
    • hasPagePositionOnly

      public boolean hasPagePositionOnly()
      Specified by:
      hasPagePositionOnly in interface SubSequenceSpecifier
      Returns:
      true if the subsequence has a page master for page-position "only"
    • 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_SINGLE_PAGE_MASTER_REFERENCE
    • resolveReferences

      public void resolveReferences(LayoutMasterSet layoutMasterSet) throws ValidationException
      called by the parent LayoutMasterSet to resolve object references from simple page master reference names
      Specified by:
      resolveReferences in interface SubSequenceSpecifier
      Parameters:
      layoutMasterSet - the layout-master-set
      Throws:
      ValidationException - when a named reference cannot be resolved
    • canProcess

      public boolean canProcess(String flowName)
      Specified by:
      canProcess in interface SubSequenceSpecifier
      Parameters:
      flowName - name of the main flow
      Returns:
      true iff page sequence is a finite sequence or can process the entire main flow
    • isInfinite

      public boolean isInfinite()
      Test that this is a finite sequence
      Specified by:
      isInfinite in interface SubSequenceSpecifier
      Returns:
      true iff this is a finite sequence
    • isReusable

      public boolean isReusable()
      Test if this can be reused when it is the last sub-sequence specifer, and has been exhausted
      Specified by:
      isReusable in interface SubSequenceSpecifier
      Returns:
      true if and only if it can be reused