Package org.apache.fop.fo

Examples of org.apache.fop.fo.ValidationException


        if (parent.getName().equals("fo:page-sequence-master")) {
            PageSequenceMaster pageSequenceMaster = (PageSequenceMaster)parent;
            pageSequenceMaster.addSubsequenceSpecifier(this);
        } else {
            throw new ValidationException("fo:repeatable-page-master-alternatives "
                                   + "must be child of fo:page-sequence-master, not "
                                   + parent.getName(), locator);
        }
    }
View Full Code Here


                root.getLayoutMasterSet().getSimplePageMaster(masterReference);
        if (this.simplePageMaster == null) {
            this.pageSequenceMaster =
                    root.getLayoutMasterSet().getPageSequenceMaster(masterReference);
            if (this.pageSequenceMaster == null) {
                throw new ValidationException("master-reference '" + masterReference
                   + "' for fo:page-sequence matches no"
                   + " simple-page-master or page-sequence-master", locator);
            } else {
                pageSequenceMaster.reset();
            }
View Full Code Here

     */
     private void addFlow(Flow flow) throws ValidationException {
        String flowName = flow.getFlowName();

        if (hasFlowName(flowName)) {
            throw new ValidationException("duplicate flow-name \""
                + flowName
                + "\" found within fo:page-sequence", flow.getLocator());
        }

        if (!root.getLayoutMasterSet().regionNameExists(flowName)
            && !flowName.equals("xsl-before-float-separator")
            && !flowName.equals("xsl-footnote-separator")) {
                throw new ValidationException("flow-name \""
                    + flowName
                    + "\" could not be mapped to a region-name in the"
                    + " layout-master-set", flow.getLocator());
        }
    }
View Full Code Here

    /**
     * @see org.apache.fop.fo.FONode#startOfNode()
     */
    protected void startOfNode() throws FOPException {
        if (getFlowName() == null || getFlowName().equals("")) {
            throw new ValidationException("A 'flow-name' is required for "
                                   + getName() + ".", locator);
        }
        getFOEventHandler().startFlow(this);
    }
View Full Code Here

                Region region = (Region) e.next();
                if (allRegions.containsKey(region.getRegionName())) {
                    String defaultRegionName =
                        (String) allRegions.get(region.getRegionName());
                    if (!defaultRegionName.equals(region.getDefaultRegionName())) {
                        throw new ValidationException("Region-name ("
                                               + region.getRegionName()
                                               + ") is being mapped to multiple "
                                               + "region-classes ("
                                               + defaultRegionName + " and "
                                               + region.getDefaultRegionName()
View Full Code Here

                throws ValidationException {

        // check for duplication of master-name
        String masterName = sPM.getMasterName();
        if (existsName(masterName)) {
            throw new ValidationException("'master-name' ("
               + masterName
               + ") must be unique "
               + "across page-masters and page-sequence-masters", sPM.locator);
        }
        this.simplePageMasters.put(masterName, sPM);
View Full Code Here

    protected void addPageSequenceMaster(String masterName,
                                        PageSequenceMaster pSM)
                throws ValidationException {
        // check against duplication of master-name
        if (existsName(masterName)) {
            throw new ValidationException("'master-name' ("
               + masterName
               + ") must be unique "
               + "across page-masters and page-sequence-masters", pSM.locator);
        }
        this.pageSequenceMasters.put(masterName, pSM);
View Full Code Here

                root.getLayoutMasterSet().getSimplePageMaster(masterReference);
        if (this.simplePageMaster == null) {
            this.pageSequenceMaster =
                    root.getLayoutMasterSet().getPageSequenceMaster(masterReference);
            if (this.pageSequenceMaster == null) {
                throw new ValidationException("master-reference '" + masterReference
                   + "' for fo:page-sequence matches no"
                   + " simple-page-master or page-sequence-master", locator);
            } else {
                pageSequenceMaster.reset();
            }
View Full Code Here

     */
     private void addFlow(Flow flow) throws ValidationException {
        String flowName = flow.getFlowName();

        if (hasFlowName(flowName)) {
            throw new ValidationException("duplicate flow-name \""
                + flowName
                + "\" found within fo:page-sequence", flow.locator);
        }

        if (!root.getLayoutMasterSet().regionNameExists(flowName)
            && !flowName.equals("xsl-before-float-separator")
            && !flowName.equals("xsl-footnote-separator")) {
                throw new ValidationException("flow-name \""
                    + flowName
                    + "\" could not be mapped to a region-name in the"
                    + " layout-master-set", flow.locator);
        }
    }
View Full Code Here

    /**
     * @see org.apache.fop.fo.FONode#startOfNode()
     */
    protected void startOfNode() throws FOPException {
        if (getFlowName() == null || getFlowName().equals("")) {
            throw new ValidationException("A 'flow-name' is required for "
                                   + getName() + ".", locator);
        }
        getFOEventHandler().startFlow(this);
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.fo.ValidationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.