gmazza      2003/08/03 17:52:16

  Modified:    src/java/org/apache/fop/apps Driver.java FOInputHandler.java
                        InputHandler.java XSLTInputHandler.java
               src/java/org/apache/fop/image XMLImage.java
               src/java/org/apache/fop/svg SVGElementMapping.java
                        SVGUserAgent.java
  Log:
  1.) only partly implemented Run() function removed from InputHandler and its 
subclasses; Driver.Run(InputHandler) can be used instead; now all processing 
centralized in Driver class.
  2.) getParserClassName() moved from Driver to (to be renamed) FOInputHandler; now 
the same class that provides the parser provides its description.
  
  Revision  Changes    Path
  1.16      +0 -18     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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Driver.java       2 Aug 2003 21:26:53 -0000       1.15
  +++ Driver.java       4 Aug 2003 00:52:16 -0000       1.16
  @@ -76,8 +76,6 @@
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
   import org.xml.sax.XMLReader;
  -import javax.xml.parsers.ParserConfigurationException;
  -import javax.xml.parsers.SAXParserFactory;
   
   // Java
   import java.io.IOException;
  @@ -222,22 +220,6 @@
        */
       private Logger log = null;
       private FOUserAgent userAgent = null;
  -
  -    /**
  -     * Returns the fully qualified classname of the standard XML parser for FOP
  -     * to use.
  -     * @return the XML parser classname
  -     */
  -    public static final String getParserClassName() {
  -        try {
  -            return javax.xml.parsers.SAXParserFactory.newInstance()
  -                .newSAXParser().getXMLReader().getClass().getName();
  -        } catch (javax.xml.parsers.ParserConfigurationException e) {
  -            return null;
  -        } catch (org.xml.sax.SAXException e) {
  -            return null;
  -        }
  -    }
   
       /**
        * Main constructor for the Driver class.
  
  
  
  1.6       +12 -7     xml-fop/src/java/org/apache/fop/apps/FOInputHandler.java
  
  Index: FOInputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/FOInputHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FOInputHandler.java       2 Aug 2003 01:15:20 -0000       1.5
  +++ FOInputHandler.java       4 Aug 2003 00:52:16 -0000       1.6
  @@ -106,13 +106,6 @@
       }
   
       /**
  -     * @see org.apache.fop.apps.InputHandler#run(Driver)
  -     */
  -    public void run(Driver driver) throws FOPException {
  -        throw new FOPException("not implemented: FOInputHandler.run(Driver)");
  -    }
  -
  -    /**
        * Creates <code>XMLReader</code> object using default
        * <code>SAXParserFactory</code>
        * @return the created <code>XMLReader</code>
  @@ -136,5 +129,17 @@
           }
       }
   
  +    /**
  +     * Returns the fully qualified classname of the standard XML parser for FOP
  +     * to use.
  +     * @return the XML parser classname
  +     */
  +    public static final String getParserClassName() {
  +        try {
  +            return createParser().getClass().getName();
  +        } catch (FOPException e) {
  +            return null;
  +        }
  +    }
   }
   
  
  
  
  1.7       +0 -6      xml-fop/src/java/org/apache/fop/apps/InputHandler.java
  
  Index: InputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/InputHandler.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- InputHandler.java 2 Aug 2003 01:15:20 -0000       1.6
  +++ InputHandler.java 4 Aug 2003 00:52:16 -0000       1.7
  @@ -112,11 +112,5 @@
           }
       }
       
  -    /**
  -     * Runs this InputHandler through the Driver.
  -     * @param driver Driver instance to use
  -     * @throws FOPException if processing this InputHandler fails
  -     */
  -    public abstract void run(Driver driver) throws FOPException;
   }
   
  
  
  
  1.8       +0 -12     xml-fop/src/java/org/apache/fop/apps/XSLTInputHandler.java
  
  Index: XSLTInputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/XSLTInputHandler.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XSLTInputHandler.java     2 Aug 2003 01:15:20 -0000       1.7
  +++ XSLTInputHandler.java     4 Aug 2003 00:52:16 -0000       1.8
  @@ -192,18 +192,6 @@
       }
   
       /**
  -     * @see org.apache.fop.apps.InputHandler#run(Driver)
  -     */
  -    public void run(Driver driver) throws FOPException {
  -        try {
  -            transformer.transform(xmlSource,
  -                                  new SAXResult(driver.getContentHandler()));
  -        } catch (Exception ex) {
  -            throw new FOPException(ex);
  -        }
  -    }
  -
  -    /**
        * Sets an XSLT parameter.
        * @param name the name of the parameter
        * @param value the value of the parameter
  
  
  
  1.5       +2 -2      xml-fop/src/java/org/apache/fop/image/XMLImage.java
  
  Index: XMLImage.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/image/XMLImage.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XMLImage.java     17 Jun 2003 16:35:57 -0000      1.4
  +++ XMLImage.java     4 Aug 2003 00:52:16 -0000       1.5
  @@ -54,7 +54,7 @@
   import org.w3c.dom.Document;
   
   // FOP
  -import org.apache.fop.apps.Driver;
  +import org.apache.fop.apps.FOInputHandler;
   
   /**
    * This is an implementation for XML-based images such as SVG.
  @@ -86,7 +86,7 @@
        * @return the created SAX parser
        */
       public static String getParserName() {
  -        String parserClassName = Driver.getParserClassName();
  +        String parserClassName = FOInputHandler.getParserClassName();
           return parserClassName;
       }
   
  
  
  
  1.6       +2 -2      xml-fop/src/java/org/apache/fop/svg/SVGElementMapping.java
  
  Index: SVGElementMapping.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/SVGElementMapping.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SVGElementMapping.java    17 Jul 2003 17:31:29 -0000      1.5
  +++ SVGElementMapping.java    4 Aug 2003 00:52:16 -0000       1.6
  @@ -54,7 +54,7 @@
   
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.ElementMapping;
  -import org.apache.fop.apps.Driver;
  +import org.apache.fop.apps.FOInputHandler;
   
   import org.apache.batik.util.XMLResourceDescriptor;
   import org.apache.batik.dom.svg.SVGDOMImplementation;
  @@ -78,7 +78,7 @@
               // normally the user agent value is used
               try {
                   XMLResourceDescriptor.setXMLParserClassName(
  -                  Driver.getParserClassName());
  +                  FOInputHandler.getParserClassName());
       
                   foObjs = new HashMap();
                   foObjs.put("svg", new SE());
  
  
  
  1.5       +1 -1      xml-fop/src/java/org/apache/fop/svg/SVGUserAgent.java
  
  Index: SVGUserAgent.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/SVGUserAgent.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SVGUserAgent.java 17 Jun 2003 16:35:57 -0000      1.4
  +++ SVGUserAgent.java 4 Aug 2003 00:52:16 -0000       1.5
  @@ -158,7 +158,7 @@
        * @return the XML parser class name
        */
       public String getXMLParserClassName() {
  -        return org.apache.fop.apps.Driver.getParserClassName();
  +        return org.apache.fop.apps.FOInputHandler.getParserClassName();
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to