Class PageSequenceMaster

  • All Implemented Interfaces:
    java.lang.Cloneable, Constants

    public class PageSequenceMaster
    extends FObj
    Class modelling the fo:page-sequence-master object. This class handles a list of subsequence specifiers which are simple or complex references to page-masters.
    • Constructor Detail

      • PageSequenceMaster

        public PageSequenceMaster​(FONode parent,
                                  BlockLevelEventProducer blockLevelEventProducer)
        Create a PageSequenceMaster instance that is a child of the given FONode.
        Parameters:
        parent - FONode that is the parent of this object
        blockLevelEventProducer - event producer
    • 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
      • 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 FONode
        Throws:
        FOPException - if there's a problem during processing
      • 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/FOP: (single-page-master-reference|repeatable-page-master-reference| repeatable-page-master-alternatives)+
        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
      • addSubsequenceSpecifier

        protected void addSubsequenceSpecifier​(SubSequenceSpecifier pageMasterReference)
        Adds a new suqsequence specifier to the page sequence master.
        Parameters:
        pageMasterReference - the subsequence to add
      • reset

        public void reset()
        Resets the subsequence specifiers subsystem.
      • goToPreviousSimplePageMaster

        public boolean goToPreviousSimplePageMaster()
        Used to set the "cursor position" for the page masters to the previous item.
        Returns:
        true if there is a previous item, false if the current one was the first one.
      • hasPagePositionLast

        public boolean hasPagePositionLast()
        Returns:
        true if the page-sequence-master has a page-master with page-position="last"
      • hasPagePositionOnly

        public boolean hasPagePositionOnly()
        Returns:
        true if the page-sequence-master has a page-master with page-position="only"
      • getNextSimplePageMaster

        public SimplePageMaster getNextSimplePageMaster​(boolean isOddPage,
                                                        boolean isFirstPage,
                                                        boolean isLastPage,
                                                        boolean isBlankPage,
                                                        java.lang.String mainFlowName)
                                                 throws PageProductionException
        Returns the next simple-page-master.
        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
        mainFlowName - the name of the main flow of the page sequence
        Returns:
        the requested page master
        Throws:
        PageProductionException - if there's a problem determining the next page master
      • 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
      • getLastSimplePageMaster

        public SimplePageMaster getLastSimplePageMaster​(boolean isOddPage,
                                                        boolean isFirstPage,
                                                        boolean isBlank,
                                                        java.lang.String flowName)