Package org.apache.fop.apps

Examples of org.apache.fop.apps.FOPException


        if (parent.getName().equals("fo:root")) {
            this.root = (Root)parent;
            // this.root.addPageSequence(this);
        }
        else {
            throw new FOPException("page-sequence must be child of root, not "
                                   + parent.getName());
        }

        layoutMasterSet = root.getLayoutMasterSet();

        // best time to run some checks on LayoutMasterSet
        layoutMasterSet.checkRegionNames();

        _flowMap = new Hashtable();

        thisIsFirstPage =
            true;    // we are now on the first page of the page sequence
        ipnValue = this.properties.get("initial-page-number").getString();

        if (ipnValue.equals("auto")) {
            pageNumberType = AUTO;
        } else if (ipnValue.equals("auto-even")) {
            pageNumberType = AUTO_EVEN;
        } else if (ipnValue.equals("auto-odd")) {
            pageNumberType = AUTO_ODD;
        } else {
            pageNumberType = EXPLICIT;
            try {
                int pageStart = new Integer(ipnValue).intValue();
                this.currentPageNumber = (pageStart > 0) ? pageStart - 1 : 0;
            } catch (NumberFormatException nfe) {
                throw new FOPException("\"" + ipnValue
                                       + "\" is not a valid value for initial-page-number");
            }
        }

        masterName = this.properties.get("master-name").getString();
View Full Code Here


    }


    public void addFlow(Flow flow) throws FOPException {
        if (_flowMap.containsKey(flow.getFlowName())) {
            throw new FOPException("flow-names must be unique within an fo:page-sequence");
        }
        if (!this.layoutMasterSet.regionNameExists(flow.getFlowName())) {
            MessageHandler.errorln("WARNING: region-name '"
                                   + flow.getFlowName()
                                   + "' doesn't exist in the layout-master-set.");
View Full Code Here

                                isFirstPage, isEmptyPage);

        // a legal alternative is to use the last sub-sequence
        // specification which should be handled in getNextSubsequence. That's not done here.
        if (pageMaster == null) {
            throw new FOPException("page masters exhausted. Cannot recover.");
        }
        Page p = pageMaster.makePage(areaTree);
        if (currentPage != null) {
            Vector foots = currentPage.getPendingFootnotes();
            p.setPendingFootnotes(foots);
View Full Code Here

        } else {    // otherwise see if there's a simple master by the given name
            SimplePageMaster simpleMaster =
                this.layoutMasterSet.getSimplePageMaster(pageSequenceName);
            if (simpleMaster == null) {
                throw new FOPException("'master-name' for 'fo:page-sequence'"
                                       + "matches no 'simple-page-master' or 'page-sequence-master'");
            }
            currentPageMasterName = pageSequenceName;

            pageMaster = simpleMaster.getNextPageMaster();
View Full Code Here

                                       + "does not have a master-name and so is being ignored");
            } else {
                this.repeatablePageMasterAlternatives.addConditionalPageMasterReference(this);
            }
        } else {
            throw new FOPException("fo:conditional-page-master-reference must be child "
                                   + "of fo:repeatable-page-master-alternatives, not "
                                   + parent.getName());
        }
    }
View Full Code Here

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

        String mr = getProperty("maximum-repeats").getString();
        if (mr.equals("no-limit")) {
            setMaximumRepeats(INFINITE);
        } else {
            try {
                setMaximumRepeats(Integer.parseInt(mr));
            } catch (NumberFormatException nfe) {
                throw new FOPException("Invalid number for "
                                       + "'maximum-repeats' property");
            }
        }

    }
View Full Code Here

        blockArea.setAbsoluteHeight(area.getAbsoluteHeight());
        blockArea.setIDReferences(area.getIDReferences());

        int numChildren = this.children.size();
        if (numChildren != 2) {
            throw new FOPException("list-item must have exactly two children");
        }
        ListItemLabel label = (ListItemLabel)children.elementAt(0);
        ListItemBody body = (ListItemBody)children.elementAt(1);

        Status status;
View Full Code Here

        if (rootFObj == null) {
            rootFObj = fobj;
            rootFObj.setBufferManager(this.bufferManager);
            if (!fobj.getName().equals("fo:root")) {
                throw new SAXException(new FOPException("Root element must"
                                                        + " be root, not "
                                                        + fobj.getName()));
            }
        } else if(!(fobj instanceof org.apache.fop.fo.pagination.PageSequence)) {
            currentFObj.addChild(fobj);
View Full Code Here

                    }
                }
            }

        } else {
            throw new FOPException("Illegal 'retrieve-position' value");
        }
        return null;
    }
View Full Code Here

    public void addMarker(Marker marker) throws FOPException {
        String mcname = marker.getMarkerClassName();
        if (!markers.containsKey(mcname) && children.isEmpty())
            markers.put(mcname, marker);
        else
            throw new FOPException("fo:marker must be an initial child,"
                                   + "and 'marker-class-name' must be unique for same parent");
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.apps.FOPException

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.