spepping 2004/07/18 12:51:41
Modified: src/java/org/apache/fop/apps Driver.java
src/java/org/apache/fop/fo FOTreeBuilder.java
Log:
Implemented the ErrorHandler interface in FOTreeBuilder.
Created a method in Driver to return FOTreeBuilder as a DefaultHandler.
Revision Changes Path
1.89 +8 -3 xml-fop/src/java/org/apache/fop/apps/Driver.java
Index: Driver.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Driver.java,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -r1.88 -r1.89
--- Driver.java 18 Jul 2004 01:25:34 -0000 1.88
+++ Driver.java 18 Jul 2004 19:51:40 -0000 1.89
@@ -27,6 +27,7 @@
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
// FOP
import org.apache.fop.fo.Constants;
@@ -146,11 +147,15 @@
* ContentHandler that directly place data into the output stream. Layout
* renderers (e.g. PDF & PostScript) use a ContentHandler that builds an FO
* Tree.
- * @return a SAX ContentHandler for handling the SAX events.
- * @throws FOPException if setting up the ContentHandler fails
+ * @return a SAX DefaultHandler for handling the SAX events.
+ * @throws FOPException if setting up the DefaultHandler fails
*/
- public ContentHandler getContentHandler() throws FOPException {
+ public DefaultHandler getDefaultHandler() throws FOPException {
return new FOTreeBuilder(renderType, foUserAgent, stream);
+ }
+
+ public ContentHandler getContentHandler() throws FOPException {
+ return getDefaultHandler();
}
/**
1.39 +23 -0 xml-fop/src/java/org/apache/fop/fo/FOTreeBuilder.java
Index: FOTreeBuilder.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOTreeBuilder.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- FOTreeBuilder.java 18 Jul 2004 00:50:08 -0000 1.38
+++ FOTreeBuilder.java 18 Jul 2004 19:51:40 -0000 1.39
@@ -43,6 +43,7 @@
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
/**
@@ -324,6 +325,28 @@
}
}
return fobjMaker;
+ }
+
+ /**
+ * org.xml.sax.ErrorHandler#warning
+ **/
+ public void warning(SAXParseException e) {
+ log.warn(e.toString());
+ }
+
+ /**
+ * org.xml.sax.ErrorHandler#error
+ **/
+ public void error(SAXParseException e) {
+ log.error(e.toString());
+ }
+
+ /**
+ * org.xml.sax.ErrorHandler#fatalError
+ **/
+ public void fatalError(SAXParseException e) throws SAXException {
+ log.error(e.toString());
+ throw e;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]