From 333b61994a635ba451b5ffbd73a6eaafdca5fdab Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Wed, 14 Jul 2004 23:01:56 +0000 Subject: [PATCH] Removed the Driver.run() method in favor of JAXP. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197790 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/apps/Driver.java | 65 ++----------------- .../apache/fop/servlet/FopPrintServlet.java | 20 ++++-- .../org/apache/fop/BasicDriverTestCase.java | 32 --------- 3 files changed, 21 insertions(+), 96 deletions(-) diff --git a/src/java/org/apache/fop/apps/Driver.java b/src/java/org/apache/fop/apps/Driver.java index 2a765c74e..97715b25a 100644 --- a/src/java/org/apache/fop/apps/Driver.java +++ b/src/java/org/apache/fop/apps/Driver.java @@ -37,18 +37,11 @@ import org.apache.fop.render.awt.AWTRenderer; /** * Primary class that drives overall FOP process. *

- * The simplest way to use this is to instantiate it with the - * InputSource and OutputStream, then set the renderer desired, and - * calling run(); + * JAXP is the standard method of embedding FOP in Java programs. + * Please check our embedding page (http://xml.apache.org/fop/embedding.html) + * for samples (these are also available within the distribution in + * FOP_DIR\examples\embedding) *

- * Here is an example use of Driver which outputs PDF: - * - *

- * Driver driver = new Driver(new InputSource (args[0]),
- * new FileOutputStream(args[1]));
- * driver.setRenderer(RENDER_PDF);
- * driver.run();
- * 
* If necessary, calling classes can call into the lower level * methods to setup and * render. Methods within FOUserAgent can be called to set the @@ -64,15 +57,6 @@ import org.apache.fop.render.awt.AWTRenderer; * is called. The invocation of the method is * render(Parser, InputSource). *

- * A third possibility may be used to build the FO Tree, namely - * calling getContentHandler() and firing the SAX events yourself. - * This will work either for DOM Tree input or SAX. See the embed - * examples on the FOP web page for more details or in the - * examples\embedding directory of the main distribution for more details. - *

- * Once the FO Tree is built, the format() and render() methods may be - * called in that order. - *

* Here is an example use of Driver which outputs to AWT: * *

@@ -93,11 +77,6 @@ public class Driver implements Constants {
      */
     private int renderType = NOT_SET;
 
-    /**
-     * the source of the FO file
-     */
-    private InputSource source;
-
     /**
      * the stream to use to output the results of the renderer
      */
@@ -130,9 +109,8 @@ public class Driver implements Constants {
      * @param source InputSource to take the XSL-FO input from
      * @param stream Target output stream
      */
-    public Driver(InputSource source, OutputStream stream) {
+    public Driver(OutputStream stream) {
         this();
-        this.source = source;
         this.stream = stream;
     }
 
@@ -159,7 +137,6 @@ public class Driver implements Constants {
      * The output stream is cleared. The renderer is cleared.
      */
     public synchronized void reset() {
-        source = null;
         stream = null;
         if (treeBuilder != null) {
             treeBuilder.reset();
@@ -205,15 +182,6 @@ public class Driver implements Constants {
         }
     }
 
-    /**
-     * Set the source for the FO document. This can be a normal SAX
-     * InputSource, or an DocumentInputSource containing a DOM document.
-     * @see DocumentInputSource
-     */
-    public void setInputSource(InputSource source) {
-        this.source = source;
-    }
-
     /**
      * Method to set the rendering type desired. Must be one of
      *