From 92305f8b1fc6cb805e1d76f3541cc48e9037266f Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Tue, 13 Jul 2004 05:25:26 +0000 Subject: [PATCH] PR: Obtained from: Submitted by: Reviewed by: 1. Removed Driver.setXMLReader(), this can be done via JAXP. 2. Moved the business logic for creating FOTreeBuilder's FOInputHandler object from Driver to FOTreeBuilder. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197785 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/apps/Driver.java | 83 ++++--------------- src/java/org/apache/fop/fo/FOTreeBuilder.java | 26 +++++- 2 files changed, 39 insertions(+), 70 deletions(-) diff --git a/src/java/org/apache/fop/apps/Driver.java b/src/java/org/apache/fop/apps/Driver.java index c0fa632af..2a765c74e 100644 --- a/src/java/org/apache/fop/apps/Driver.java +++ b/src/java/org/apache/fop/apps/Driver.java @@ -27,17 +27,12 @@ import org.xml.sax.ContentHandler; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; -import org.w3c.dom.Document; // FOP import org.apache.fop.fo.Constants; import org.apache.fop.fo.ElementMapping; import org.apache.fop.fo.FOTreeBuilder; -import org.apache.fop.fo.FOInputHandler; -import org.apache.fop.area.AreaTreeHandler; import org.apache.fop.render.awt.AWTRenderer; -import org.apache.fop.render.mif.MIFHandler; -import org.apache.fop.render.rtf.RTFHandler; /** * Primary class that drives overall FOP process. @@ -94,14 +89,9 @@ public class Driver implements Constants { private FOTreeBuilder treeBuilder; /** - * the renderer type code given by setRenderer + * the render type code given by setRender */ - private int rendererType = NOT_SET; - - /** - * the SAX ContentHandler - */ - private FOInputHandler foInputHandler; + private int renderType = NOT_SET; /** * the source of the FO file @@ -113,11 +103,6 @@ public class Driver implements Constants { */ private OutputStream stream; - /** - * The XML parser to use when building the FO tree - */ - private XMLReader reader; - /** * The system resources that FOP will use */ @@ -134,10 +119,10 @@ public class Driver implements Constants { * Constructor for AWTRenderer, which reuses the * same renderer instance for document reloading */ - public Driver(AWTRenderer renderer) { + public Driver(AWTRenderer render) { this(); - rendererType = RENDER_AWT; - foUserAgent = renderer.getUserAgent(); + renderType = RENDER_AWT; + foUserAgent = render.getUserAgent(); } /** @@ -176,7 +161,6 @@ public class Driver implements Constants { public synchronized void reset() { source = null; stream = null; - reader = null; if (treeBuilder != null) { treeBuilder.reset(); } @@ -207,7 +191,7 @@ public class Driver implements Constants { } /** - * Set the OutputStream to use to output the result of the Renderer + * Set the OutputStream to use to output the result of the Render * (if applicable) * @param stream the stream to output the result of rendering to */ @@ -230,15 +214,6 @@ public class Driver implements Constants { this.source = source; } - /** - * Sets the reader used when reading in the source. If not set, - * this defaults to a basic SAX parser. - * @param reader the reader to use. - */ - public void setXMLReader(XMLReader reader) { - this.reader = reader; - } - /** * Method to set the rendering type desired. Must be one of *