Class ConditionalPageMasterReference

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

public class ConditionalPageMasterReference extends FObj
Class modelling the fo:conditional-page-master-reference object. This is a reference to a page master with a set of conditions. The conditions must be satisfied for the referenced master to be used. This element is must be the child of a repeatable-page-master-alternatives element.
  • Constructor Details

    • ConditionalPageMasterReference

      public ConditionalPageMasterReference(FONode parent)
      Create a ConditionalPageMasterReference 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
    • isValid

      protected boolean isValid(boolean isOddPage, boolean isFirstPage, boolean isLastPage, boolean isBlankPage)
      Check if the conditions for this reference are met. checks the page number and emptyness to determine if this matches.
      Parameters:
      isOddPage - True if page number odd
      isFirstPage - True if page is first page
      isLastPage - True if page is last page
      isBlankPage - True if page is blank
      Returns:
      True if the conditions for this reference are met
    • getMaster

      public SimplePageMaster getMaster()
      Get the value for the master-reference property.
      Returns:
      the "master-reference" property
    • getPagePosition

      public int getPagePosition()
      Get the value for the page-position property.
      Returns:
      the page-position property value
    • 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_CONDITIONAL_PAGE_MASTER_REFERENCE
    • resolveReferences

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