]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
New exception hierarchy rooted in SAXException and throw clauses on
authorFinn Bock <bckfnn@apache.org>
Thu, 28 Oct 2004 10:00:25 +0000 (10:00 +0000)
committerFinn Bock <bckfnn@apache.org>
Thu, 28 Oct 2004 10:00:25 +0000 (10:00 +0000)
property parsing and retrieval.

PR: 31899

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198106 13f79535-47bb-0310-9956-ffa450edef68

106 files changed:
examples/mathml/src/org/apache/fop/mathml/MathMLElement.java
examples/plan/src/org/apache/fop/plan/PlanElement.java
src/java/org/apache/fop/apps/FOPException.java
src/java/org/apache/fop/datatypes/LengthBase.java
src/java/org/apache/fop/datatypes/PercentBase.java
src/java/org/apache/fop/fo/FONode.java
src/java/org/apache/fop/fo/FOPropertyMapping.java
src/java/org/apache/fop/fo/FOText.java
src/java/org/apache/fop/fo/FOTreeBuilder.java
src/java/org/apache/fop/fo/FObj.java
src/java/org/apache/fop/fo/FObjMixed.java
src/java/org/apache/fop/fo/PropertyList.java
src/java/org/apache/fop/fo/StaticPropertyList.java
src/java/org/apache/fop/fo/ValidationException.java [new file with mode: 0755]
src/java/org/apache/fop/fo/XMLObj.java
src/java/org/apache/fop/fo/expr/NumericProperty.java
src/java/org/apache/fop/fo/expr/PropertyException.java
src/java/org/apache/fop/fo/expr/PropertyInfo.java
src/java/org/apache/fop/fo/expr/PropertyParser.java
src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java
src/java/org/apache/fop/fo/extensions/Bookmarks.java
src/java/org/apache/fop/fo/extensions/ExtensionObj.java
src/java/org/apache/fop/fo/extensions/Outline.java
src/java/org/apache/fop/fo/extensions/svg/SVGElement.java
src/java/org/apache/fop/fo/flow/BasicLink.java
src/java/org/apache/fop/fo/flow/BidiOverride.java
src/java/org/apache/fop/fo/flow/Block.java
src/java/org/apache/fop/fo/flow/BlockContainer.java
src/java/org/apache/fop/fo/flow/Character.java
src/java/org/apache/fop/fo/flow/ExternalGraphic.java
src/java/org/apache/fop/fo/flow/Float.java
src/java/org/apache/fop/fo/flow/Footnote.java
src/java/org/apache/fop/fo/flow/FootnoteBody.java
src/java/org/apache/fop/fo/flow/InitialPropertySet.java
src/java/org/apache/fop/fo/flow/Inline.java
src/java/org/apache/fop/fo/flow/InlineContainer.java
src/java/org/apache/fop/fo/flow/InstreamForeignObject.java
src/java/org/apache/fop/fo/flow/Leader.java
src/java/org/apache/fop/fo/flow/ListBlock.java
src/java/org/apache/fop/fo/flow/ListItem.java
src/java/org/apache/fop/fo/flow/ListItemBody.java
src/java/org/apache/fop/fo/flow/ListItemLabel.java
src/java/org/apache/fop/fo/flow/Marker.java
src/java/org/apache/fop/fo/flow/MultiCase.java
src/java/org/apache/fop/fo/flow/MultiProperties.java
src/java/org/apache/fop/fo/flow/MultiPropertySet.java
src/java/org/apache/fop/fo/flow/MultiSwitch.java
src/java/org/apache/fop/fo/flow/MultiToggle.java
src/java/org/apache/fop/fo/flow/PageNumber.java
src/java/org/apache/fop/fo/flow/PageNumberCitation.java
src/java/org/apache/fop/fo/flow/RetrieveMarker.java
src/java/org/apache/fop/fo/flow/Table.java
src/java/org/apache/fop/fo/flow/TableAndCaption.java
src/java/org/apache/fop/fo/flow/TableBody.java
src/java/org/apache/fop/fo/flow/TableCaption.java
src/java/org/apache/fop/fo/flow/TableCell.java
src/java/org/apache/fop/fo/flow/TableColumn.java
src/java/org/apache/fop/fo/flow/TableRow.java
src/java/org/apache/fop/fo/flow/Wrapper.java
src/java/org/apache/fop/fo/pagination/ColorProfile.java
src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
src/java/org/apache/fop/fo/pagination/Declarations.java
src/java/org/apache/fop/fo/pagination/Flow.java
src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
src/java/org/apache/fop/fo/pagination/PageSequence.java
src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
src/java/org/apache/fop/fo/pagination/Region.java
src/java/org/apache/fop/fo/pagination/RegionBA.java
src/java/org/apache/fop/fo/pagination/RegionBody.java
src/java/org/apache/fop/fo/pagination/RegionSE.java
src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
src/java/org/apache/fop/fo/pagination/Root.java
src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
src/java/org/apache/fop/fo/pagination/StaticContent.java
src/java/org/apache/fop/fo/pagination/Title.java
src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java
src/java/org/apache/fop/fo/properties/BoxPropShorthandParser.java
src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java
src/java/org/apache/fop/fo/properties/CommonAccessibility.java
src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
src/java/org/apache/fop/fo/properties/CommonFont.java
src/java/org/apache/fop/fo/properties/CommonHyphenation.java
src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
src/java/org/apache/fop/fo/properties/CommonMarginInline.java
src/java/org/apache/fop/fo/properties/CommonRelativePosition.java
src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java
src/java/org/apache/fop/fo/properties/CondLengthProperty.java
src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java
src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java
src/java/org/apache/fop/fo/properties/EnumProperty.java
src/java/org/apache/fop/fo/properties/GenericShorthandParser.java
src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java
src/java/org/apache/fop/fo/properties/KeepProperty.java
src/java/org/apache/fop/fo/properties/LengthPairProperty.java
src/java/org/apache/fop/fo/properties/LengthProperty.java
src/java/org/apache/fop/fo/properties/LengthRangeProperty.java
src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
src/java/org/apache/fop/fo/properties/PercentLength.java
src/java/org/apache/fop/fo/properties/Property.java
src/java/org/apache/fop/fo/properties/PropertyMaker.java
src/java/org/apache/fop/fo/properties/ShorthandParser.java
src/java/org/apache/fop/fo/properties/SpaceProperty.java
src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java
src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java

index 5167aa0f45d161191d9cc4653fd9affe21b92453..025ed602083b15ea0cb3f2cf71565446d3b5c46e 100644 (file)
@@ -22,6 +22,7 @@ import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.geom.Point2D;
 
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.Document;
@@ -30,7 +31,6 @@ import org.w3c.dom.Node;
 
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
 import org.apache.batik.svggen.SVGGraphics2D;
 import org.apache.batik.dom.svg.SVGDOMImplementation;
@@ -59,7 +59,7 @@ public class MathMLElement extends MathMLObj {
      * @see org.apache.fop.fo.FONode#processNode
      */
     public void processNode(String elementName, Locator locator, 
-                            Attributes attlist) throws SAXParseException {
+                            Attributes attlist) throws FOPException {
         super.processNode(elementName, locator, attlist);
         createBasicDocument();
     }
index bdf6ec7fad4204d78497d484d90dcdf33906e459..7bec2861dc3a50cbf323e1bc276e9bd3699df162 100644 (file)
@@ -20,13 +20,13 @@ package org.apache.fop.plan;
 
 import java.awt.geom.Point2D;
 
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.PropertyList;
 
 import org.w3c.dom.Document;
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
 /**
  * This class defines the plan element.
@@ -50,7 +50,7 @@ public class PlanElement extends PlanObj {
      */
     public void processNode(String elementName, Locator locator, 
                             Attributes attlist, PropertyList propertyList)
-        throws SAXParseException
+        throws FOPException
     {
         super.processNode(elementName, locator, attlist, propertyList);
         createBasicDocument();
index 4cd855365cb780b03a8c6d650eab2665c795da31..569a025f1bc4fc023203355f763cd5f7d294fbfa 100644 (file)
 
 package org.apache.fop.apps;
 
+import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
 
 /**
  * Exception thrown when FOP has a problem.
  */
-public class FOPException extends Exception {
+public class FOPException extends SAXException {
 
     private static final String EXCEPTION_SEPARATOR = "\n---------\n";
 
-    private Throwable exception;
     private String systemId;
     private int line;
     private int column;
@@ -48,13 +48,18 @@ public class FOPException extends Exception {
         this.column = column;
     }
 
+    public FOPException(String message, Locator locator) {
+        super(message);
+        setLocator(locator);
+    }
+
+
     /**
      *
      * @param e Throwable object
      */
-    public FOPException(Throwable e) {
-        super(e.getMessage());
-        setException(e);
+    public FOPException(Exception e) {
+        super(e);
     }
 
     /**
@@ -64,23 +69,14 @@ public class FOPException extends Exception {
      */
     public FOPException(String message, Throwable e) {
         super(message);
-        setException(e);
-    }
-
-    /**
-     * Sets exception
-     * @param t Throwable object
-     */
-    protected void setException(Throwable t) {
-        exception = t;
     }
 
-    /**
-     * Accessor for exception
-     * @return exception
-     */
-    public Throwable getException() {
-        return exception;
+    public void setLocator(Locator locator) {
+        if (locator != null) {
+            this.systemId = locator.getSystemId();
+            this.line = locator.getLineNumber();
+            this.column = locator.getColumnNumber();
+        }
     }
 
     public void setLocation(String systemId, int line, int column) {
@@ -90,7 +86,15 @@ public class FOPException extends Exception {
     }
 
     public boolean isLocationSet() {
-        return line>=0;
+        return line > 0;
+    }
+
+    public String getMessage() {
+        if (isLocationSet()) {
+            return systemId + ":" + line + "," + column + " " + super.getMessage();
+        } else {
+            return super.getMessage();
+        }
     }
 
     /**
@@ -98,7 +102,7 @@ public class FOPException extends Exception {
      * @return the exception recast as another type if possible, otherwise null.
      */
     protected Throwable getRootException() {
-        Throwable result = exception;
+        Throwable result = getException();
 
         if (result instanceof SAXException) {
             result = ((SAXException)result).getException();
@@ -107,7 +111,7 @@ public class FOPException extends Exception {
             result =
                 ((java.lang.reflect.InvocationTargetException)result).getTargetException();
         }
-        if (result != exception) {
+        if (result != getException()) {
             return result;
         }
         return null;
@@ -119,9 +123,9 @@ public class FOPException extends Exception {
     public void printStackTrace() {
         synchronized (System.err) {
             super.printStackTrace();
-            if (exception != null) {
+            if (getException() != null) {
                 System.err.println(EXCEPTION_SEPARATOR);
-                exception.printStackTrace();
+                getException().printStackTrace();
             }
             if (getRootException() != null) {
                 System.err.println(EXCEPTION_SEPARATOR);
@@ -137,9 +141,9 @@ public class FOPException extends Exception {
     public void printStackTrace(java.io.PrintStream stream) {
         synchronized (stream) {
             super.printStackTrace(stream);
-            if (exception != null) {
+            if (getException() != null) {
                 stream.println(EXCEPTION_SEPARATOR);
-                exception.printStackTrace(stream);
+                getException().printStackTrace(stream);
             }
             if (getRootException() != null) {
                 stream.println(EXCEPTION_SEPARATOR);
@@ -155,9 +159,9 @@ public class FOPException extends Exception {
     public void printStackTrace(java.io.PrintWriter writer) {
         synchronized (writer) {
             super.printStackTrace(writer);
-            if (exception != null) {
+            if (getException() != null) {
                 writer.println(EXCEPTION_SEPARATOR);
-                exception.printStackTrace(writer);
+                getException().printStackTrace(writer);
             }
             if (getRootException() != null) {
                 writer.println(EXCEPTION_SEPARATOR);
index e6b105d5cef38954b1a4e76f2416f57a729968f2..45df34d8c471f92de13070bca6c2a9a7c7edb7d7 100644 (file)
 
 package org.apache.fop.datatypes;
 
-import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.Constants;
+import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Models a length which can be used as a factor in a percentage length
@@ -110,7 +111,7 @@ public class LengthBase implements PercentBase {
     /**
      * @return the base length (in millipoints ??) of this object
      */
-    public int getBaseLength() {
+    public int getBaseLength() throws PropertyException {
         switch (iBaseType) {
         case FONTSIZE:
             return propertyList.get(Constants.PR_FONT_SIZE).getLength().getValue();
index 36408474361b7f80f7e186a911969850a76070c8..031a828cee856faa2a02bac6587f4c08eac0fd4f 100644 (file)
@@ -18,6 +18,8 @@
 
 package org.apache.fop.datatypes;
 
+import org.apache.fop.fo.expr.PropertyException;
+
 /**
  * Interface for objects that can be used as base objects for percentage
  * computations
@@ -37,5 +39,5 @@ public interface PercentBase {
      * which a percentage will be applied to compute the length of the
      * referencing item)
      */
-    int getBaseLength();
+    int getBaseLength() throws PropertyException;
 }
index 22a966f48bdee0482f87f489fb3797bb276a50fe..d128454beb232c238649de3b5bcebb8f354a48e4 100644 (file)
@@ -21,19 +21,18 @@ package org.apache.fop.fo;
 // Java
 import java.util.List;
 import java.util.ListIterator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
-// XML
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.util.CharUtilities;
 import org.apache.fop.fo.extensions.ExtensionElementMapping;
 import org.apache.fop.fo.extensions.svg.SVGElementMapping;
+import org.apache.fop.util.CharUtilities;
 
 /**
  * base class for nodes in the XML tree
@@ -105,10 +104,10 @@ public abstract class FONode {
      * @param elementName element name (e.g., "fo:block")
      * @param locator Locator object (ignored by default)
      * @param attlist Collection of attributes passed to us from the parser.
-     * @throws SAXParseException for errors or inconsistencies in the attributes
+     * @throws FOPException for errors or inconsistencies in the attributes
     */
     public void processNode(String elementName, Locator locator, 
-            Attributes attlist, PropertyList parent) throws SAXParseException {
+            Attributes attlist, PropertyList parent) throws FOPException {
         System.out.println("name = " + elementName);
     }
 
@@ -120,7 +119,7 @@ public abstract class FONode {
      *              instance can be found.
      * @return A new property list.
      */
-    protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws SAXParseException {
+    protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws FOPException {
         return null;
     }
 
@@ -131,10 +130,10 @@ public abstract class FONode {
      * called within FObj constructor
      * @param namespaceURI namespace of incoming node
      * @param localName (e.g. "table" for "fo:table")
-     * @throws SAXParseException if incoming node not valid for parent
+     * @throws ValidationException if incoming node not valid for parent
      */
     protected void validateChildNode(Locator loc, String namespaceURI, String localName) 
-        throws SAXParseException {}
+        throws ValidationException {}
 
     /**
      * Adds characters (does nothing here)
@@ -145,28 +144,28 @@ public abstract class FONode {
      */
     protected void addCharacters(char data[], int start, int length,
                                  PropertyList pList,
-                                 Locator locator) throws SAXParseException {
+                                 Locator locator) throws FOPException {
         // ignore
     }
 
     /**
     *
     */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         // do nothing by default
    }
 
     /**
      *
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         // do nothing by default
     }
 
     /**
      * @param child child node to be added to the childNodes of this node
      */
-    protected void addChildNode(FONode child) throws SAXParseException {
+    protected void addChildNode(FONode child) throws FOPException {
     }
 
     /**
@@ -232,8 +231,8 @@ public abstract class FONode {
      * @param offendingNode incoming node that would cause a duplication.
      */
     protected void attributeError(String problem) 
-        throws SAXParseException {
-        throw new SAXParseException (errorText(locator) + getName() + ", " + 
+        throws ValidationException {
+        throw new ValidationException(errorText(locator) + getName() + ", " + 
             problem, locator);
     }
 
@@ -245,8 +244,8 @@ public abstract class FONode {
      * @param lName local name (i.e., no prefix) of incoming node 
      */
     protected void tooManyNodesError(Locator loc, String nsURI, String lName) 
-        throws SAXParseException {
-        throw new SAXParseException (errorText(loc) + getName() + ", only one " 
+        throws ValidationException {
+        throw new ValidationException(errorText(loc) + getName() + ", only one " 
             + getNodeString(nsURI, lName) + " may be declared.", loc);
     }
 
@@ -258,8 +257,8 @@ public abstract class FONode {
      * @param offendingNode incoming node that would cause a duplication.
      */
     protected void tooManyNodesError(Locator loc, String offendingNode) 
-        throws SAXParseException {
-        throw new SAXParseException (errorText(loc) + getName() + ", only one " 
+        throws ValidationException {
+        throw new ValidationException(errorText(loc) + getName() + ", only one " 
             + offendingNode + " may be declared.", loc);
     }
 
@@ -271,8 +270,8 @@ public abstract class FONode {
      * @param tooEarlyNode string name of node that should be later in document
      */
     protected void nodesOutOfOrderError(Locator loc, String tooLateNode, 
-        String tooEarlyNode) throws SAXParseException {
-        throw new SAXParseException (errorText(loc) + "For " + getName() + ", " + tooLateNode 
+        String tooEarlyNode) throws ValidationException {
+        throw new ValidationException(errorText(loc) + "For " + getName() + ", " + tooLateNode 
             + " must be declared before " + tooEarlyNode + ".", loc);
     }
     
@@ -284,7 +283,7 @@ public abstract class FONode {
      * @param lName local name (i.e., no prefix) of incoming node 
      */
     protected void invalidChildError(Locator loc, String nsURI, String lName) 
-        throws SAXParseException {
+        throws ValidationException {
         invalidChildError(loc, nsURI, lName, null);
     }
     
@@ -298,8 +297,8 @@ public abstract class FONode {
      */
     protected void invalidChildError(Locator loc, String nsURI, String lName,
         String ruleViolated)
-        throws SAXParseException {
-        throw new SAXParseException (errorText(loc) + getNodeString(nsURI, lName) + 
+        throws ValidationException {
+        throw new ValidationException(errorText(loc) + getNodeString(nsURI, lName) + 
             " is not a valid child element of " + getName() 
             + ((ruleViolated != null) ? ": " + ruleViolated : "."), loc);
     }
@@ -311,8 +310,8 @@ public abstract class FONode {
      * or a similar description indicating child elements needed.
      */
     protected void missingChildElementError(String contentModel)
-        throws SAXParseException {
-        throw new SAXParseException(errorText(locator) + getName() + 
+        throws ValidationException {
+        throw new ValidationException(errorText(locator) + getName() + 
             " is missing child elements. \nRequired Content Model: " 
             + contentModel, locator);
     }
@@ -324,8 +323,8 @@ public abstract class FONode {
      * or a similar description indicating child elements needed.
      */
     protected void missingPropertyError(String propertyName)
-        throws SAXParseException {
-        throw new SAXParseException(errorText(locator) + getName() +
+        throws ValidationException {
+        throw new ValidationException(errorText(locator) + getName() +
             " is missing required \"" + propertyName + "\" property.", locator);
     }
 
index 1a04b66314e016575b19fd6d08f28262a6445f00..669a3793b00a7336dfc5a80d7252acb5bd70f6a9 100644 (file)
@@ -22,6 +22,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.fop.datatypes.LengthBase;
+import org.apache.fop.fo.expr.PropertyException;
 import org.apache.fop.fo.properties.BorderWidthPropertyMaker;
 import org.apache.fop.fo.properties.BoxPropShorthandParser;
 import org.apache.fop.fo.properties.CharacterProperty;
@@ -1535,7 +1536,7 @@ public class FOPropertyMapping implements Constants {
 
         // text-align-last
         m  = new EnumProperty.Maker(PR_TEXT_ALIGN_LAST) {
-            public Property compute(PropertyList propertyList) {
+            public Property compute(PropertyList propertyList) throws PropertyException {
                 Property corresponding = propertyList.get(PR_TEXT_ALIGN);
                 if (corresponding == null) {
                     return null;
index 9c3b653baf4ceb069d4f800a0fc174602a8948bf..d5b36efc02a8c22680f911be537233e9898e79a0 100644 (file)
@@ -23,6 +23,7 @@ import java.util.List;
 import java.util.NoSuchElementException;
 
 // FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.fo.flow.Block;
 import org.apache.fop.fo.pagination.Root;
@@ -132,7 +133,7 @@ public class FOText extends FONode {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonFont = pList.getFontProps();
         commonHyphenation = pList.getHyphenationProps();
         
index 4b534535f5129e1a7a8158e72284b7b4a602f2d6..5c9909f649060b211ff0ea4a60957d4883da886b 100644 (file)
@@ -196,7 +196,7 @@ public class FOTreeBuilder extends DefaultHandler {
      * @see org.xml.sax.ContentHandler#characters(char[], int, int)
      */
     public void characters(char[] data, int start, int length) 
-        throws SAXParseException {
+        throws FOPException {
             if (currentFObj != null) {
                 currentFObj.addCharacters(data, start, start + length, currentPropertyList, locator);
             }
@@ -250,7 +250,8 @@ public class FOTreeBuilder extends DefaultHandler {
                 namespaceURI.equals(ExtensionElementMapping.URI)) {
                 try {
                     currentFObj.validateChildNode(locator, namespaceURI, localName);
-                } catch (SAXParseException e) {
+                } catch (ValidationException e) {
+                    // TODO: add relaxed validation.
                     throw e;
                 }
             }
@@ -286,12 +287,8 @@ public class FOTreeBuilder extends DefaultHandler {
      * @see org.xml.sax.ContentHandler#endElement(String, String, String)
      */
     public void endElement(String uri, String localName, String rawName)
-                throws SAXParseException {
-        try {
-            currentFObj.endOfNode();
-        } catch (SAXParseException e) {
-            throw e;
-        }
+                throws FOPException {
+        currentFObj.endOfNode();
 
         if (currentPropertyList.getFObj() == currentFObj) {
             currentPropertyList = currentPropertyList.getParentPropertyList();
@@ -304,9 +301,9 @@ public class FOTreeBuilder extends DefaultHandler {
      * @param namespaceURI URI for the namespace of the element
      * @param localName name of the Element
      * @return the ElementMapping.Maker that can create an FO object for this element
-     * @throws SAXParseException if a Maker could not be found for a bound namespace.
+     * @throws FOPException if a Maker could not be found for a bound namespace.
      */
-    private Maker findFOMaker(String namespaceURI, String localName) throws SAXParseException {
+    private Maker findFOMaker(String namespaceURI, String localName) throws FOPException {
       Map table = (Map)fobjTable.get(namespaceURI);
       Maker fobjMaker = null;
       if (table != null) {
@@ -319,7 +316,7 @@ public class FOTreeBuilder extends DefaultHandler {
 
       if (fobjMaker == null) {
           if (namespaces.contains(namespaceURI.intern())) {
-                throw new SAXParseException (FONode.errorText(locator) + 
+                throw new FOPException(FONode.errorText(locator) + 
                     "No element mapping definition found for "
                     + FONode.getNodeString(namespaceURI, localName), locator);
           } else {
index 9646fc77291497fc9986a44f4002ccc40a0f75d3..87f989c02f5d3dc9b485eae447356cd97db59a76 100644 (file)
@@ -25,12 +25,11 @@ import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.flow.Marker;
 import org.apache.fop.fo.properties.PropertyMaker;
-
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
 /**
  * Base class for representation of formatting objects and their processing.
@@ -90,7 +89,7 @@ public class FObj extends FONode implements Constants {
      * @see org.apache.fop.fo.FONode#processNode
      */
     public void processNode(String elementName, Locator locator, 
-                            Attributes attlist, PropertyList pList) throws SAXParseException {
+                            Attributes attlist, PropertyList pList) throws FOPException {
         setLocator(locator);
         pList.addAttributesToList(attlist);
         pList.setWritingMode();
@@ -100,7 +99,7 @@ public class FObj extends FONode implements Constants {
     /**
      * Create a default property list for this element. 
      */
-    protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws SAXParseException {
+    protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws FOPException {
         return foEventHandler.getPropertyListMaker().make(this, parent);
     }
 
@@ -108,10 +107,10 @@ public class FObj extends FONode implements Constants {
      * Bind property values from the property list to the FO node.
      * Must be overriden in all FObj subclasses. 
      * @param pList the PropertyList where the properties can be found.
-     * @throws SAXParseException
+     * @throws FOPException
      */
-    public void bind(PropertyList pList) throws SAXParseException {
-//        throw new SAXParseException("Unconverted element " + this, locator);
+    public void bind(PropertyList pList) throws FOPException {
+//        throw new ValidationException("Unconverted element " + this, locator);
     }
 
     /**
@@ -120,13 +119,13 @@ public class FObj extends FONode implements Constants {
      * This methods checks that the id isn't already used by another
      * fo and sets the id attribute of this object.
      */
-     protected void checkId(String id) throws SAXParseException {
+     protected void checkId(String id) throws ValidationException {
         if (!id.equals("")) {
             Set idrefs = getFOEventHandler().getIDReferences();
             if (!idrefs.contains(id)) {
                 idrefs.add(id);
             } else {
-                throw new SAXParseException("Property id \"" + id + 
+                throw new ValidationException("Property id \"" + id + 
                         "\" previously used; id values must be unique" +
                         " in document.", locator);
             }
@@ -144,7 +143,7 @@ public class FObj extends FONode implements Constants {
     /**
      * @see org.apache.fop.fo.FONode#addChildNode(FONode)
      */
-    protected void addChildNode(FONode child) throws SAXParseException {
+    protected void addChildNode(FONode child) throws FOPException {
         if (PropertySets.canHaveMarkers(getNameId()) && 
             child.getNameId() == FO_MARKER) {
                 addMarker((Marker) child);
index d7eac8dd3d3b3c705221f9586c737c179ad9dca3..9cf9ccd70d6c4ba20843a5a7e7f8242c2c88ef69 100644 (file)
 package org.apache.fop.fo;
 
 import java.util.List;
+
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
+
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.layoutmgr.InlineStackingLayoutManager;
 
 /**
@@ -43,7 +45,7 @@ public class FObjMixed extends FObj {
      */
     protected void addCharacters(char data[], int start, int length,
                                  PropertyList pList,
-                                 Locator locator) throws SAXParseException {
+                                 Locator locator) throws FOPException {
         FOText ft = new FOText(data, start, length, this);
         ft.setLocator(locator);
         ft.bind(pList);
index e31c2bdc2d1f6cb14c6cf536f1547ab587395558..c453b50acba7ed1c29b0d4e47940330b74bfbb0e 100644 (file)
@@ -21,8 +21,11 @@ package org.apache.fop.fo;
 // Java
 import org.xml.sax.Attributes;
 
-// FOP
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.expr.PropertyException;
 import org.apache.fop.fo.properties.CommonAbsolutePosition;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
@@ -35,9 +38,6 @@ import org.apache.fop.fo.properties.CommonRelativePosition;
 import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.properties.PropertyMaker;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 /**
  * Class containing the collection of properties for a given FObj.
  */
@@ -94,7 +94,7 @@ abstract public class PropertyList {
      * @return The value if the property is explicitly set or set by
      * a shorthand property, otherwise null.
      */
-    public Property getExplicitOrShorthand(int propId) {
+    public Property getExplicitOrShorthand(int propId) throws PropertyException {
         /* Handle request for one part of a compound property */
         Property p = getExplicit(propId);
         if (p == null) {
@@ -124,20 +124,14 @@ abstract public class PropertyList {
      * @param propId The ID of the property whose value is desired.
      * @return The inherited value, otherwise null.
      */
-    public Property getInherited(int propId) {
+    public Property getInherited(int propId) throws PropertyException {
 
         if (isInherited(propId)) {
             return getFromParent(propId);
         } else {
             // return the "initial" value
-            try {
-                return makeProperty(propId);
-            } catch (org.apache.fop.apps.FOPException e) {
-                //log.error("Exception in getInherited(): property="
-                //                       + propertyName + " : " + e);
-            }
+            return makeProperty(propId);
         }
-        return null;    // Exception in makeProperty!
     }
 
     /**
@@ -148,7 +142,7 @@ abstract public class PropertyList {
      * @param propId The Constants ID of the property whose value is desired.
      * @return the Property corresponding to that name
      */
-    public Property get(int propId) {
+    public Property get(int propId) throws PropertyException {
         return get(propId, true, true);
     }
 
@@ -159,16 +153,11 @@ abstract public class PropertyList {
      * the default value.
      */
     public Property get(int propId, boolean bTryInherit,
-                         boolean bTryDefault) {
+                         boolean bTryDefault) throws PropertyException {
 
         PropertyMaker propertyMaker = findMaker(propId & Constants.PROPERTY_MASK);
-        try {
-            return propertyMaker.get(propId & Constants.COMPOUND_MASK, this,
+        return propertyMaker.get(propId & Constants.COMPOUND_MASK, this,
                                      bTryInherit, bTryDefault);
-        } catch (FOPException exc) {
-            fobj.getLogger().error("Error during property processing", exc);
-        }
-        return null;
     }
 
     /**
@@ -178,7 +167,7 @@ abstract public class PropertyList {
      * @return The computed value if the property is explicitly set on some
      * ancestor of the current FO, else the initial value.
      */
-    public Property getNearestSpecified(int propId) {
+    public Property getNearestSpecified(int propId) throws PropertyException {
         Property p = null;
 
         for (PropertyList plist = this; p == null && plist != null;
@@ -188,12 +177,7 @@ abstract public class PropertyList {
 
         if (p == null) {
             // If no explicit setting found, return initial (default) value.
-            try {
-                p = makeProperty(propId);
-            } catch (FOPException e) {
-                //log.error("Exception in getNearestSpecified(): property="
-                //                       + propertyName + " : " + e);
-            }
+            p = makeProperty(propId);
         }
         return p;
     }
@@ -205,18 +189,12 @@ abstract public class PropertyList {
      * @return The computed value on the parent or the initial value if this
      * FO is the root or is in a different namespace from its parent.
      */
-    public Property getFromParent(int propId) {
+    public Property getFromParent(int propId) throws PropertyException {
         if (parentPropertyList != null) {
             return parentPropertyList.get(propId);
         } else {
-            try {
-                return makeProperty(propId);
-            } catch (org.apache.fop.apps.FOPException e) {
-                //log.error("Exception in getFromParent(): property="
-                //                       + propertyName + " : " + e);
-            }
+            return makeProperty(propId);
         }
-        return null;    // Exception in makeProperty!
     }
 
     /**
@@ -224,7 +202,7 @@ abstract public class PropertyList {
      * Use that from the nearest ancestor, including self, which generates
      * reference areas, or from root FO if no ancestor found.
      */
-    protected void setWritingMode() {
+    protected void setWritingMode() throws PropertyException {
         FObj p = fobj.findNearestAncestorFObj();
         // If this is a RA or the root, use the property value.
         if (fobj.generatesReferenceAreas() || p == null) {
@@ -336,9 +314,9 @@ abstract public class PropertyList {
             if (prop != null) {
                 putExplicit(propId, prop);
             }
-        } catch (FOPException e) {
-            /**@todo log this exception */
-            // log.error(e.getMessage());
+        } catch (PropertyException e) {
+            // TODO: Add strict validation.
+            log.error(e.getMessage());
         }
     }
 
@@ -347,7 +325,7 @@ abstract public class PropertyList {
                                       int propId,
                                       String basePropName,
                                       PropertyMaker propertyMaker)
-            throws FOPException {
+            throws PropertyException {
 
         /* If the baseProperty has already been created, return it
          * e.g. <fo:leader xxxx="120pt" xxxx.maximum="200pt"... />
@@ -416,7 +394,7 @@ abstract public class PropertyList {
      * @param propId ID of property
      * @return new Property object
      */
-    private Property getShorthand(int propId) {
+    private Property getShorthand(int propId) throws PropertyException {
         PropertyMaker propertyMaker = findMaker(propId);
         
         if (propertyMaker != null) {
@@ -432,7 +410,7 @@ abstract public class PropertyList {
      * @return new Property object
      * @throws FOPException for errors in the input
      */
-    private Property makeProperty(int propId) throws FOPException {
+    private Property makeProperty(int propId) throws PropertyException {
         PropertyMaker propertyMaker = findMaker(propId);
         if (propertyMaker != null) {
             return propertyMaker.make(this);
@@ -477,7 +455,7 @@ abstract public class PropertyList {
      * Constructs a BorderAndPadding object.
      * @return a BorderAndPadding object
      */
-    public CommonBorderPaddingBackground getBorderPaddingBackgroundProps() {
+    public CommonBorderPaddingBackground getBorderPaddingBackgroundProps() throws PropertyException {
         return new CommonBorderPaddingBackground(this);
     }
     
@@ -487,7 +465,7 @@ abstract public class PropertyList {
      * Constructs a HyphenationProps objects.
      * @return a HyphenationProps object
      */
-    public CommonHyphenation getHyphenationProps() {
+    public CommonHyphenation getHyphenationProps() throws PropertyException {
         return new CommonHyphenation(this);
     }
     
@@ -495,7 +473,7 @@ abstract public class PropertyList {
      * Constructs a MarginProps objects.
      * @return a MarginProps object
      */
-    public CommonMarginBlock getMarginBlockProps() {
+    public CommonMarginBlock getMarginBlockProps() throws PropertyException {
         return new CommonMarginBlock(this);
     }
     
@@ -503,7 +481,7 @@ abstract public class PropertyList {
      * Constructs a MarginInlineProps objects.
      * @return a MarginInlineProps object
      */
-    public CommonMarginInline getMarginInlineProps() {
+    public CommonMarginInline getMarginInlineProps() throws PropertyException {
         return new CommonMarginInline(this);
     }
     
@@ -511,7 +489,7 @@ abstract public class PropertyList {
      * Constructs a AccessibilityProps objects. 
      * @return a AccessibilityProps object
      */
-    public CommonAccessibility getAccessibilityProps() {
+    public CommonAccessibility getAccessibilityProps() throws PropertyException {
         return new CommonAccessibility(this);
     }
 
@@ -519,7 +497,7 @@ abstract public class PropertyList {
      * Constructs a AuralProps objects.
      * @return a AuralProps object
      */
-    public CommonAural getAuralProps() {
+    public CommonAural getAuralProps() throws PropertyException {
         CommonAural props = new CommonAural(this);
         return props;
     }
@@ -528,7 +506,7 @@ abstract public class PropertyList {
      * Constructs a RelativePositionProps objects.
      * @return a RelativePositionProps object
      */
-    public CommonRelativePosition getRelativePositionProps() {
+    public CommonRelativePosition getRelativePositionProps() throws PropertyException {
         return new CommonRelativePosition(this);
     }
     
@@ -536,7 +514,7 @@ abstract public class PropertyList {
      * Constructs a AbsolutePositionProps objects.
      * @return a AbsolutePositionProps object
      */
-    public CommonAbsolutePosition getAbsolutePositionProps() {
+    public CommonAbsolutePosition getAbsolutePositionProps() throws PropertyException {
         return new CommonAbsolutePosition(this);
     }    
     
@@ -545,7 +523,7 @@ abstract public class PropertyList {
      * Constructs a CommonFont object. 
      * @return A CommonFont object
      */
-    public CommonFont getFontProps() {
+    public CommonFont getFontProps() throws PropertyException {
         return new CommonFont(this);
     }
 }
index d1a3b67e40c380116d272d38aa6c666587094af0..77211b7a17efb6155ff11b74f0cf7db1949312ea 100755 (executable)
@@ -15,6 +15,7 @@
  */
 package org.apache.fop.fo;
 
+import org.apache.fop.fo.expr.PropertyException;
 import org.apache.fop.fo.properties.Property;
 
 /**
@@ -59,7 +60,9 @@ public class StaticPropertyList extends PropertyList {
      * retrieved property values.
      * @param propId The property ID
      */
-    public Property get(int propId, boolean bTryInherit, boolean bTryDefault) {
+    public Property get(int propId, boolean bTryInherit, boolean bTryDefault)
+        throws PropertyException 
+    {
         Property p = values[propId];
         if (p == null) {
             p = values[propId] = super.get(propId, bTryInherit, bTryDefault);
diff --git a/src/java/org/apache/fop/fo/ValidationException.java b/src/java/org/apache/fop/fo/ValidationException.java
new file mode 100755 (executable)
index 0000000..19e176b
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.fo;
+
+import org.apache.fop.apps.FOPException;
+import org.xml.sax.Locator;
+
+/**
+ * Exception thrown during FO tree validation.
+ */
+public class ValidationException extends FOPException {
+    public ValidationException(String message) {
+        super(message);
+    }
+
+    public ValidationException(String message, Locator locator) {
+        super(message, locator);
+    }
+}
index 3ff83ee68599b40bbbc1537e57661113e3f28ed1..244f17a542f7d849f6581989b7dc0c434d7a81cf 100644 (file)
@@ -22,12 +22,13 @@ package org.apache.fop.fo;
 import java.awt.geom.Point2D;
 import java.util.HashMap;
 
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.fop.apps.FOPException;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
-import javax.xml.parsers.DocumentBuilderFactory;
 
 /**
  * Abstract class modelling generic, non-XSL-FO XML objects. Such objects are
@@ -59,7 +60,7 @@ public abstract class XMLObj extends FONode {
      * here, blocks XSL FO's from having non-FO parents.
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI) {
             invalidChildError(loc, nsURI, localName);
         }
@@ -69,7 +70,7 @@ public abstract class XMLObj extends FONode {
      * @see org.apache.fop.fo.FONode#processNode
      */
     public void processNode(String elementName, Locator locator, 
-        Attributes attlist, PropertyList propertyList) throws SAXParseException {
+        Attributes attlist, PropertyList propertyList) throws FOPException {
             setLocator(locator);
             name = elementName;
             attr = attlist;
index 347fc8f8460df308f2c3ca3713e55fe65299e33a..6f337e0f55c5043b8517eff419919ffa5adedebc 100644 (file)
@@ -104,7 +104,7 @@ public class NumericProperty extends Property implements Numeric, Length {
         if (dim == 1) {
             return this;
         }
-        System.err.print("Can't create length with dimension " + dim);
+        log.error("Can't create length with dimension " + dim);
         return null;
     }
 
index 50a8c79e7b50f8f0793b8055b372f6565a750421..9ce3224b8f4b8e52a4555e96fcacbbe558d53046 100644 (file)
 
 package org.apache.fop.fo.expr;
 
+import org.apache.fop.apps.FOPException;
+
 /**
  * Class for managing exceptions that are raised in Property processing.
  */
-public class PropertyException extends Exception {
+public class PropertyException extends FOPException {
+    private String propertyName;
 
     /**
      * Constructor
@@ -31,4 +34,24 @@ public class PropertyException extends Exception {
         super(detail);
     }
 
+    /**
+     */
+    public void setPropertyInfo(PropertyInfo propInfo) {
+        setLocator(propInfo.getFO().locator);
+        propertyName = propInfo.getPropertyMaker().getName();
+    }
+
+    /**
+     */
+    public void setPropertyName(String propertyName) {
+        this.propertyName = propertyName;
+    }
+
+    public String getMessage() {
+        if (propertyName != null) {
+            return super.getMessage() + "; property:'" + propertyName + "'";
+        } else {
+            return super.getMessage();
+        }
+    }
 }
index 100b523c6c0b5526e52bcc525ff39ca75905af54..fb59332de77ed5ac89f856481f3af5ecdf2dbf5f 100644 (file)
@@ -65,7 +65,7 @@ public class PropertyInfo {
     /**
      * @return the current font-size value as base units (milli-points).
      */
-    public int currentFontSize() {
+    public int currentFontSize() throws PropertyException {
         return plist.get(Constants.PR_FONT_SIZE).getLength().getValue();
     }
 
@@ -85,6 +85,14 @@ public class PropertyInfo {
         return plist;
     }
 
+    /**
+     * accessor for PropertyMaker
+     * @return PropertyMaker object
+     */
+    public PropertyMaker getPropertyMaker() {
+        return maker;
+    }
+    
     /**
      * push a function onto the function stack
      * @param func function to push onto stack
index 51f87f10a3cb2932fe0ec402a784bad02b9dd173..7d77d7f9bb77403a48c8efa5d1a674e0b8d97f0c 100644 (file)
@@ -85,7 +85,12 @@ public class PropertyParser extends PropertyTokenizer {
      */
     public static Property parse(String expr, PropertyInfo propInfo)
             throws PropertyException {
-        return new PropertyParser(expr, propInfo).parseProperty();
+        try {
+            return new PropertyParser(expr, propInfo).parseProperty();
+        } catch (PropertyException exc) {
+            exc.setPropertyInfo(propInfo);
+            throw exc;
+        }
     }
 
 
@@ -314,6 +319,7 @@ public class PropertyParser extends PropertyTokenizer {
             return prop;
         }
         default:
+            // TODO: add the token or the expr to the error message.
             throw new PropertyException("syntax error");
         }
         next();
index 02d7b4f9c9cba581bad15d82d21df134a3e70edf..c20017f85051919a0ed418338108f5fe397b992d 100755 (executable)
@@ -154,7 +154,7 @@ public class RelativeNumericProperty extends Property implements Numeric, Length
         if (dimension == 1) {
             return this;
         }
-        System.err.print("Can't create length with dimension " + dimension);
+        log.error("Can't create length with dimension " + dimension);
         return null;
     }
 
@@ -169,7 +169,7 @@ public class RelativeNumericProperty extends Property implements Numeric, Length
         try {
             return (int) getNumericValue();
         } catch (PropertyException exc) {
-            exc.printStackTrace();
+            log.error(exc);
         }
         return 0;
     }
index a9273fccc34892864a75c57dbcb0afdbbce2a055..7573da0c107ca1ca5ee5b10c8ef1d0ab701d7a65 100644 (file)
@@ -21,10 +21,7 @@ package org.apache.fop.fo.extensions;
 // Java
 import java.util.ArrayList;
 
-// XML
-import org.xml.sax.SAXParseException;
-
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.pagination.Root;
 
@@ -59,7 +56,7 @@ public class Bookmarks extends ExtensionObj {
      * the bookmark data from the child elements and add
      * the extension to the area tree.
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         ((Root) parent).setBookmarks(this);
     }
 
index 646b24b689f3b2b91d498bdbf0829d31f6a82b78..37aad8bcb7516201f49b039f0f55875f0c253291 100644 (file)
 
 package org.apache.fop.fo.extensions;
 
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FOEventHandler;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
 
 /**
@@ -46,7 +46,7 @@ public abstract class ExtensionObj extends FObj {
      */
     public void processNode(String elementName, Locator locator, 
                             Attributes attlist, PropertyList pList)
-        throws SAXParseException
+        throws FOPException
     {
         // Empty
     }
@@ -55,7 +55,7 @@ public abstract class ExtensionObj extends FObj {
      * Create a default property list for this element. 
      */
     protected PropertyList createPropertyList(PropertyList parent, 
-                FOEventHandler foEventHandler) throws SAXParseException {
+                FOEventHandler foEventHandler) throws FOPException {
         return null;
     }
 }
index 6d3ed01aeb7a66397cb1295bcd892ed8205d790b..a7df6327edff40372e2612c82f5294f68d53a35f 100644 (file)
 
 package org.apache.fop.fo.extensions;
 
-import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.PropertyList;
-
 import java.util.ArrayList;
 
 import org.xml.sax.Attributes;
-import org.xml.sax.SAXParseException;
 import org.xml.sax.Locator;
 
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.PropertyList;
+
 
 /**
  * The outline object for the pdf bookmark extension.
@@ -55,7 +55,7 @@ public class Outline extends ExtensionObj {
      * @see org.apache.fop.fo.FObj#processNode
      */
     public void processNode(String elementName, Locator locator, 
-            Attributes attlist, PropertyList propertyList) throws SAXParseException 
+            Attributes attlist, PropertyList propertyList) throws FOPException 
     {
         internalDestination =
             attlist.getValue("internal-destination");
index cd523da5881eb4806ee3398e98340fae2d01934e..7dfd3dd22785551d9e360359b06906248893b219 100644 (file)
@@ -19,6 +19,7 @@
 package org.apache.fop.fo.extensions.svg;
 
 // FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.PropertyList;
 
@@ -30,7 +31,6 @@ import org.w3c.dom.Element;
 import org.w3c.dom.svg.SVGDocument;
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 import org.apache.batik.bridge.UnitProcessor;
 import org.apache.batik.util.SVGConstants;
 
@@ -62,7 +62,7 @@ public class SVGElement extends SVGObj {
      * @see org.apache.fop.fo.FONode#processNode
      */
     public void processNode(String elementName, Locator locator, 
-                            Attributes attlist, PropertyList propertyList) throws SAXParseException {
+                            Attributes attlist, PropertyList propertyList) throws FOPException {
         super.processNode(elementName, locator, attlist, propertyList);
         init();
     }
index ccb94584a25bd96dbce18334311b9d4a469e8a96..1e61abc9e483376a7b6748ec232ab7ba0fdd2833 100644 (file)
@@ -21,13 +21,12 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.layoutmgr.BasicLinkLayoutManager;
 
 /**
@@ -63,7 +62,7 @@ public class BasicLink extends Inline {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) throws SAXParseException {
+    public void bind(PropertyList pList) throws FOPException {
         super.bind(pList);
         // destinationPlacementOffset = pList.get(PR_DESTINATION_PLACEMENT_OFFSET);
         // dominantBaseline = pList.get(PR_DOMINANT_BASELINE);
@@ -88,7 +87,7 @@ public class BasicLink extends Inline {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startLink(this);
     }
@@ -96,7 +95,7 @@ public class BasicLink extends Inline {
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endLink();
     }
@@ -106,7 +105,7 @@ public class BasicLink extends Inline {
      * XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI && localName.equals("marker")) {
             if (blockOrInlineItemFound) {
                nodesOutOfOrderError(loc, "fo:marker", "(#PCDATA|%inline;|%block;)");
index 3f5740a35456e50af211862c39410d356de680e4..5c156d7d41e7023799078c0679cec031b643a082 100644 (file)
@@ -22,15 +22,14 @@ package org.apache.fop.fo.flow;
 import java.util.ArrayList;
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObjMixed;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.ColorTypeProperty;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonFont;
@@ -93,7 +92,7 @@ public class BidiOverride extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAural = pList.getAuralProps();
         commonFont = pList.getFontProps();
         commonRelativePosition = pList.getRelativePositionProps();
@@ -115,7 +114,7 @@ public class BidiOverride extends FObjMixed {
      *  fo:inline-container."
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI && localName.equals("marker")) {
             if (blockOrInlineItemFound) {
                nodesOutOfOrderError(loc, "fo:marker", 
index b7c54bb7954904ec3ee318eb93edb75418c1b651..cbdbc435f63861abd0c201f2be66e117a3d56dab 100644 (file)
@@ -21,21 +21,21 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.CharIterator;
+import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOText;
 import org.apache.fop.fo.FObjMixed;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.PropertySets;
 import org.apache.fop.fo.RecursiveCharIterator;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -46,7 +46,6 @@ import org.apache.fop.fo.properties.CommonRelativePosition;
 import org.apache.fop.fo.properties.KeepProperty;
 import org.apache.fop.fo.properties.SpaceProperty;
 import org.apache.fop.layoutmgr.BlockLayoutManager;
-import org.apache.fop.fo.Constants;
 import org.apache.fop.util.CharUtilities;
 
 /*
@@ -129,7 +128,7 @@ public class Block extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) throws SAXParseException {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -170,7 +169,7 @@ public class Block extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         getFOEventHandler().startBlock(this);
     }
@@ -178,7 +177,7 @@ public class Block extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         handleWhiteSpace();
         getFOEventHandler().endBlock(this);
     }
@@ -283,7 +282,7 @@ public class Block extends FObjMixed {
      *  fo:inline-container."
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI && localName.equals("marker")) {
             if (blockOrInlineItemFound || initialPropertySetFound) {
                nodesOutOfOrderError(loc, "fo:marker", 
@@ -308,7 +307,7 @@ public class Block extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FONode#addChildNode(FONode)
      */
-    public void addChildNode(FONode child) throws SAXParseException {
+    public void addChildNode(FONode child) throws FOPException {
         // Handle whitespace based on values of properties
         // Handle a sequence of inline-producing child nodes in
         // one pass
index 3c0d1e1c2a370aa9d0fff20efb1f0da64056bdf8..9317a8ae030029b7986f57830ea33e25d39f46c8 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FONode;
@@ -34,8 +34,6 @@ import org.apache.fop.fo.properties.KeepProperty;
 import org.apache.fop.fo.properties.LengthRangeProperty;
 import org.apache.fop.layoutmgr.BlockContainerLayoutManager;
 
-import org.xml.sax.SAXParseException;
-
 /**
  * Class modelling the fo:block-container object.
  * @todo implement validateChildNode()
@@ -75,7 +73,7 @@ public class BlockContainer extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAbsolutePosition = pList.getAbsolutePositionProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
         commonMarginBlock = pList.getMarginBlockProps();
@@ -102,7 +100,7 @@ public class BlockContainer extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         getFOEventHandler().startBlockContainer(this);
     }
@@ -110,7 +108,7 @@ public class BlockContainer extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         getFOEventHandler().endBlockContainer(this);
     }
 
index 959a60036a23b2584e1494cc9d94244bfe15e5ca..fee7c3e36634aaa3d13761db75b25da1b5a5d6f0 100644 (file)
@@ -21,17 +21,17 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.CharIterator;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.OneCharIterator;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
 import org.apache.fop.fo.properties.CommonFont;
@@ -40,7 +40,6 @@ import org.apache.fop.fo.properties.CommonMarginInline;
 import org.apache.fop.fo.properties.CommonRelativePosition;
 import org.apache.fop.fo.properties.KeepProperty;
 import org.apache.fop.fo.properties.Property;
-import org.apache.fop.fo.OneCharIterator;
 import org.apache.fop.layoutmgr.CharacterLayoutManager;
 
 /**
@@ -104,7 +103,7 @@ public class Character extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
         commonFont = pList.getFontProps();
@@ -140,7 +139,7 @@ public class Character extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         getFOEventHandler().character(this);
     }
@@ -150,7 +149,7 @@ public class Character extends FObj {
      * XSL Content Model: empty
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             invalidChildError(loc, nsURI, localName);
     }
 
index 20ee6d03f00376e6b1cb49ed7883f1a5925dc383..f471c04c4fd988028b7c743eb75fb41780fce18d 100644 (file)
@@ -21,15 +21,14 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -88,7 +87,7 @@ public class ExternalGraphic extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -122,7 +121,7 @@ public class ExternalGraphic extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         getFOEventHandler().image(this);
     }
@@ -132,7 +131,7 @@ public class ExternalGraphic extends FObj {
      * XSL Content Model: empty
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             invalidChildError(loc, nsURI, localName);
     }
 
index b846260c4dce8b0c4756dc6aa8b5ca6c863ee221..f6dde0468cb90471fc6f900c15db6b16d9d9d9cd 100644 (file)
@@ -20,12 +20,12 @@ package org.apache.fop.fo.flow;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 
 /**
  * fo:float element.
@@ -53,7 +53,7 @@ public class Float extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         // float = pList.get(PR_FLOAT);
         // clear = pList.get(PR_CLEAR);
     }
@@ -63,7 +63,7 @@ public class Float extends FObj {
      * XSL Content Model: (%block;)+
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             if (!isBlockItem(nsURI, localName)) {
                 invalidChildError(loc, nsURI, localName);
             }
@@ -74,7 +74,7 @@ public class Float extends FObj {
      * FOEventHandler that we are at the end of the flow.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (childNodes == null) {
             missingChildElementError("(%block;)+");
         }
index 7c7bc1a91319b2a30d519e73ce22ed43f5cef4e3..9c40c4fbbf7b2f527703606e7eb24eec76486db1 100644 (file)
@@ -21,14 +21,13 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 
 /**
@@ -52,14 +51,14 @@ public class Footnote extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
     }
     
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         getFOEventHandler().startFootnote(this);
     }
 
@@ -68,7 +67,7 @@ public class Footnote extends FObj {
      * FOEventHandler that we are at the end of the flow.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         super.endOfNode();
         if (inlineFO == null || footnoteBody == null) {
             missingChildElementError("(inline,footnote-body)");
@@ -86,7 +85,7 @@ public class Footnote extends FObj {
      *      generates an absolutely positioned area.
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             if (nsURI == FO_URI && localName.equals("inline")) {
                 if (inlineFO != null) {
                     tooManyNodesError(loc, "fo:inline");
index 671e44d00f1f1790da73dad57dbdc5cd782c8fa8..703cc9c0217da56106eeb74c40db61ae6805b02f 100644 (file)
@@ -20,12 +20,12 @@ package org.apache.fop.fo.flow;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 
 /**
@@ -43,38 +43,38 @@ public class FootnoteBody extends FObj {
         super(parent);
     }
 
-    /**
-     * Make sure content model satisfied, if so then tell the
-     * FOEventHandler that we are at the end of the flow.
-     * @see org.apache.fop.fo.FONode#endOfNode
-     */
-    protected void endOfNode() throws SAXParseException {
-        if (childNodes == null) {
-            missingChildElementError("(%block;)+");
-        }
-        getFOEventHandler().endFootnoteBody(this);
-    }
-
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
     }
 
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         getFOEventHandler().startFootnoteBody(this);
     }
 
+    /**
+     * Make sure content model satisfied, if so then tell the
+     * FOEventHandler that we are at the end of the flow.
+     * @see org.apache.fop.fo.FONode#endOfNode
+     */
+    protected void endOfNode() throws FOPException {
+        if (childNodes == null) {
+            missingChildElementError("(%block;)+");
+        }
+        getFOEventHandler().endFootnoteBody(this);
+    }
+
     /**
      * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
      * XSL Content Model: (%block;)+
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             if (!isBlockItem(nsURI, localName)) {
                 invalidChildError(loc, nsURI, localName);
             }
index 27c83b368b6b29b930b789968d58c9662b560804..dd1f2a38f09d13aa205ad0f8ed3d29c861bec124 100644 (file)
@@ -20,11 +20,13 @@ package org.apache.fop.fo.flow;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.ColorTypeProperty;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
@@ -32,8 +34,6 @@ import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
 import org.apache.fop.fo.properties.CommonFont;
 import org.apache.fop.fo.properties.CommonRelativePosition;
 import org.apache.fop.fo.properties.SpaceProperty;
-import org.apache.fop.fo.FONode;
-import org.apache.fop.fo.FObj;
 
 /**
  * Class modelling the fo:initial-property-set object.
@@ -66,7 +66,7 @@ public class InitialPropertySet extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -86,7 +86,7 @@ public class InitialPropertySet extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
     }
 
@@ -95,7 +95,7 @@ public class InitialPropertySet extends FObj {
      * XSL Content Model: empty
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             invalidChildError(loc, nsURI, localName);
     }
 
index acbdaccd93c9d4a660ccf12602d62a250b5a8266..75b96b2352aa6cc1e8454471ea3aa7bc175b1bb9 100644 (file)
@@ -20,11 +20,9 @@ package org.apache.fop.fo.flow;
 
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.CharIterator;
@@ -32,6 +30,7 @@ import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObjMixed;
 import org.apache.fop.fo.InlineCharIterator;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -86,7 +85,7 @@ public class Inline extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) throws SAXParseException {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -115,7 +114,7 @@ public class Inline extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
        /* Check to see if this node can have block-level children.
         * See validateChildNode() below.
         */
@@ -141,7 +140,7 @@ public class Inline extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         getFOEventHandler().endInline(this);
     }
 
@@ -153,7 +152,7 @@ public class Inline extends FObjMixed {
      *  nearer ancestor that is an fo:inline-container." (paraphrased)
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI && localName.equals("marker")) {
             if (blockOrInlineItemFound) {
                nodesOutOfOrderError(loc, "fo:marker", 
index 7fae66003d36d4c571b243ff91ad500179d21530..fb1f8dd8f0508c3f0d1a07d981901b98f19d0843 100644 (file)
 package org.apache.fop.fo.flow;
 
 // Java
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
 
-// XML
-import org.xml.sax.SAXParseException;
-
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.Numeric;
-import org.apache.fop.layoutmgr.LayoutManager;
-import org.apache.fop.layoutmgr.ICLayoutManager;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
@@ -38,6 +33,8 @@ import org.apache.fop.fo.properties.CommonMarginInline;
 import org.apache.fop.fo.properties.CommonRelativePosition;
 import org.apache.fop.fo.properties.KeepProperty;
 import org.apache.fop.fo.properties.LengthRangeProperty;
+import org.apache.fop.layoutmgr.ICLayoutManager;
+import org.apache.fop.layoutmgr.LayoutManager;
 
 /**
  * Class modelling the fo:inline-container object.
@@ -78,7 +75,7 @@ public class InlineContainer extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
         commonMarginInline = pList.getMarginInlineProps();
         commonRelativePosition = pList.getRelativePositionProps();
@@ -105,7 +102,7 @@ public class InlineContainer extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
     }
 
index f33ea4087b50d7c5fe4866e07b2946710eed718a..46950149fda5e4e0b7ca668ad9f5fc464822d6c3 100644 (file)
@@ -21,15 +21,14 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
-import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -87,7 +86,7 @@ public class InstreamForeignObject extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -120,7 +119,7 @@ public class InstreamForeignObject extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#start
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
     }
 
@@ -129,7 +128,7 @@ public class InstreamForeignObject extends FObj {
      * FOEventHandler that we are at the end of the flow.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (childNodes.size() != 1) {
             missingChildElementError("one (1) non-XSL namespace child");
         }
@@ -140,7 +139,7 @@ public class InstreamForeignObject extends FObj {
      * XSL Content Model: one (1) non-XSL namespace child
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI) {
             invalidChildError(loc, nsURI, localName);
         } else if (childNodes != null) {
index 0480f426e77aead1cb8f2f2a4b5326d30a578f36..9cbdda05c676027ee6738c6101ea840734ccac21 100644 (file)
@@ -21,10 +21,7 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
-import org.xml.sax.SAXParseException;
-
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
@@ -88,7 +85,7 @@ public class Leader extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -136,7 +133,7 @@ public class Leader extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
     }
  
index 75c86be63a3dc7a9a62e641409a992376d70e6d0..fbec18edd00ed93d72d353db59494f614dc4e3f8 100644 (file)
@@ -21,15 +21,14 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -72,7 +71,7 @@ public class ListBlock extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -92,7 +91,7 @@ public class ListBlock extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         getFOEventHandler().startList(this);
     }
@@ -102,7 +101,7 @@ public class ListBlock extends FObj {
      * FOEventHandler that we are at the end of the flow.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (!hasListItem) {
             missingChildElementError("marker* (list-item)+");
         }
@@ -114,7 +113,7 @@ public class ListBlock extends FObj {
      * XSL Content Model: marker* (list-item)+
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI && localName.equals("marker")) {
             if (hasListItem) {
                 nodesOutOfOrderError(loc, "fo:marker", "fo:list-item");
index 6297a619fa7c9b7dc49f3ff4a481bc856419fd73..437df48039abd8288872548938ca66515f940240 100644 (file)
@@ -21,14 +21,13 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -70,7 +69,7 @@ public class ListItem extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -89,7 +88,7 @@ public class ListItem extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         getFOEventHandler().startListItem(this);
     }
@@ -99,7 +98,7 @@ public class ListItem extends FObj {
      * FOEventHandler that we are at the end of the flow.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (label == null || body == null) {
             missingChildElementError("marker* (list-item-label,list-item-body)");
         }
@@ -111,7 +110,7 @@ public class ListItem extends FObj {
      * XSL Content Model: marker* (list-item-label,list-item-body)
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI && localName.equals("marker")) {
             if (label != null) {
                 nodesOutOfOrderError(loc, "fo:marker", "fo:list-item-label");
index 1f79c758448c416a8d181b4a78668cb7f432717b..883f52a21e3f5f5d8ba63e10d3ed4f0859b75afb 100644 (file)
 
 package org.apache.fop.fo.flow;
 
-// XML
-import org.xml.sax.SAXParseException;
-
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
@@ -49,7 +46,7 @@ public class ListItemBody extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         id = pList.get(PR_ID).getString();
         keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep();
@@ -58,7 +55,7 @@ public class ListItemBody extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         getFOEventHandler().startListBody();
     }
@@ -66,7 +63,7 @@ public class ListItemBody extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         getFOEventHandler().endListBody();
     }
 
index 3f02ca7f2ce77a3ffb132cdc2dca7a5f11f51109..e6413e2a30434f541ad654941f7f7a870f3ca4b2 100644 (file)
 
 package org.apache.fop.fo.flow;
 
-// XML
-import org.xml.sax.SAXParseException;
-
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
@@ -49,7 +46,7 @@ public class ListItemLabel extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         id = pList.get(PR_ID).getString();
         keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep();
@@ -58,7 +55,7 @@ public class ListItemLabel extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         getFOEventHandler().startListLabel();
     }
@@ -66,7 +63,7 @@ public class ListItemLabel extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         getFOEventHandler().endListLabel();
     }
 
index 9de83093f3c3f6f050c9d503ff2cc697e1f95a70..cb008d8894933b7de362f39af1c289ba9d4e59f9 100644 (file)
@@ -21,18 +21,17 @@ package org.apache.fop.fo.flow;
 import java.util.HashMap;
 import java.util.Iterator;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.FOEventHandler;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.FObjMixed;
-import org.apache.fop.fo.FOEventHandler;
-import org.apache.fop.fo.properties.Property;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.PropertyListMaker;
+import org.apache.fop.fo.ValidationException;
+import org.apache.fop.fo.properties.Property;
 
 /**
  * Marker formatting object.
@@ -57,7 +56,7 @@ public class Marker extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) throws SAXParseException {
+    public void bind(PropertyList pList) throws FOPException {
         markerClassName = pList.get(PR_MARKER_CLASS_NAME).getString();
     }
     
@@ -66,7 +65,7 @@ public class Marker extends FObjMixed {
      * parentPropertyList which comes from the fo:retrieve-marker element.
      * @param parentPropertyList The property list from fo:retrieve-marker.
      */
-    public void rebind(PropertyList parentPropertyList) throws SAXParseException {
+    public void rebind(PropertyList parentPropertyList) throws FOPException {
         // Set a new parent property list and bind all the children again.
         propertyList.setParentPropertyList(parentPropertyList);
         for (Iterator i = children.keySet().iterator(); i.hasNext(); ) {
@@ -76,7 +75,7 @@ public class Marker extends FObjMixed {
         }
     }
 
-    protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws SAXParseException {
+    protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws FOPException {
         propertyList = new MarkerPropertyList(this, parent);
         return propertyList;
     }
@@ -94,7 +93,7 @@ public class Marker extends FObjMixed {
         });
     }
 
-    protected void addChildNode(FONode child) throws SAXParseException {
+    protected void addChildNode(FONode child) throws FOPException {
         if (!children.containsKey(child)) {
             children.put(child, propertyList);
         }
@@ -116,7 +115,7 @@ public class Marker extends FObjMixed {
      * @todo implement "additional" constraint, possibly within fo:retrieve-marker
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (!isBlockOrInlineItem(nsURI, localName)) {
             invalidChildError(loc, nsURI, localName);
         }
index 5ad05fd0af21329e8a4acd937f9497db2c4a60ac..c1b09d780c3d18e44546fbe6434d1722254c807e 100644 (file)
 
 package org.apache.fop.fo.flow;
 
-// XML
-import org.xml.sax.SAXParseException;
-
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
@@ -57,7 +54,7 @@ public class MultiCase extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         id = pList.get(PR_ID).getString();
         // startingState = pList.get(PR_STARTING_STATE);
@@ -68,7 +65,7 @@ public class MultiCase extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
     }
 
index 9400df4210607eaf8c3aa58685790dd9727b3def..dff9da798b511854cf8411dea0a2c315f46adb22 100644 (file)
@@ -20,12 +20,12 @@ package org.apache.fop.fo.flow;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 
 /**
@@ -58,7 +58,7 @@ public class MultiProperties extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         id = pList.get(PR_ID).getString();
     }
@@ -66,7 +66,7 @@ public class MultiProperties extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
     }
 
@@ -75,7 +75,7 @@ public class MultiProperties extends FObj {
      * FOEventHandler that we are at the end of the flow.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (!hasMultiPropertySet || !hasWrapper) {
             missingChildElementError("(multi-property-set+, wrapper)");
         }
@@ -86,7 +86,7 @@ public class MultiProperties extends FObj {
      * XSL Content Model: (multi-property-set+, wrapper)
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             if (nsURI == FO_URI && localName.equals("multi-property-set")) {
                 if (hasWrapper) {
                     nodesOutOfOrderError(loc, "fo:multi-property-set", "fo:wrapper");
index f476d187da621a2b9f40786a850f57dbc1327a4d..f332f850a5aa9175a677c8c4ef2ffa6cc7272fd7 100644 (file)
@@ -20,12 +20,12 @@ package org.apache.fop.fo.flow;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 
 /**
  * Class modelling the fo:multi-property-set object.
@@ -53,7 +53,7 @@ public class MultiPropertySet extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         id = pList.get(PR_ID).getString();
         // activeState = pList.get(PR_ACTIVE_STATE);
     }
@@ -61,7 +61,7 @@ public class MultiPropertySet extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
     }
 
@@ -70,7 +70,7 @@ public class MultiPropertySet extends FObj {
      * XSL Content Model: empty
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             invalidChildError(loc, nsURI, localName);
     }
 
index f0a72a0ad2d279267496dec4a396bf3827fd9cee..1384be281d5177b71450b8430b3867869b07efa7 100644 (file)
@@ -20,12 +20,12 @@ package org.apache.fop.fo.flow;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 
 /**
@@ -56,7 +56,7 @@ public class MultiSwitch extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         // autoRestore = pList.get(PR_AUTO_RESTORE);
         id = pList.get(PR_ID).getString();
@@ -65,7 +65,7 @@ public class MultiSwitch extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
     }
 
@@ -73,7 +73,7 @@ public class MultiSwitch extends FObj {
      * Make sure content model satisfied.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (childNodes == null) {
             missingChildElementError("(multi-case+)");
         }
@@ -84,7 +84,7 @@ public class MultiSwitch extends FObj {
      * XSL Content Model: (multi-case+)
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (!(nsURI == FO_URI && localName.equals("multi-case"))) {
             invalidChildError(loc, nsURI, localName);
         }
index d4bc2362856cc30c320912d84b44510af09ca15d..7c0111cdec7c4b4155b866a542df474f0d9a8c7f 100644 (file)
@@ -19,6 +19,7 @@
 package org.apache.fop.fo.flow;
 
 // FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
@@ -51,7 +52,7 @@ public class MultiToggle extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         // prSwitchTo = pList.get(PR_SWITCH_TO);
 
index 9e81694b91fe0fbc8500d6cd64a3b2cd7d5e8ff6..6d245fa2a4e3a9d34b7e9a32ccb0a6dc133b1aa7 100644 (file)
@@ -21,15 +21,14 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -81,7 +80,7 @@ public class PageNumber extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -111,7 +110,7 @@ public class PageNumber extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         getFOEventHandler().startPageNumber(this);
     }
@@ -119,7 +118,7 @@ public class PageNumber extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         getFOEventHandler().endPageNumber(this);
     }
 
@@ -128,7 +127,7 @@ public class PageNumber extends FObj {
      * XSL Content Model: empty
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             invalidChildError(loc, nsURI, localName);
     }
 
index 9d62c96db8738c3b92609fb97bfbab86f553f28a..1e12f5106256f4ad32385e24bc9cf2de2d75b79f 100644 (file)
@@ -21,15 +21,14 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -85,7 +84,7 @@ public class PageNumberCitation extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -116,7 +115,7 @@ public class PageNumberCitation extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         if (refId.equals("")) {
             missingPropertyError("ref-id");
@@ -128,7 +127,7 @@ public class PageNumberCitation extends FObj {
      * XSL Content Model: empty
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             invalidChildError(loc, nsURI, localName);
     }
 
index 7d8a4fd021f57d487c3aa1d60a6b80006504d783..400ee3af785eaeb2ace58873d1c134b2196cf607 100644 (file)
@@ -21,16 +21,15 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.FOEventHandler;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObjMixed;
-import org.apache.fop.fo.FOEventHandler;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.StaticPropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.layoutmgr.RetrieveMarkerLayoutManager;
 
 
@@ -60,7 +59,7 @@ public class RetrieveMarker extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         retrieveClassName = pList.get(PR_RETRIEVE_CLASS_NAME).getString();
         retrievePosition = pList.get(PR_RETRIEVE_POSITION).getEnum();
         retrieveBoundary = pList.get(PR_RETRIEVE_BOUNDARY).getEnum();
@@ -71,12 +70,12 @@ public class RetrieveMarker extends FObjMixed {
      * XSL Content Model: empty
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             invalidChildError(loc, nsURI, localName);
     }
 
     protected PropertyList createPropertyList(PropertyList parent, 
-            FOEventHandler foEventHandler) throws SAXParseException {
+            FOEventHandler foEventHandler) throws FOPException {
         // TODO: A special RetrieveMarkerPropertyList would be more memory
         // efficient. Storing a StaticPropertyList like this will keep all
         // the parent PropertyLists alive.
index 9ebd94d5f491fd86eb5c8075ab72dc3191bf298b..7e374dbd5d9aeb2f29918604afe2771665d49d01 100644 (file)
 package org.apache.fop.fo.flow;
 
 // Java
+import java.util.ArrayList;
 import java.util.List;
 import java.util.ListIterator;
-import java.util.ArrayList;
-
-// XML
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
@@ -39,9 +36,9 @@ import org.apache.fop.fo.properties.CommonRelativePosition;
 import org.apache.fop.fo.properties.KeepProperty;
 import org.apache.fop.fo.properties.LengthPairProperty;
 import org.apache.fop.fo.properties.LengthRangeProperty;
-import org.apache.fop.layoutmgr.table.TableLayoutManager;
 import org.apache.fop.layoutmgr.table.Body;
 import org.apache.fop.layoutmgr.table.Column;
+import org.apache.fop.layoutmgr.table.TableLayoutManager;
 
 /**
  * Class modelling the fo:table object.
@@ -93,7 +90,7 @@ public class Table extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -125,7 +122,7 @@ public class Table extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         getFOEventHandler().startTable(this);
     }
@@ -133,14 +130,14 @@ public class Table extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         getFOEventHandler().endTable(this);
     }
 
     /**
      * @see org.apache.fop.fo.FONode#addChildNode(FONode)
      */
-    protected void addChildNode(FONode child) throws SAXParseException {
+    protected void addChildNode(FONode child) throws FOPException {
         if (child.getName().equals("fo:table-column")) {
             if (columns == null) {
                 columns = new ArrayList();
index beadf627957d22927e6d2fbdd9511b350fd053ff..efb91cfed5e0806fe522e094031d51b1b218e468 100644 (file)
@@ -20,12 +20,12 @@ package org.apache.fop.fo.flow;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -76,7 +76,7 @@ public class TableAndCaption extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -96,7 +96,7 @@ public class TableAndCaption extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
     }
 
@@ -105,7 +105,7 @@ public class TableAndCaption extends FObj {
      * FOEventHandler that we are at the end of the flow.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (!tableFound) {
             missingChildElementError("marker* table-caption? table");
         }
@@ -116,7 +116,7 @@ public class TableAndCaption extends FObj {
      * XSL Content Model: marker* table-caption? table
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
 
         if (nsURI == FO_URI && localName.equals("marker")) {
             if (tableCaptionFound) {
index e3ed61007aa1788317e0b94588b701b71d8d9e26..bb864501c2f8516b4ab0e98a33ea4b591bb7c0b3 100644 (file)
@@ -21,10 +21,7 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
-import org.xml.sax.SAXParseException;
-
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
@@ -61,7 +58,7 @@ public class TableBody extends FObj {
     /**
      * @see FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -76,14 +73,14 @@ public class TableBody extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         getFOEventHandler().startBody(this);
     }
 
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         getFOEventHandler().endBody(this);
     }
 
index f73a8d9368c12e6c5a5dea9d25d95d2bd77ba50e..051f48f32be120241eb3ef64139cfbf59bf89bc5 100644 (file)
@@ -20,13 +20,13 @@ package org.apache.fop.fo.flow;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -74,7 +74,7 @@ public class TableCaption extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -91,7 +91,7 @@ public class TableCaption extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
     }
 
@@ -100,7 +100,7 @@ public class TableCaption extends FObj {
      * FOEventHandler that we are at the end of the flow.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (childNodes == null) {
             missingChildElementError("marker* (%block;)");
         }
@@ -111,7 +111,7 @@ public class TableCaption extends FObj {
      * XSL Content Model: marker* (%block;)
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI && localName.equals("marker")) {
             if (blockItemFound) {
                nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
index 2c86fc948f0a6ed4a8febb56fe609e221565cd3d..3d2dff26ae7b3d527a4b07b4e97d90b935ec0003 100644 (file)
@@ -21,16 +21,15 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -118,7 +117,7 @@ public class TableCell extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -147,7 +146,7 @@ public class TableCell extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         getFOEventHandler().startCell(this);
     }
@@ -157,7 +156,7 @@ public class TableCell extends FObj {
      * FOEventHandler that we are at the end of the flow.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (!blockItemFound) {
             missingChildElementError("marker* (%block;)+");
         }
@@ -169,7 +168,7 @@ public class TableCell extends FObj {
      * XSL Content Model: marker* (%block;)+
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI && localName.equals("marker")) {
             if (blockItemFound) {
                nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
index 522225f4321d87f1e161f50c7c6a131a52d7cf95..1c37f6e96bdbee0f101b774811673c437f7eeeb7 100644 (file)
@@ -20,14 +20,14 @@ package org.apache.fop.fo.flow;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
 
 /**
@@ -57,7 +57,7 @@ public class TableColumn extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
         // borderAfterPrecedence = pList.get(PR_BORDER_AFTER_PRECEDENCE);
         // borderBeforePrecedence = pList.get(PR_BORDER_BEFORE_PRECEDENCE);
@@ -73,14 +73,14 @@ public class TableColumn extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode()
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         getFOEventHandler().startColumn(this);
     }
 
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         getFOEventHandler().endColumn(this);
     }
 
@@ -89,7 +89,7 @@ public class TableColumn extends FObj {
      * XSL Content Model: empty
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             invalidChildError(loc, nsURI, localName);
     }
 
index 74a317155605c437635943c46e70147f4575dd1b..daa51166c4b268ffcb9fdd07d5728d272ded78de 100644 (file)
@@ -21,15 +21,14 @@ package org.apache.fop.fo.flow;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -74,7 +73,7 @@ public class TableRow extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange();
         commonAural = pList.getAuralProps();
@@ -97,7 +96,7 @@ public class TableRow extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
         getFOEventHandler().startRow(this);
     }
@@ -105,7 +104,7 @@ public class TableRow extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (childNodes == null) {
             missingChildElementError("(table-cell+)");
         }
@@ -117,7 +116,7 @@ public class TableRow extends FObj {
      * XSL Content Model: (table-cell+)
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (!(nsURI == FO_URI && localName.equals("table-cell"))) {
             invalidChildError(loc, nsURI, localName);
         }
index 27cf815be4b23db4dd981391255a1d71bdcfe55f..5a6008ef669354fb061b991c1896e53cb13839e5 100644 (file)
@@ -22,10 +22,7 @@ package org.apache.fop.fo.flow;
 import java.util.List;
 import java.util.ListIterator;
 
-// XML
-import org.xml.sax.SAXParseException;
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObjMixed;
 import org.apache.fop.fo.PropertyList;
@@ -54,14 +51,14 @@ public class Wrapper extends FObjMixed {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         id = pList.get(PR_ID).getString();
     }
 
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         checkId(id);
     }
 
index fc62907ba5f2ebdd8252c0ec4c5cc925fefb8b11..8ed04cee65ad3346078886b3b2764656db910b26 100644 (file)
 package org.apache.fop.fo.pagination;
 
 // Java
-import java.awt.color.ICC_Profile;
 import java.awt.color.ICC_ColorSpace;
-import java.net.URL;
+import java.awt.color.ICC_Profile;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.URL;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 
 /**
  * The fo:color-profile formatting object.
@@ -58,7 +57,7 @@ public class ColorProfile extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         src = pList.get(PR_SRC).getString();
         colorProfileName = pList.get(PR_COLOR_PROFILE_NAME).getString();
         renderingIntent = pList.get(PR_RENDERING_INTENT).getEnum();
@@ -69,7 +68,7 @@ public class ColorProfile extends FObj {
         XSL 1.0/FOP: EMPTY (no child nodes permitted)
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         invalidChildError(loc, nsURI, localName);
     }
 
index 8d9b4d0e87c5ad0792d83d4510378c602504ca99..a269fb6ed39e085a0dfc3999078b515aceb81fdb 100644 (file)
@@ -20,12 +20,12 @@ package org.apache.fop.fo.pagination;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 
 /**
  * A conditional-page-master-reference formatting object.
@@ -55,7 +55,7 @@ public class ConditionalPageMasterReference extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         masterReference = pList.get(PR_MASTER_REFERENCE).getString();
         pagePosition = pList.get(PR_PAGE_POSITION).getEnum();
         oddOrEven = pList.get(PR_ODD_OR_EVEN).getEnum();
@@ -65,7 +65,7 @@ public class ConditionalPageMasterReference extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         validateParent(parent);
     }
 
@@ -74,7 +74,7 @@ public class ConditionalPageMasterReference extends FObj {
      * XSL Content Model: empty
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
        invalidChildError(loc, nsURI, localName);
     }
 
@@ -137,9 +137,9 @@ public class ConditionalPageMasterReference extends FObj {
      * Check that the parent is the right type of formatting object
      * repeatable-page-master-alternatives.
      * @param parent parent node
-     * @throws SAXParseException If the parent is invalid
+     * @throws ValidationException If the parent is invalid
      */
-    protected void validateParent(FONode parent) throws SAXParseException {
+    protected void validateParent(FONode parent) throws ValidationException {
         if (parent.getName().equals("fo:repeatable-page-master-alternatives")) {
             this.repeatablePageMasterAlternatives =
                 (RepeatablePageMasterAlternatives)parent;
@@ -151,7 +151,7 @@ public class ConditionalPageMasterReference extends FObj {
                 this.repeatablePageMasterAlternatives.addConditionalPageMasterReference(this);
             }
         } else {
-            throw new SAXParseException("fo:conditional-page-master-reference must be child "
+            throw new ValidationException("fo:conditional-page-master-reference must be child "
                                    + "of fo:repeatable-page-master-alternatives, not "
                                    + parent.getName(), locator);
         }
index 2556270bb1bb20bb9f7ddffd2a37570da3d1befd..b66ea253a943348ea8d02a1f520c9e9fbcf594ed 100644 (file)
 package org.apache.fop.fo.pagination;
 
 // Java
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Iterator;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.XMLObj;
 
 
@@ -57,7 +56,7 @@ public class Declarations extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         // No properties defined for fo:declarations
     }
 
@@ -67,7 +66,7 @@ public class Declarations extends FObj {
         FOP/XSL 1.1: (color-profile)* (and non-XSL NS nodes)
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI) {
             if (!localName.equals("color-profile")) {   
                 invalidChildError(loc, nsURI, localName);
@@ -79,7 +78,7 @@ public class Declarations extends FObj {
      * At the end of this element sort out the child into
      * a hashmap of color profiles and a list of external xml.
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (childNodes != null) {
             for (Iterator iter = childNodes.iterator(); iter.hasNext();) {
                 FONode node = (FONode)iter.next();
index 33f42ca90befa33d9b64a4d5d269505c81b774b2..4b3dc610d71c7c77223e4be78b8470da9f32bc18 100644 (file)
@@ -22,14 +22,13 @@ package org.apache.fop.fo.pagination;
 import java.util.ArrayList;
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.layoutmgr.FlowLayoutManager;
 
 /**
@@ -59,16 +58,16 @@ public class Flow extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         flowName = pList.get(PR_FLOW_NAME).getString();
     }
     
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         if (!parent.getName().equals("fo:page-sequence")) {
-            throw new SAXParseException("flow must be child of "
+            throw new ValidationException("flow must be child of "
                                  + "page-sequence, not " + parent.getName(), locator);
         }
 
@@ -101,7 +100,7 @@ public class Flow extends FObj {
      * FOEventHandler that we are at the end of the flow.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (!blockItemFound) {
             missingChildElementError("marker* (%block;)+");
         }
@@ -113,7 +112,7 @@ public class Flow extends FObj {
      * XSL Content Model: marker* (%block;)+
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI && localName.equals("marker")) {
             if (blockItemFound) {
                nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
index d765b943d3afd49bdaa2417b7a29c7399096d502..eb571b7d553cf4442a293135fa0921dab63c32b0 100644 (file)
@@ -22,14 +22,13 @@ package org.apache.fop.fo.pagination;
 import java.util.Iterator;
 import java.util.Map;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 
 /**
  * The layout-master-set formatting object.
@@ -55,19 +54,19 @@ public class LayoutMasterSet extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         // No properties in layout-master-set.
     }
 
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         if (parent.getName().equals("fo:root")) {
             Root root = (Root)parent;
             root.setLayoutMasterSet(this);
         } else {
-            throw new SAXParseException("fo:layout-master-set must be child of fo:root, not "
+            throw new ValidationException("fo:layout-master-set must be child of fo:root, not "
                                    + parent.getName(), locator);
         }
         simplePageMasters = new java.util.HashMap();
@@ -77,7 +76,7 @@ public class LayoutMasterSet extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (childNodes == null) {
             missingChildElementError("(simple-page-master|page-sequence-master)+");
         }
@@ -89,7 +88,7 @@ public class LayoutMasterSet extends FObj {
         XSL/FOP: (simple-page-master|page-sequence-master)+
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI) {
             if (!localName.equals("simple-page-master") 
                 && !localName.equals("page-sequence-master")) {   
@@ -103,9 +102,9 @@ public class LayoutMasterSet extends FObj {
     /**
      * Section 7.25.7: check to see that if a region-name is a
      * duplicate, that it maps to the same fo region-class.
-     * @throws SAXParseException if there's a name duplication
+     * @throws ValidationException if there's a name duplication
      */
-    private void checkRegionNames() throws SAXParseException {
+    private void checkRegionNames() throws ValidationException {
         // (user-entered) region-name to default region map.
         Map allRegions = new java.util.HashMap();
         for (Iterator spm = simplePageMasters.values().iterator();
@@ -120,7 +119,7 @@ public class LayoutMasterSet extends FObj {
                     String defaultRegionName =
                         (String) allRegions.get(region.getRegionName());
                     if (!defaultRegionName.equals(region.getDefaultRegionName())) {
-                        throw new SAXParseException("Region-name ("
+                        throw new ValidationException("Region-name ("
                                                + region.getRegionName()
                                                + ") is being mapped to multiple "
                                                + "region-classes ("
@@ -139,15 +138,15 @@ public class LayoutMasterSet extends FObj {
      * Add a simple page master.
      * The name is checked to throw an error if already added.
      * @param sPM simple-page-master to add
-     * @throws SAXParseException if there's a problem with name uniqueness
+     * @throws ValidationException if there's a problem with name uniqueness
      */
     protected void addSimplePageMaster(SimplePageMaster sPM)
-                throws SAXParseException {
+                throws ValidationException {
 
         // check for duplication of master-name
         String masterName = sPM.getMasterName();
         if (existsName(masterName)) {
-            throw new SAXParseException("'master-name' ("
+            throw new ValidationException("'master-name' ("
                + masterName
                + ") must be unique "
                + "across page-masters and page-sequence-masters", sPM.locator);
@@ -180,14 +179,14 @@ public class LayoutMasterSet extends FObj {
      * The name is checked to throw an error if already added.
      * @param masterName name for the master
      * @param pSM PageSequenceMaster instance
-     * @throws SAXParseException if there's a problem with name uniqueness
+     * @throws ValidationException if there's a problem with name uniqueness
      */
     protected void addPageSequenceMaster(String masterName,
                                         PageSequenceMaster pSM)
-                throws SAXParseException {
+                throws ValidationException {
         // check against duplication of master-name
         if (existsName(masterName)) {
-            throw new SAXParseException("'master-name' ("
+            throw new ValidationException("'master-name' ("
                + masterName
                + ") must be unique "
                + "across page-masters and page-sequence-masters", pSM.locator);
index 8478cfcffbb24c389dcdc241d1912d2662d49e22..6cf1813731bbd28e8fc3cf0791c91b2f448b251a 100644 (file)
@@ -21,14 +21,13 @@ package org.apache.fop.fo.pagination;
 // Java
 import java.util.HashMap;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.Property;
 
 /**
@@ -135,7 +134,7 @@ public class PageSequence extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         country = pList.get(PR_COUNTRY).getString();
         format = pList.get(PR_FORMAT).getString();
         language = pList.get(PR_LANGUAGE).getString();
@@ -151,7 +150,7 @@ public class PageSequence extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode()
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         this.root = (Root) parent;
         layoutMasterSet = root.getLayoutMasterSet();
         flowMap = new HashMap();
@@ -174,7 +173,7 @@ public class PageSequence extends FObj {
             this.pageSequenceMaster =
                     this.layoutMasterSet.getPageSequenceMaster(masterReference);
             if (this.pageSequenceMaster == null) {
-                throw new SAXParseException("master-reference '" + masterReference
+                throw new ValidationException("master-reference '" + masterReference
                                        + "' for fo:page-sequence matches no"
                                        + " simple-page-master or page-sequence-master", locator);
             }
@@ -195,7 +194,7 @@ public class PageSequence extends FObj {
      * This passes the end page sequence to the structure handler
      * so it can act upon that.
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (mainFlow == null) {
            missingChildElementError("(title?,static-content*,flow)");
         }
@@ -208,7 +207,7 @@ public class PageSequence extends FObj {
         XSL Content Model: (title?,static-content*,flow)
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI) {
             if (localName.equals("title")) {
                 if (titleFO != null) {
@@ -239,7 +238,7 @@ public class PageSequence extends FObj {
      * @todo see if addChildNode() should also be called for fo's other than
      *  fo:flow.
      */
-    public void addChildNode(FONode child) throws SAXParseException {
+    public void addChildNode(FONode child) throws FOPException {
         int childId = child.getNameId();
 
         if (childId == FO_TITLE) {
@@ -263,11 +262,11 @@ public class PageSequence extends FObj {
      * based on the region-names given to the regions in the page-master
      * used to generate that page.
      */
-     private void addFlow(Flow flow) throws SAXParseException {
+     private void addFlow(Flow flow) throws ValidationException {
         String flowName = flow.getFlowName();
 
         if (hasFlowName(flowName)) {
-            throw new SAXParseException ("duplicate flow-name \""
+            throw new ValidationException("duplicate flow-name \""
                 + flowName
                 + "\" found within fo:page-sequence", flow.locator);
         }
@@ -275,7 +274,7 @@ public class PageSequence extends FObj {
         if (!layoutMasterSet.regionNameExists(flowName) 
             && !flowName.equals("xsl-before-float-separator") 
             && !flowName.equals("xsl-footnote-separator")) {
-                throw new SAXParseException ("flow-name \""
+                throw new ValidationException("flow-name \""
                     + flowName
                     + "\" could not be mapped to a region-name in the"
                     + " layout-master-set", flow.locator);
index a6713ad2fce7bc8c764bb229f78a4700eb13509c..bda91aa1d8e45ef2c4f090b5425fb4c1dd5f8371 100644 (file)
@@ -21,15 +21,13 @@ package org.apache.fop.fo.pagination;
 // Java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
-import org.apache.fop.fo.FObj;
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
-import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.ValidationException;
 
 /**
  * The page-sequence-master formatting object.
@@ -63,14 +61,14 @@ public class PageSequenceMaster extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         masterName = pList.get(PR_MASTER_NAME).getString();
     }
 
     /**
      * @see org.apache.fop.fo.FONode#startOfNode()
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         subSequenceSpecifiers = new java.util.ArrayList();
         if (parent.getName().equals("fo:layout-master-set")) {
             this.layoutMasterSet = (LayoutMasterSet)parent;
@@ -81,7 +79,7 @@ public class PageSequenceMaster extends FObj {
                 this.layoutMasterSet.addPageSequenceMaster(masterName, this);
             }
         } else {
-            throw new SAXParseException("fo:page-sequence-master must be child "
+            throw new ValidationException("fo:page-sequence-master must be child "
                                    + "of fo:layout-master-set, not "
                                    + parent.getName(), locator);
         }
@@ -90,7 +88,7 @@ public class PageSequenceMaster extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#endOfNode()
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (childNodes == null) {
            missingChildElementError("(single-page-master-reference|" +
             "repeatable-page-master-reference|repeatable-page-master-alternatives)+");
@@ -103,7 +101,7 @@ public class PageSequenceMaster extends FObj {
      *     repeatable-page-master-alternatives)+
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI) {
             if (!localName.equals("single-page-master-reference") 
                 && !localName.equals("repeatable-page-master-reference")
index 35da2f03b8b8a1de874b848a6be79c9aadffcea4..c92404c77b17e687ca0a2d2334339de35bf674fe 100644 (file)
@@ -20,16 +20,15 @@ package org.apache.fop.fo.pagination;
 
 import java.awt.Rectangle;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.FODimension;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
 
 /**
@@ -59,7 +58,7 @@ public abstract class Region extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) throws SAXParseException {
+    public void bind(PropertyList pList) throws FOPException {
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
         // clip = pList.get(PR_CLIP);
         displayAlign = pList.get(PR_DISPLAY_ALIGN).getEnum();
@@ -75,7 +74,7 @@ public abstract class Region extends FObj {
             // check that name is OK. Not very pretty.
             if (isReserved(getRegionName())
                     && !getRegionName().equals(getDefaultRegionName())) {
-                throw new SAXParseException("region-name '" + regionName
+                throw new ValidationException("region-name '" + regionName
                         + "' for " + this.getName()
                         + " is not permitted.", locator);
             }
@@ -87,7 +86,7 @@ public abstract class Region extends FObj {
      * XSL Content Model: empty
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
             invalidChildError(loc, nsURI, localName);
     }
 
index 5b9df542db8531c258fef09d0a1d87f7b52fc755..227104e344865c3af66fb6c5cab53a5b5a99551b 100644 (file)
@@ -21,10 +21,7 @@ package org.apache.fop.fo.pagination;
 // Java
 import java.awt.Rectangle;
 
-// XML
-import org.xml.sax.SAXParseException;
-
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.PropertyList;
@@ -48,7 +45,7 @@ public abstract class RegionBA extends Region {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) throws SAXParseException {
+    public void bind(PropertyList pList) throws FOPException {
         super.bind(pList);
         extent = pList.get(PR_EXTENT).getLength();
         precedence = pList.get(PR_PRECEDENCE).getEnum();
index 3ed0adeb9e28ebb9a654f84a484e47a1248a8b2a..0f7a2646418cbe95b1eb8f1bdfb8622a0f7c5a96 100644 (file)
@@ -21,10 +21,7 @@ package org.apache.fop.fo.pagination;
 // Java
 import java.awt.Rectangle;
 
-// XML
-import org.xml.sax.SAXParseException;
-
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.FODimension;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.Numeric;
@@ -52,7 +49,7 @@ public class RegionBody extends Region {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) throws SAXParseException {
+    public void bind(PropertyList pList) throws FOPException {
         super.bind(pList);
         commonMarginBlock = pList.getMarginBlockProps();
         columnCount = pList.get(PR_COLUMN_COUNT).getNumeric();
index 584a5996d9821eea6df78f59470f78878f8bf81c..d75db5f68c4344573eb804a831fea52859599e1d 100644 (file)
@@ -21,10 +21,7 @@ package org.apache.fop.fo.pagination;
 // Java
 import java.awt.Rectangle;
 
-// XML
-import org.xml.sax.SAXParseException;
-
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.PropertyList;
@@ -47,7 +44,7 @@ public abstract class RegionSE extends Region {
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) throws SAXParseException {
+    public void bind(PropertyList pList) throws FOPException {
         super.bind(pList);
         extent = pList.get(PR_EXTENT).getLength();
     }
index 654bd733d15e04475f4dc8af73133ae4869eb68c..566397fce40c931660f9fa40b5eaa17fa129e5ea 100644 (file)
@@ -21,14 +21,13 @@ package org.apache.fop.fo.pagination;
 // Java
 import java.util.ArrayList;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.Property;
 
 /**
@@ -59,21 +58,21 @@ public class RepeatablePageMasterAlternatives extends FObj
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         maximumRepeats = pList.get(PR_MAXIMUM_REPEATS);
     }
 
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         conditionalPageMasterRefs = new ArrayList();
 
         if (parent.getName().equals("fo:page-sequence-master")) {
             PageSequenceMaster pageSequenceMaster = (PageSequenceMaster)parent;
             pageSequenceMaster.addSubsequenceSpecifier(this);
         } else {
-            throw new SAXParseException("fo:repeatable-page-master-alternatives "
+            throw new ValidationException("fo:repeatable-page-master-alternatives "
                                    + "must be child of fo:page-sequence-master, not "
                                    + parent.getName(), locator);
         }
@@ -82,7 +81,7 @@ public class RepeatablePageMasterAlternatives extends FObj
     /**
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (childNodes == null) {
            missingChildElementError("(conditional-page-master-reference+)");
         }
@@ -93,7 +92,7 @@ public class RepeatablePageMasterAlternatives extends FObj
         XSL/FOP: (conditional-page-master-reference+)
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (!(nsURI == FO_URI &&
             localName.equals("conditional-page-master-reference"))) {
                 invalidChildError(loc, nsURI, localName);
index 21b6af66d8877955dff912c1da7aa0f2348b5f5d..860ae58c00de600a9ad776d49e29157967ffa606 100644 (file)
@@ -20,12 +20,12 @@ package org.apache.fop.fo.pagination;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.Property;
 
 /**
@@ -56,7 +56,7 @@ public class RepeatablePageMasterReference extends FObj
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         masterReference = pList.get(PR_MASTER_REFERENCE).getString();
         maximumRepeats = pList.get(PR_MAXIMUM_REPEATS);
     }
@@ -64,7 +64,7 @@ public class RepeatablePageMasterReference extends FObj
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         PageSequenceMaster pageSequenceMaster = (PageSequenceMaster) parent;
 
         if (masterReference == null) {
@@ -79,7 +79,7 @@ public class RepeatablePageMasterReference extends FObj
      * XSL Content Model: empty
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         invalidChildError(loc, nsURI, localName);
     }
 
index 0001735409541778faa9693ab209c60a399a1bb9..a38342573bee7cec14de1895612ba7ae1c1cc0c6 100644 (file)
@@ -21,17 +21,16 @@ package org.apache.fop.fo.pagination;
 // java
 import java.util.List;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.FOEventHandler;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.FOEventHandler;
 import org.apache.fop.fo.PropertyList;
-import org.apache.fop.fo.extensions.ExtensionElementMapping;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.extensions.Bookmarks;
+import org.apache.fop.fo.extensions.ExtensionElementMapping;
 
 /**
  * The fo:root formatting object. Contains page masters, page-sequences.
@@ -81,7 +80,7 @@ public class Root extends FObj {
     /**
      * Signal end of this xml element.
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (!pageSequenceFound || layoutMasterSet == null) {
             missingChildElementError("(layout-master-set, declarations?, " + 
                 "fox:bookmarks?, page-sequence+)");
@@ -94,7 +93,7 @@ public class Root extends FObj {
         FOP: (layout-master-set, declarations?, fox:bookmarks?, page-sequence+)
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI) {
             if (localName.equals("layout-master-set")) {   
                 if (layoutMasterSet != null) {
index 0bb663e847a79e291df0055a7ccd08b66463b103..8a8ef1c5dbfaaed3f3a767c53d4e35eb47b139b4 100644 (file)
@@ -23,16 +23,15 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
-// XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonMarginBlock;
 
 /**
@@ -72,7 +71,7 @@ public class SimplePageMaster extends FObj {
     /**
      * @see org.apache.fop.fo.FObj#resolve
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonMarginBlock = pList.getMarginBlockProps();
         masterName = pList.get(PR_MASTER_NAME).getString();
         pageHeight = pList.get(PR_PAGE_HEIGHT).getLength();
@@ -84,7 +83,7 @@ public class SimplePageMaster extends FObj {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         LayoutMasterSet layoutMasterSet = (LayoutMasterSet) parent;
 
         if (masterName == null) {
@@ -101,7 +100,7 @@ public class SimplePageMaster extends FObj {
      * Make sure content model satisfied.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (!hasRegionBody) {
             missingChildElementError("(region-body, region-before?," +
                 " region-after?, region-start?, region-end?)");
@@ -113,7 +112,7 @@ public class SimplePageMaster extends FObj {
      * XSL Content Model: (region-body,region-before?,region-after?,region-start?,region-end?)
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (nsURI == FO_URI && localName.equals("region-body")) {
             if (hasRegionBody) {
                 tooManyNodesError(loc, "fo:region-body");
index 7507a52339bdad20e0b6c40d276eba40d475d55e..be54448018d999f87602f19dc75049cd6e5ba57e 100644 (file)
@@ -20,12 +20,12 @@ package org.apache.fop.fo.pagination;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 
 /**
  * A single-page-master-reference formatting object.
@@ -55,14 +55,14 @@ public class SinglePageMasterReference extends FObj
     /**
      * @see org.apache.fop.fo.FObj#bind(PropertyList)
      */
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         masterReference = pList.get(PR_MASTER_REFERENCE).getString();
     }
 
     /**
      * @see org.apache.fop.fo.FONode#startOfNode
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         PageSequenceMaster pageSequenceMaster = (PageSequenceMaster) parent;
         if (masterReference == null) {
             missingPropertyError("master-reference");
@@ -76,7 +76,7 @@ public class SinglePageMasterReference extends FObj
      * XSL Content Model: empty
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
        invalidChildError(loc, nsURI, localName);
     }
 
index 98364c5dccf71f7bd32008a331e99c6f161c5786..50646780793d8022d6be40f737ab36b0284c69bf 100644 (file)
@@ -20,10 +20,10 @@ package org.apache.fop.fo.pagination;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.ValidationException;
 
 /**
  * Class modelling the fo:static-content object.
@@ -40,9 +40,9 @@ public class StaticContent extends Flow {
     /**
      * @see org.apache.fop.fo.FONode#startOfNode()
      */
-    protected void startOfNode() throws SAXParseException {
+    protected void startOfNode() throws FOPException {
         if (getFlowName() == null || getFlowName().equals("")) {
-            throw new SAXParseException("A 'flow-name' is required for "
+            throw new ValidationException("A 'flow-name' is required for "
                                    + getName() + ".", locator);
         }
         getFOEventHandler().startFlow(this);
@@ -53,7 +53,7 @@ public class StaticContent extends Flow {
      * FOEventHandler that we are at the end of the flow.
      * @see org.apache.fop.fo.FONode#endOfNode
      */
-    protected void endOfNode() throws SAXParseException {
+    protected void endOfNode() throws FOPException {
         if (childNodes == null) {
             missingChildElementError("(%block;)+");
         }
@@ -65,7 +65,7 @@ public class StaticContent extends Flow {
      * XSL Content Model: (%block;)+
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (!isBlockItem(nsURI, localName)) {
             invalidChildError(loc, nsURI, localName);
         }
index afe49a775cbe3d9a01002478449c7fb47cbd7eea..03ca47ca5fa0aaedb05e7f05d91aa8f615392e38 100644 (file)
@@ -20,14 +20,14 @@ package org.apache.fop.fo.pagination;
 
 // XML
 import org.xml.sax.Locator;
-import org.xml.sax.SAXParseException;
 
-// FOP
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.datatypes.Length;
-import org.apache.fop.fo.FObjMixed;
 import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObjMixed;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
@@ -55,7 +55,7 @@ public class Title extends FObjMixed {
         super(parent);
     }
 
-    public void bind(PropertyList pList) {
+    public void bind(PropertyList pList) throws FOPException {
         commonAccessibility = pList.getAccessibilityProps();
         commonAural = pList.getAuralProps();
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
@@ -71,7 +71,7 @@ public class Title extends FObjMixed {
         XSL/FOP: (#PCDATA|%inline;)*
      */
     protected void validateChildNode(Locator loc, String nsURI, String localName) 
-        throws SAXParseException {
+        throws ValidationException {
         if (!isInlineItem(nsURI, localName)) {
             invalidChildError(loc, nsURI, localName);
         }
index dab9046458cb3730d7dc1cea7d8537deca04a23f..84e5122fb16d959da4bbf105699c563c75658075 100644 (file)
@@ -18,9 +18,9 @@
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * This subclass of LengthProperty.Maker handles the special treatment of 
@@ -54,7 +54,7 @@ public class BorderWidthPropertyMaker extends LengthProperty.Maker {
    
     public Property get(int subpropId, PropertyList propertyList,
                         boolean bTryInherit, boolean bTryDefault)
-        throws FOPException
+        throws PropertyException
     {
         Property p = super.get(subpropId, propertyList,
                                bTryInherit, bTryDefault);
index 5e0d079ca02c4d036da979942d630376379275cf..f0fc322558eb20b172f0aa73b550abe8a5bb4a78 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.fop.fo.properties;
 
 import org.apache.fop.fo.FOPropertyMapping;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Shorthand property parser for Box properties
@@ -42,7 +43,9 @@ public class BoxPropShorthandParser extends GenericShorthandParser {
     protected Property convertValueForProperty(int propId,
                                                ListProperty listProperty,
                                                PropertyMaker maker,
-                                               PropertyList propertyList) {
+                                               PropertyList propertyList)
+        throws PropertyException
+    {
         String name = FOPropertyMapping.getPropertyName(propId);
         Property p = null;
         int count = listProperty.getList().size();
index a9e85f202d30a3e89fb43c9c3ee8b5d610750650..0105740498d91138362de9989092f8d0963ca8e1 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.fop.fo.properties;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Store all common absolute position properties.
@@ -57,7 +58,7 @@ public class CommonAbsolutePosition {
      * Create a CommonAbsolutePosition object.
      * @param pList The PropertyList with propery values.
      */
-    public CommonAbsolutePosition(PropertyList pList) {
+    public CommonAbsolutePosition(PropertyList pList) throws PropertyException {
         absolutePosition = pList.get(Constants.PR_ABSOLUTE_POSITION).getEnum();
         top = pList.get(Constants.PR_TOP).getLength();
         bottom = pList.get(Constants.PR_BOTTOM).getLength();
index 333099b9f226a88e62c1f16337111d409b908dfb..7bf382070eee08b8e032eda55bbe67d6967d2dee 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.fop.fo.properties;
 
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Store all common accessibility properties.
@@ -41,7 +42,7 @@ public class CommonAccessibility {
      * Create a CommonAbsolutePosition object.
      * @param pList The PropertyList with propery values.
      */
-    public CommonAccessibility(PropertyList pList) {
+    public CommonAccessibility(PropertyList pList) throws PropertyException {
         sourceDoc = pList.get(Constants.PR_SOURCE_DOCUMENT).getString();
         if ("none".equals(sourceDoc)) {
             sourceDoc = null;
index 1fee1009043dff59d5e472b6a00453b033660686..ce6bd47a1b3e051c1ea7a5038afd7e6e0b9122a8 100755 (executable)
@@ -22,6 +22,7 @@ import org.apache.fop.datatypes.ColorType;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Stores all common border and padding properties.
@@ -82,7 +83,7 @@ public class CommonBorderPaddingBackground implements Cloneable {
      * Construct a CommonBorderPaddingBackground object.
      * @param pList The PropertyList to get properties from.
      */
-    public CommonBorderPaddingBackground(PropertyList pList) {
+    public CommonBorderPaddingBackground(PropertyList pList) throws PropertyException {
         backgroundAttachment = pList.get(Constants.PR_BACKGROUND_ATTACHMENT).getEnum();
         backgroundColor = pList.get(Constants.PR_BACKGROUND_COLOR).getColorType();
         if (backgroundColor.getAlpha() == 0) {
@@ -122,7 +123,8 @@ public class CommonBorderPaddingBackground implements Cloneable {
     }
 
     private void initBorderInfo(PropertyList pList, int side, 
-            int colorProp, int styleProp, int widthProp, int paddingProp) 
+            int colorProp, int styleProp, int widthProp, int paddingProp)
+        throws PropertyException
     {
         padding[side] = pList.get(paddingProp).getCondLength();
         // If style = none, force width to 0, don't get Color (spec 7.7.20)
index ba56e7aa5729671bc917653d0161d2f334162812..30e9ea09d56534416c875ee1146ca892260a3a7a 100755 (executable)
@@ -23,6 +23,7 @@ import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 import org.apache.fop.fonts.Font;
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.FontMetrics;
@@ -78,7 +79,7 @@ public class CommonFont {
      * Create a CommonFont object.
      * @param pList The PropertyList to get properties from.
      */
-       public CommonFont(PropertyList pList) {
+       public CommonFont(PropertyList pList) throws PropertyException {
        fontFamily = pList.get(Constants.PR_FONT_FAMILY).getString();
        fontSelectionStrategy = pList.get(Constants.PR_FONT_SELECTION_STRATEGY).getEnum();
        fontSize = pList.get(Constants.PR_FONT_SIZE).getLength();
index 82b87059cbd33df080fea9b80d378a6d019cf66a..660b864ba46e4eef30c03dde0daa55b9ac5ba705 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.fop.fo.properties;
 
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Store all common hyphenation properties.
@@ -66,7 +67,7 @@ public class CommonHyphenation {
      * Create a CommonHyphenation object.
      * @param pList The PropertyList with propery values.
      */
-    public CommonHyphenation(PropertyList pList) {
+    public CommonHyphenation(PropertyList pList) throws PropertyException {
         language = pList.get(Constants.PR_LANGUAGE).getString();
         country = pList.get(Constants.PR_COUNTRY).getString();
         hyphenate = pList.get(Constants.PR_HYPHENATE).getEnum();
index 5c4fc16d80790a47590768a03c6b32804433cc6c..5b7e89bf56e8b2370d19ec1de54ef81bcae8c33a 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.fop.fo.properties;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Store all common margin properties for blocks.
@@ -72,7 +73,7 @@ public class CommonMarginBlock {
      * Create a CommonMarginBlock object.
      * @param pList The PropertyList with propery values.
      */
-    public CommonMarginBlock(PropertyList pList) {
+    public CommonMarginBlock(PropertyList pList) throws PropertyException {
         marginTop = pList.get(Constants.PR_MARGIN_TOP).getLength();
         marginBottom = pList.get(Constants.PR_MARGIN_BOTTOM).getLength();
         marginLeft = pList.get(Constants.PR_MARGIN_LEFT).getLength();
index 1597e67522d972ba788b35bb28f0b94cecc474ce..4a5353f335063f49ed023083a592b2a892f72b95 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.fop.fo.properties;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Store all common margin properties for inlines.
@@ -63,7 +64,7 @@ public class CommonMarginInline {
      * Create a CommonMarginInline object.
      * @param pList The PropertyList with propery values.
      */
-    public CommonMarginInline(PropertyList pList) {
+    public CommonMarginInline(PropertyList pList) throws PropertyException {
         marginTop = pList.get(Constants.PR_MARGIN_TOP).getLength();
         marginBottom = pList.get(Constants.PR_MARGIN_BOTTOM).getLength();
         marginLeft = pList.get(Constants.PR_MARGIN_LEFT).getLength();
index f400c8272f5112844164cc86d70a85d3e877e764..e8178ada8b8da5fb8e0821720888ce0d3ec52633 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.fop.fo.properties;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Store all common relative position properties.
@@ -57,7 +58,7 @@ public class CommonRelativePosition {
      * Create a CommonRelativePosition object.
      * @param pList The PropertyList with propery values.
      */
-    public CommonRelativePosition(PropertyList pList) {
+    public CommonRelativePosition(PropertyList pList) throws PropertyException {
         relativePosition = pList.get(Constants.PR_RELATIVE_POSITION).getEnum();
         top = pList.get(Constants.PR_TOP).getLength();
         bottom = pList.get(Constants.PR_BOTTOM).getLength();
index bcb686bc58901ac830b7a9b982e3c254d490a7b7..ab09b266df54e435df79a7b8eb58022058fd4ccb 100644 (file)
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.CompoundDatatype;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * @author me
@@ -145,7 +145,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
      */
     public Property get(int subpropId, PropertyList propertyList,
                         boolean bTryInherit, boolean bTryDefault)
-        throws FOPException
+        throws PropertyException
     {
         Property p = super.get(subpropId, propertyList, bTryInherit, bTryDefault);
         if (subpropId != 0 && p != null) {
@@ -163,11 +163,11 @@ public class CompoundPropertyMaker extends PropertyMaker {
      * @param fo The parent FO for the FO whose property is being made.
      * @return A Property of the correct type or null if the parsed value
      * can't be converted to the correct type.
-     * @throws FOPException for invalid or inconsistent FO input
+     * @throws PropertyException for invalid or inconsistent FO input
      */
     protected Property convertProperty(Property p,
                                     PropertyList propertyList,
-                                    FObj fo) throws FOPException {
+                                    FObj fo) throws PropertyException {
         if (!EnumProperty.class.isAssignableFrom(p.getClass())) {
             // delegate to the subprop maker to do conversions
             p = shorthandMaker.convertProperty(p, propertyList, fo);
@@ -191,9 +191,9 @@ public class CompoundPropertyMaker extends PropertyMaker {
      * Make a compound property with default values. 
      * @param propertyList The PropertyList object being built for this FO.
      * @return the Property object corresponding to the parameters
-     * @throws FOPException for invalid or inconsisten FO input
+     * @throws PropertyException for invalid or inconsisten FO input
      */
-    public Property make(PropertyList propertyList) throws FOPException {
+    public Property make(PropertyList propertyList) throws PropertyException {
         if (defaultValue != null) {
             return make(propertyList, defaultValue, propertyList.getParentFObj());
         } else {
@@ -207,10 +207,10 @@ public class CompoundPropertyMaker extends PropertyMaker {
      * @param value The attribute value.
      * @param fo The parent FO for the FO whose property is being made.
      * @return The initialized Property object.
-     * @throws FOPException for invalid or inconsistent FO input
+     * @throws PropertyException for invalid or inconsistent FO input
      */    
     public Property make(PropertyList propertyList, String value,
-                         FObj fo) throws FOPException {
+                         FObj fo) throws PropertyException {
         Property p = super.make(propertyList, value, fo);
         p = convertProperty(p, propertyList, fo);
         return p; 
@@ -228,11 +228,11 @@ public class CompoundPropertyMaker extends PropertyMaker {
      * @param value the value of the
      * @return baseProp (or if null, a new compound property object) with
      * the new subproperty added
-     * @throws FOPException for invalid or inconsistent FO input
+     * @throws PropertyException for invalid or inconsistent FO input
      */
     public Property make(Property baseProp, int subpropId,
                          PropertyList propertyList, String value,
-                         FObj fo) throws FOPException {
+                         FObj fo) throws PropertyException {
         if (baseProp == null) {
             baseProp = makeCompound(propertyList, fo);
         }
@@ -258,10 +258,10 @@ public class CompoundPropertyMaker extends PropertyMaker {
      * @param parentFO The parent FO for the FO whose property is being made.
      * @return a Property subclass object holding a "compound" property object
      *         initialized to the default values for each component.
-     * @throws FOPException
+     * @throws PropertyException
      */
     protected Property makeCompound(PropertyList propertyList, FObj parentFO)
-        throws FOPException
+        throws PropertyException
     {
         Property p = makeNewProperty();
         CompoundDatatype data = (CompoundDatatype) p.getObject();
index 91e89964ef71212ca292a679fadac7353406347b..9238996bbc25ec1ad0ef73feed712f7bb7545db0 100644 (file)
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.CompoundDatatype;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Superclass for properties that have conditional lengths
@@ -56,7 +56,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
          * @see CompoundPropertyMaker#convertProperty
          */        
         public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
-            throws FOPException
+            throws PropertyException
         {
             if (p instanceof KeepProperty) {
                 return p;
index 96dcbe5e4c4f195c8eca6bc24a496038f0a5312d..a3f0a422334b6cc35087e74cd20ba105b6ab5412 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.fop.fo.properties;
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  */
@@ -94,7 +95,7 @@ public class CorrespondingPropertyMaker {
      * are specified (in foproperties.xml) to compute the value.
      * @throws FOPException for invalid or inconsistent FO input
      */
-    public Property compute(PropertyList propertyList) throws FOPException {
+    public Property compute(PropertyList propertyList) throws PropertyException {
         PropertyList pList = getWMPropertyList(propertyList);
         if (pList == null) {
             return null;
index c228f256c310ef299438ebcdd66a5f5db7f22427..c5ff73b5519f90bd159dadb4f12d61ffef155241 100644 (file)
@@ -18,9 +18,9 @@
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * @author me
@@ -50,7 +50,7 @@ public class DimensionPropertyMaker extends CorrespondingPropertyMaker {
         return false;
     }
 
-    public Property compute(PropertyList propertyList) throws FOPException {
+    public Property compute(PropertyList propertyList) throws PropertyException {
         // Based on [width|height]
         Property p = super.compute(propertyList);
         if (p == null) {
index 32f7dbb008cec05879fef52a17a6956df0e7176f..0e1a90bf2f17dd14300a80c2b33076c772e7f0c4 100644 (file)
@@ -18,9 +18,9 @@
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Superclass for properties that wrap an enumeration value
@@ -52,7 +52,7 @@ public class EnumProperty extends Property {
 
         public Property convertProperty(Property p,
                                         PropertyList propertyList,
-                                        FObj fo) throws FOPException {
+                                        FObj fo) throws PropertyException {
             if (p instanceof EnumProperty) {
                 return p;
             } else {
index c8b92f64213f1bb798d2a412485f2c04e331e8ae..47146e257e1547d28158f54fd42d3df553bb2d15 100644 (file)
@@ -19,7 +19,9 @@
 package org.apache.fop.fo.properties;
 
 import java.util.Enumeration;
+
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 public class GenericShorthandParser implements ShorthandParser {
 
@@ -46,7 +48,9 @@ public class GenericShorthandParser implements ShorthandParser {
     public Property getValueForProperty(int propId,
                                         Property property,
                                         PropertyMaker maker,
-                                        PropertyList propertyList) {
+                                        PropertyList propertyList)
+        throws PropertyException
+    {
         Property prop = null;
         // Check for keyword "inherit"
         if (property.getList().size() == 1) {
@@ -70,7 +74,9 @@ public class GenericShorthandParser implements ShorthandParser {
     protected Property convertValueForProperty(int propId,
                                                Property property,
                                                PropertyMaker maker,
-                                               PropertyList propertyList) {
+                                               PropertyList propertyList)
+        throws PropertyException
+    {
         Property prop = null;
         // Try each of the stored values in turn
         Enumeration eprop = property.getList().elements();
index ed679cb4bcaedc7dc1838124640d21d99aba8c8c..848b47981122ece437a3b3f41432b5b56406b98f 100644 (file)
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Numeric;
-import org.apache.fop.fo.FOPropertyMapping;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.expr.NumericOp;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * This property maker handles the calculations described in 5.3.2 which
@@ -68,45 +67,42 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
      * Calculate the corresponding value for start-indent and end-indent.  
      * @see CorrespondingPropertyMaker#compute(PropertyList)
      */
-    public Property compute(PropertyList propertyList) throws FOPException {
+    public Property compute(PropertyList propertyList) throws PropertyException {
         PropertyList pList = getWMPropertyList(propertyList);
         // Calculate the values as described in 5.3.2.
-        try {
-            int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
-            Numeric margin;
+
+        int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
+        Numeric margin;
 //          Calculate the absolute margin.
-            if (propertyList.getExplicitOrShorthand(marginProp) == null) {
-                Property indent = propertyList.getExplicit(baseMaker.propId);
-                if (indent == null) {
-                    margin = new FixedLength(0);
-                } else {
-                    margin = propertyList.getExplicit(baseMaker.propId).getNumeric();
-                    margin = NumericOp.subtraction(margin, propertyList.getInherited(baseMaker.propId).getNumeric());
-                }
-                margin = NumericOp.subtraction(margin, getCorresponding(paddingCorresponding, propertyList).getNumeric());
-                margin = NumericOp.subtraction(margin, getCorresponding(borderWidthCorresponding, propertyList).getNumeric());
+        if (propertyList.getExplicitOrShorthand(marginProp) == null) {
+            Property indent = propertyList.getExplicit(baseMaker.propId);
+            if (indent == null) {
+                margin = new FixedLength(0);
             } else {
-                margin = propertyList.get(marginProp).getNumeric();
-            }
-            
-            Numeric v = new FixedLength(0);
-            if (!propertyList.getFObj().generatesReferenceAreas()) {
-                // The inherited_value_of([start|end]-indent)
-                v = NumericOp.addition(v, propertyList.getInherited(baseMaker.propId).getNumeric());
+                margin = propertyList.getExplicit(baseMaker.propId).getNumeric();
+                margin = NumericOp.subtraction(margin, propertyList.getInherited(baseMaker.propId).getNumeric());
             }
-            // The corresponding absolute margin-[right|left}.
-            v = NumericOp.addition(v, margin);
-            v = NumericOp.addition(v, getCorresponding(paddingCorresponding, propertyList).getNumeric());
-            v = NumericOp.addition(v, getCorresponding(borderWidthCorresponding, propertyList).getNumeric());
-            return (Property) v;
-        } catch (org.apache.fop.fo.expr.PropertyException propEx) {
-           String propName = FOPropertyMapping.getPropertyName(baseMaker.getPropId());
-           throw new FOPException("Error in " + propName 
-                   + " calculation " + propEx);
-        }    
+            margin = NumericOp.subtraction(margin, getCorresponding(paddingCorresponding, propertyList).getNumeric());
+            margin = NumericOp.subtraction(margin, getCorresponding(borderWidthCorresponding, propertyList).getNumeric());
+        } else {
+            margin = propertyList.get(marginProp).getNumeric();
+        }
+        
+        Numeric v = new FixedLength(0);
+        if (!propertyList.getFObj().generatesReferenceAreas()) {
+            // The inherited_value_of([start|end]-indent)
+            v = NumericOp.addition(v, propertyList.getInherited(baseMaker.propId).getNumeric());
+        }
+        // The corresponding absolute margin-[right|left}.
+        v = NumericOp.addition(v, margin);
+        v = NumericOp.addition(v, getCorresponding(paddingCorresponding, propertyList).getNumeric());
+        v = NumericOp.addition(v, getCorresponding(borderWidthCorresponding, propertyList).getNumeric());
+        return (Property) v;
     }
     
-    private Property getCorresponding(int[] corresponding, PropertyList propertyList) {
+    private Property getCorresponding(int[] corresponding, PropertyList propertyList)
+        throws PropertyException 
+    {
         PropertyList pList = getWMPropertyList(propertyList);
         int wmcorr = pList.getWritingMode(corresponding[0], corresponding[1], corresponding[2]);
         return propertyList.get(wmcorr);
index ecf8e92e64f5791416f8e6f75f1234b450763ba3..e0a92886a6dd8a1d2382346dad004c698b595353 100644 (file)
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.CompoundDatatype;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Superclass for properties that wrap Keep values
@@ -55,7 +55,7 @@ public class KeepProperty extends Property implements CompoundDatatype {
          * @see CompoundPropertyMaker#convertProperty
          */        
         public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
-            throws FOPException
+            throws PropertyException
         {
             if (p instanceof KeepProperty) {
                 return p;
index 6b2398db564f790d4c14fb07143bf337d406b0ba..b782d9b0643ed6fedbd28db64a776a2398ce9024 100644 (file)
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.CompoundDatatype;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Superclass for properties wrapping a LengthPair value
@@ -54,7 +54,7 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
          * @see CompoundPropertyMaker#convertProperty
          */        
         public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
-            throws FOPException
+            throws PropertyException
         {
             if (p instanceof LengthPairProperty) {
                 return p;
index e2697c9ba6836ec79ea4860f686b281ebb8b1010..145b5c38e55a6de77a7a05ee073a57ef0742a969 100644 (file)
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Superclass for properties wrapping a Length value.
@@ -72,7 +72,7 @@ abstract public class LengthProperty extends Property
          */
         public Property convertProperty(Property p,
                                         PropertyList propertyList,
-                                        FObj fo) throws FOPException {
+                                        FObj fo) throws PropertyException {
             Property prop = super.convertProperty(p, propertyList, fo);
             if (prop != null) {
                 return prop;
index a3429bfa51ee185edf1a9ce471073a90124f6053..8aa281aada8ef1b5aafd135904e007f3c6fc78ab 100644 (file)
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.CompoundDatatype;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Superclass for properties that contain LengthRange values
@@ -60,7 +60,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
          * @see CompoundPropertyMaker#convertProperty
          */        
         public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
-            throws FOPException
+            throws PropertyException
         {
             if (p instanceof LengthRangeProperty) {
                 return p;
index b1c3ae5634c9a94675cbffb27894ed97630a124c..6c2da7dc33a5335b888b324b188a0ff8cd433e14 100644 (file)
@@ -18,7 +18,6 @@
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
@@ -47,7 +46,7 @@ public class LineHeightPropertyMaker extends SpaceProperty.Maker {
      * @see PropertyMaker#make(PropertyList, String, FObj)
      */
     public Property make(PropertyList propertyList, String value,
-                         FObj fo) throws FOPException {
+                         FObj fo) throws PropertyException {
         Property p = super.make(propertyList, value, fo);
         p.setSpecifiedValue(checkValueKeywords(value));
         return p;
@@ -58,22 +57,15 @@ public class LineHeightPropertyMaker extends SpaceProperty.Maker {
      * value.
      * @see PropertyMaker#compute(PropertyList)
      */
-    protected Property compute(PropertyList propertyList) throws FOPException {
+    protected Property compute(PropertyList propertyList) throws PropertyException {
         // recalculate based on last specified value
         // Climb up propertylist and find last spec'd value
         Property specProp = propertyList.getNearestSpecified(propId);
         if (specProp != null) {
             String specVal = specProp.getSpecifiedValue();
             if (specVal != null) {
-                try {
-                    return make(propertyList, specVal,
+                return make(propertyList, specVal,
                             propertyList.getParentFObj());
-                } catch (FOPException e) {
-                    //getLogger()error("Error computing property value for "
-                    //                       + propName + " from "
-                    //                       + specVal);
-                    return null;
-                }
             }
         }
         return null;
@@ -81,14 +73,10 @@ public class LineHeightPropertyMaker extends SpaceProperty.Maker {
 
     public Property convertProperty(Property p,
             PropertyList propertyList,
-            FObj fo) throws FOPException {
+            FObj fo) throws PropertyException {
         Numeric numval = p.getNumeric();
         if (numval != null && numval.getDimension() == 0) {
-            try {
-                p = new PercentLength(numval.getNumericValue(), getPercentBase(fo,propertyList));
-            } catch (PropertyException exc) {
-                // log.error("exception", exc);
-            }
+            p = new PercentLength(numval.getNumericValue(), getPercentBase(fo,propertyList));
         }
         return super.convertProperty(p, propertyList, fo);
     }
index df57c7b4d647d50c4a997f0eea69404cc38ee555..82c52adafe653efc72192d901e5f002813e8cdc4 100644 (file)
 package org.apache.fop.fo.properties;
 
 import org.apache.fop.datatypes.PercentBase;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * a percent specified length quantity in XSL
  */
 public class PercentLength extends LengthProperty {
-
+    
     /**
      * The percentage itself, expressed as a decimal value, e.g. for 95%, set
      * the value to .95
@@ -79,7 +80,12 @@ public class PercentLength extends LengthProperty {
      * @see org.apache.fop.datatypes.Numeric#getNumericValue()
      */
     public double getNumericValue() {
-        return factor * lbase.getBaseLength();
+        try {
+            return factor * lbase.getBaseLength();
+        } catch (PropertyException exc) {
+            log.error(exc);
+            return 0;
+        }
     }
 
     /**
@@ -87,7 +93,7 @@ public class PercentLength extends LengthProperty {
      * @see org.apache.fop.datatypes.Length#getValue() 
      */
     public int getValue() {
-        return (int) (factor * lbase.getBaseLength());
+        return (int) getNumericValue();
     }
 
     /**
index 6f5e5b4a7843dec3532cef4db743bbdfc7191367..b1c010f96d9adc4da3f47616505879af03af81eb 100644 (file)
@@ -20,6 +20,9 @@ package org.apache.fop.fo.properties;
 
 import java.util.Vector;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.Numeric;
 
@@ -28,6 +31,7 @@ import org.apache.fop.datatypes.Numeric;
  * @author unascribed
  */
 public class Property {
+    protected static Log log = LogFactory.getLog(PropertyMaker.class);
 
     /**
      * The original specified value for properties which inherit
index 5bed4bb1a2738ec9225f3ec37d23a3834239ed81..eed2a45df0d30c005cc39913d99a91ba9d589aaf 100644 (file)
@@ -21,7 +21,9 @@ package org.apache.fop.fo.properties;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.fop.apps.FOPException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import org.apache.fop.datatypes.CompoundDatatype;
 import org.apache.fop.datatypes.LengthBase;
 import org.apache.fop.datatypes.PercentBase;
@@ -29,12 +31,10 @@ import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FOPropertyMapping;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 import org.apache.fop.fo.expr.PropertyInfo;
 import org.apache.fop.fo.expr.PropertyParser;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 
 /**
  * Base class for all property makers
@@ -55,7 +55,7 @@ public class PropertyMaker implements Cloneable {
     protected Property defaultProperty;
     protected CorrespondingPropertyMaker corresponding;
 
-    private Log log = LogFactory.getLog(PropertyMaker.class);
+    private static Log log = LogFactory.getLog(PropertyMaker.class);
 
     /**
      * @return the name of the property for this Maker
@@ -235,7 +235,7 @@ public class PropertyMaker implements Cloneable {
      */
     public Property findProperty(PropertyList propertyList, 
                                  boolean bTryInherit)
-        throws FOPException
+        throws PropertyException
     {
         Property p = null;
         
@@ -279,16 +279,12 @@ public class PropertyMaker implements Cloneable {
      */
     public Property get(int subpropId, PropertyList propertyList,
                         boolean bTryInherit, boolean bTryDefault)
-        throws FOPException
+        throws PropertyException
     {
         Property p = findProperty(propertyList, bTryInherit);
 
         if (p == null && bTryDefault) {    // default value for this FO!
-            try {
-                p = make(propertyList);
-            } catch (FOPException e) {
-                // don't know what to do here
-            }
+            p = make(propertyList);
         }
         return p;
     }
@@ -363,9 +359,9 @@ public class PropertyMaker implements Cloneable {
      * Return the default value.   
      * @param propertyList The PropertyList object being built for this FO.
      * @return the Property object corresponding to the parameters
-     * @throws FOPException for invalid or inconsisten FO input
+     * @throws PropertyException for invalid or inconsisten FO input
      */
-    public Property make(PropertyList propertyList) throws FOPException {
+    public Property make(PropertyList propertyList) throws PropertyException {
         if (defaultProperty != null) {
             if (log.isTraceEnabled()) {
                 log.trace("PropertyMaker.make: reusing defaultProperty, "
@@ -391,10 +387,10 @@ public class PropertyMaker implements Cloneable {
      * @param value The attribute value.
      * @param fo The parent FO for the FO whose property is being made.
      * @return The initialized Property object.
-     * @throws FOPException for invalid or inconsistent FO input
+     * @throws PropertyException for invalid or inconsistent FO input
      */
      public Property make(PropertyList propertyList, String value,
-                         FObj fo) throws FOPException {
+                         FObj fo) throws PropertyException {
         try {
             Property newProp = null;
             String pvalue = value;
@@ -416,14 +412,13 @@ public class PropertyMaker implements Cloneable {
                 newProp = convertProperty(p, propertyList, fo);
             }
             if (newProp == null) {
-                throw new org.apache.fop.fo.expr.PropertyException("No conversion defined");
+                throw new org.apache.fop.fo.expr.PropertyException("No conversion defined " + pvalue);
             }
             return newProp;
-        } catch (org.apache.fop.fo.expr.PropertyException propEx) {
-            String propName = FOPropertyMapping.getPropertyName(this.propId);
-            throw new FOPException("Error in " + propName 
-                                 + " property value '" + value + "': "
-                                 + propEx);
+        } catch (PropertyException propEx) {
+            propEx.setLocator(fo.locator);
+            propEx.setPropertyName(getName());
+            throw propEx;
         }
     }
 
@@ -439,50 +434,42 @@ public class PropertyMaker implements Cloneable {
      * @param value the value of the
      * @return baseProp (or if null, a new compound property object) with
      * the new subproperty added
-     * @throws FOPException for invalid or inconsistent FO input
+     * @throws PropertyException for invalid or inconsistent FO input
      */
     public Property make(Property baseProp, int subpropId,
                          PropertyList propertyList, String value,
-                         FObj fo) throws FOPException {
+                         FObj fo) throws PropertyException {
         //getLogger().error("compound property component "
         //                       + partName + " unknown.");
         return baseProp;
     }
 
     public Property convertShorthandProperty(PropertyList propertyList,
-                                             Property prop, FObj fo) {
-        Property pret = null;
-        try {
-            pret = convertProperty(prop, propertyList, fo);
-            if (pret == null) {
-                // If value is a name token, may be keyword or Enum
-                String sval = prop.getNCname();
-                if (sval != null) {
-                    // System.err.println("Convert shorthand ncname " + sval);
-                    pret = checkEnumValues(sval);
-                    if (pret == null) {
-                        /* Check for keyword shorthand values to be substituted. */
-                        String pvalue = checkValueKeywords(sval);
-                        if (!pvalue.equals(sval)) {
-                            // System.err.println("Convert shorthand keyword" + pvalue);
-                            // Substituted a value: must parse it
-                            Property p =
-                                PropertyParser.parse(pvalue,
-                                                     new PropertyInfo(this,
-                                                                      propertyList,
-                                                                      fo));
-                            pret = convertProperty(p, propertyList, fo);
-                        }
+                                             Property prop, FObj fo)
+        throws PropertyException
+    {
+        Property pret = convertProperty(prop, propertyList, fo);
+        if (pret == null) {
+            // If value is a name token, may be keyword or Enum
+            String sval = prop.getNCname();
+            if (sval != null) {
+                // System.err.println("Convert shorthand ncname " + sval);
+                pret = checkEnumValues(sval);
+                if (pret == null) {
+                    /* Check for keyword shorthand values to be substituted. */
+                    String pvalue = checkValueKeywords(sval);
+                    if (!pvalue.equals(sval)) {
+                        // System.err.println("Convert shorthand keyword" + pvalue);
+                        // Substituted a value: must parse it
+                        Property p =
+                            PropertyParser.parse(pvalue,
+                                                 new PropertyInfo(this,
+                                                                  propertyList,
+                                                                  fo));
+                        pret = convertProperty(p, propertyList, fo);
                     }
                 }
             }
-        } catch (FOPException e) {
-
-            //getLogger().error("convertShorthandProperty caught FOPException "
-            //                       + e);
-        } catch (org.apache.fop.fo.expr.PropertyException propEx) {
-            //getLogger().error("convertShorthandProperty caught PropertyException "
-            //                       + propEx);
         }
         if (pret != null) {
             /*
@@ -538,11 +525,11 @@ public class PropertyMaker implements Cloneable {
      * @param fo The parent FO for the FO whose property is being made.
      * @return A Property of the correct type or null if the parsed value
      * can't be converted to the correct type.
-     * @throws FOPException for invalid or inconsistent FO input
+     * @throws PropertyException for invalid or inconsistent FO input
      */
     protected Property convertProperty(Property p,
                                     PropertyList propertyList,
-                                    FObj fo) throws FOPException {
+                                    FObj fo) throws PropertyException {
         return null;
     }
 
@@ -572,10 +559,10 @@ public class PropertyMaker implements Cloneable {
      * @param propertyList The PropertyList for the FO.
      * @return Property A computed Property value or null if no rules
      * are specified to compute the value.
-     * @throws FOPException for invalid or inconsistent FO input
+     * @throws PropertyException for invalid or inconsistent FO input
      */
     protected Property compute(PropertyList propertyList)
-            throws FOPException {
+            throws PropertyException {
         if (corresponding != null) {
             return corresponding.compute(propertyList);
         }
@@ -595,7 +582,9 @@ public class PropertyMaker implements Cloneable {
      * @param propertyList the collection of properties to be considered
      * @return the Property, if found, the correspons, otherwise, null
      */
-    public Property getShorthand(PropertyList propertyList) {
+    public Property getShorthand(PropertyList propertyList)
+        throws PropertyException
+    {
         if (shorthands == null) {
             return null;
         }
@@ -615,6 +604,10 @@ public class PropertyMaker implements Cloneable {
         }
         return null;
     }
+    
+    public String getName() {
+        return FOPropertyMapping.getPropertyName(propId);
+    }
 
     /**
      * Return a clone of the makers. Used by useGeneric() to clone the
index 0d6b7b09a755ab4693e23f9e49911610edfadcc5..902bfcbe5ba36ec712cfc9262424384e401abc14 100644 (file)
@@ -19,6 +19,7 @@
 package org.apache.fop.fo.properties;
 
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Interface used to provide parsing capabilities to Properties with shorthand
@@ -35,5 +36,5 @@ public interface ShorthandParser {
     Property getValueForProperty(int propId,
                                  Property property,
                                  PropertyMaker maker,
-                                 PropertyList propertyList);
+                                 PropertyList propertyList) throws PropertyException;
 }
index 5f062dbe45f3e997bd40c2e8cdd8f8b5685169e3..d28f38c371755daedacf2af05f69b5348fdf46d2 100644 (file)
@@ -18,9 +18,9 @@
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * Base class used for handling properties of the fo:space-before and
@@ -56,7 +56,7 @@ public class SpaceProperty extends LengthRangeProperty {
          */
         public Property convertProperty(Property p,
                                         PropertyList propertyList,
-                                        FObj fo) throws FOPException {
+                                        FObj fo) throws PropertyException {
             if (p instanceof SpaceProperty) {
                 return p;
             }
index 0c92eaac230a382a7b669061784e7ce212a1a06e..53ddae0934c9302784231e069d1fcb84536c9f85 100755 (executable)
 
 package org.apache.fop.fo.properties;
 
-import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
 
 /**
  * A maker which creates 'letter-spacing' and 'word-spacing' properties.
@@ -43,7 +43,7 @@ public class SpacingPropertyMaker extends SpaceProperty.Maker {
      */
     public Property convertProperty(Property p, 
                                        PropertyList propertyList,
-                                       FObj fo) throws FOPException {
+                                       FObj fo) throws PropertyException {
         if (p.getEnum() == Constants.NORMAL) {
             return p;
         }
index a22490ace8d53f670956d4ddbd8e10a0cf96b5f5..d92f6ec2ab10a7a431bfba3484db888b625d9b35 100644 (file)
 package org.apache.fop.layoutmgr;
 
 import java.util.ArrayList;
-import java.util.List;
 import java.util.LinkedList;
+import java.util.List;
 
-import org.xml.sax.SAXParseException;
-
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.area.Area;
 import org.apache.fop.fo.flow.Marker;
 import org.apache.fop.fo.flow.RetrieveMarker;
@@ -112,7 +111,7 @@ public class RetrieveMarkerLayoutManager extends AbstractLayoutManager {
             if (marker != null) {
                 try {
                     marker.rebind(fobj.getPropertyList());
-                } catch (SAXParseException exc) {
+                } catch (FOPException exc) {
                     log.error("fo:retrieve-marker unable to rebind property values", exc);
                 }
                 marker.addLayoutManager(list);