Class ConditionalPageMasterReference

  • All Implemented Interfaces:
    java.lang.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.
    • Field Detail

      • masterReference

        private java.lang.String masterReference
      • pagePosition

        private int pagePosition
      • oddOrEven

        private int oddOrEven
      • blankOrNotBlank

        private int blankOrNotBlank
    • Constructor Detail

      • 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 Detail

      • 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​(org.xml.sax.Locator loc,
                                         java.lang.String nsURI,
                                         java.lang.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 java.lang.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
      • 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