jeremias    2003/02/27 02:13:08

  Modified:    src/org/apache/fop/apps TraxInputHandler.java
                        XSLTInputHandler.java AWTStarter.java
                        FOInputHandler.java CommandLineOptions.java
                        InputHandler.java Version.java PrintStarter.java
                        Fop.java LayoutHandler.java CommandLineStarter.java
                        Driver.java FOPException.java Starter.java
                        StructureHandler.java
  Removed:     src/org/apache/fop/apps ErrorHandler.java
  Log:
  Switched to long licence
  Some general checkstyle fixing
  Removed unused ErrorHandler (readd when we know what to do with it)
  
  Revision  Changes    Path
  1.6       +72 -28    xml-fop/src/org/apache/fop/apps/TraxInputHandler.java
  
  Index: TraxInputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/TraxInputHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TraxInputHandler.java     21 Aug 2001 06:18:54 -0000      1.5
  +++ TraxInputHandler.java     27 Feb 2003 10:13:04 -0000      1.6
  @@ -1,12 +1,57 @@
   /*
    * $Id$
  - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
  +// Imported java.io classes
  +import java.io.File;
   
   // Imported TraX classes
   import javax.xml.transform.TransformerFactory;
  @@ -15,44 +60,40 @@
   import javax.xml.transform.sax.SAXSource;
   import javax.xml.transform.sax.SAXTransformerFactory;
   
  -
   // Imported SAX classes
   import org.xml.sax.InputSource;
  -import org.xml.sax.SAXException;
   import org.xml.sax.XMLReader;
   import org.xml.sax.XMLFilter;
   
  -
  -
  -// Imported java.io classes
  -import java.io.InputStream;
  -import java.io.IOException;
  -import java.io.File;
  -
   /**
  - * XSLTInputHandler basically takes an xmlfile and transforms it with an xsltfile
  - * and the resulting xsl:fo document is input for Fop.
  + * XSLTInputHandler basically takes an XML file and transforms it with an 
  + * XSLT file and the resulting XSL-FO document is input for FOP.
    */
   public class TraxInputHandler extends InputHandler {
   
  -    File xmlfile, xsltfile;
  +    private File xmlfile, xsltfile;
   
  +    /**
  +     * Main constructor
  +     * @param xmlfile XML file 
  +     * @param xsltfile XSLT file
  +     */
       public TraxInputHandler(File xmlfile, File xsltfile) {
           this.xmlfile = xmlfile;
           this.xsltfile = xsltfile;
       }
   
       /**
  -     * overwrites the method of the super class to return the xmlfile
  +     * @see org.apache.fop.apps.InputHandler#getInputSource()
        */
       public InputSource getInputSource() {
           return fileInputSource(xmlfile);
       }
   
       /**
  -     * overwrites this method of the super class and returns an XMLFilter instead 
of a
  -     * simple XMLReader which allows chaining of transformations
  -     *
  +     * Overwrites this method of the super class and returns an XMLFilter 
  +     * instead of a simple XMLReader which allows chaining of transformations.
  +     * @see org.apache.fop.apps.InputHandler#getParser()
        */
       public XMLReader getParser() throws FOPException {
           return this.getXMLFilter(xmlfile, xsltfile);
  @@ -65,7 +106,9 @@
        * data is fed into Fop. This should help to avoid memory problems
        * @param xmlfile The xmlfile containing the text data
        * @param xsltfile An xslt stylesheet
  -     * @return XMLFilter an XMLFilter which can be chained together with other 
XMLReaders or XMLFilters
  +     * @return an XMLFilter which can be chained together with other 
  +     * XMLReaders or XMLFilters
  +     * @throws FOPException if setting up the XMLFilter fails
        */
       public static XMLFilter getXMLFilter(File xmlfile,
                                            File xsltfile) throws FOPException {
  @@ -93,13 +136,14 @@
                   xmlfilter.setParent(parser);
                   return xmlfilter;
               } else {
  -                throw new FOPException("Your parser doesn't support the features 
SAXSource and SAXResult."
  -                                       + "\nMake sure you are using a xsl parser 
which supports TrAX");
  +                throw new FOPException("Your parser doesn't support the "
  +                        + "features SAXSource and SAXResult."
  +                        + "\nMake sure you are using an XSLT engine which "
  +                        + "supports TrAX");
               }
  +        } catch (FOPException fe) {
  +            throw fe;
           } catch (Exception ex) {
  -            if (ex instanceof FOPException) {
  -                throw (FOPException)ex;
  -            }
               throw new FOPException(ex);
           }
       }
  
  
  
  1.10      +76 -29    xml-fop/src/org/apache/fop/apps/XSLTInputHandler.java
  
  Index: XSLTInputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/XSLTInputHandler.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XSLTInputHandler.java     19 Apr 2002 08:02:52 -0000      1.9
  +++ XSLTInputHandler.java     27 Feb 2003 10:13:05 -0000      1.10
  @@ -1,51 +1,95 @@
   /*
    * $Id$
  - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
  -import java.lang.reflect.*;
  -
  +// Imported java.io classes
  +import java.io.File;
  +import java.lang.reflect.InvocationTargetException;
  +import java.lang.reflect.Method;
   
   // Imported SAX classes
   import org.xml.sax.InputSource;
  -import org.xml.sax.SAXException;
   import org.xml.sax.XMLReader;
   
  -// Imported java.io classes
  -import java.io.*;
  -
   // FOP
   import org.apache.fop.tools.xslt.XSLTransform;
   
  -/*
  -add url constructer
  -*/
  -
   /**
  - * XSLTInputHandler basically takes an xmlfile and transforms it with an xsltfile
  - * and the resulting xsl:fo document is input for Fop.
  + * XSLTInputHandler basically takes an XML file and transforms it with an XSLT
  + * file and the resulting XSL-FO document is input for FOP.
  + * @todo add URL constructor
    */
   public class XSLTInputHandler extends InputHandler {
   
  -    File xmlfile, xsltfile;
  -    boolean useOldTransform = false;
  -    boolean gotParser = false;
  +    private File xmlfile, xsltfile;
  +    private boolean useOldTransform = false;
  +    private boolean gotParser = false;
   
  +    /**
  +     * Main constructor
  +     * @param xmlfile XML file
  +     * @param xsltfile XSLT file
  +     */
       public XSLTInputHandler(File xmlfile, File xsltfile) {
           this.xmlfile = xmlfile;
           this.xsltfile = xsltfile;
       }
   
       /**
  -     * overwrites the method of the super class to return the xmlfile
  +     * @see org.apache.fop.apps.InputHandler#getInputSource()
        */
       public InputSource getInputSource() {
  -        if(!gotParser) {
  -            throw new IllegalStateException("The method getParser() must be called 
and the parser used when using XSLTInputHandler");
  +        if (!gotParser) {
  +            throw new IllegalStateException("The method getParser() must be "
  +                    + "called and the parser used when using XSLTInputHandler");
           }
           if (useOldTransform) {
               try {
  @@ -58,9 +102,9 @@
                   // if xml file size is larger than 500 kb write the fo:file to disk
                   if ((xmlfile.length()) > 500000) {
                       tmpFile = new File(xmlfile.getName() + ".fo.tmp");
  -                    writer = new FileWriter(tmpFile);
  +                    writer = new java.io.FileWriter(tmpFile);
                   } else {
  -                    writer = new StringWriter();
  +                    writer = new java.io.StringWriter();
                   }
   
                   XSLTransform.transform(xmlfile.getCanonicalPath(),
  @@ -70,14 +114,15 @@
                   writer.close();
   
                   if (tmpFile != null) {
  -                    reader = new FileReader(tmpFile);
  +                    reader = new java.io.FileReader(tmpFile);
                   } else {
                       // create a input source containing the xsl:fo file which can 
be fed to Fop
  -                    reader = new StringReader(writer.toString());
  +                    reader = new java.io.StringReader(writer.toString());
                   }
                   return new InputSource(reader);
               } catch (Exception ex) {
                   ex.printStackTrace();
  +                /[EMAIL PROTECTED] do proper logging of exceptions */
                   return null;
               }
           } else {
  @@ -89,7 +134,9 @@
       /**
        * This looks to see if the Trax api is supported and uses that to
        * get an XMLFilter. Otherwise, it falls back to using DOM documents
  -     *
  +     * @return the created <code>XMLReader</code>
  +     * @throws FOPException if getting the parser fails
  +     * @see org.apache.fop.apps.InputHandler#getParser()
        */
       public XMLReader getParser() throws FOPException {
           gotParser = true;
  
  
  
  1.18      +49 -6     xml-fop/src/org/apache/fop/apps/AWTStarter.java
  
  Index: AWTStarter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/AWTStarter.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- AWTStarter.java   13 Jan 2003 21:05:12 -0000      1.17
  +++ AWTStarter.java   27 Feb 2003 10:13:05 -0000      1.18
  @@ -1,10 +1,53 @@
   /*
    * $Id$
  - * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
   //FOP
  
  
  
  1.9       +61 -17    xml-fop/src/org/apache/fop/apps/FOInputHandler.java
  
  Index: FOInputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/FOInputHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FOInputHandler.java       13 Jan 2003 21:05:12 -0000      1.8
  +++ FOInputHandler.java       27 Feb 2003 10:13:06 -0000      1.9
  @@ -1,10 +1,53 @@
   /*
    * $Id$
  - * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
   // Imported SAX classes
  @@ -16,31 +59,32 @@
   import java.net.URL;
   
   /**
  - * Manages input if it is an xsl:fo file
  + * Manages input if it is an XSL-FO file.
    */
   public class FOInputHandler extends InputHandler {
  +    
       private File fofile = null;
       private URL foURL = null;
   
  -    /*
  +    /**
        * Create a FOInputHandler for a file.
  -     * @param file the file to read the FO document.
  +     * @param fofile the file to read the FO document.
        */
  -    public FOInputHandler (File fofile) {
  +    public FOInputHandler(File fofile) {
           this.fofile = fofile;
       }
   
  -    /*
  +    /**
        * Create a FOInputHandler for an URL.
  -     * @param file the URL to read the FO document.
  +     * @param url the URL to read the FO document.
        */
  -    public FOInputHandler (URL url) {
  +    public FOInputHandler(URL url) {
           this.foURL = url;
       }
   
       
  -    /*
  -     * Get the input source associated with this input handler.
  +    /**
  +     * @see org.apache.fop.apps.InputHandler#getInputSource()
        */
       public InputSource getInputSource () {
           if (fofile != null) {
  @@ -49,8 +93,8 @@
           return super.urlInputSource(foURL);
       }
   
  -    /*
  -     * Get the SAX parser associated with this input handler.
  +    /**
  +     * @see org.apache.fop.apps.InputHandler#getParser()
        */
       public XMLReader getParser() throws FOPException {
           return super.createParser();
  
  
  
  1.22      +140 -44   xml-fop/src/org/apache/fop/apps/CommandLineOptions.java
  
  Index: CommandLineOptions.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/CommandLineOptions.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- CommandLineOptions.java   13 Jan 2003 21:05:12 -0000      1.21
  +++ CommandLineOptions.java   27 Feb 2003 10:13:06 -0000      1.22
  @@ -1,10 +1,53 @@
   /*
    * $Id$
  - * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
   // java
  @@ -111,7 +154,8 @@
   
       /**
        * parses the commandline arguments
  -     * @return true if parse was successful and processing can continue, false if 
processing should stop
  +     * @return true if parse was successful and processing can continue, false 
  +     * if processing should stop
        * @exception FOPException if there was an error in the format of the options
        */
       private boolean parseOptions(String args[]) throws FOPException {
  @@ -127,7 +171,8 @@
               } else if (args[i].equals("-c")) {
                   if ((i + 1 == args.length)
                           || (args[i + 1].charAt(0) == '-')) {
  -                    throw new FOPException("if you use '-c', you must specify the 
name of the configuration file");
  +                    throw new FOPException("if you use '-c', you must specify "
  +                            + "the name of the configuration file");
                   } else {
                       userConfigFile = new File(args[i + 1]);
                       i++;
  @@ -155,7 +200,8 @@
                   inputmode = XSLT_INPUT;
                   if ((i + 1 == args.length)
                           || (args[i + 1].charAt(0) == '-')) {
  -                    throw new FOPException("you must specify the stylesheet file 
for the '-xsl' option");
  +                    throw new FOPException("you must specify the stylesheet "
  +                            + "file for the '-xsl' option");
                   } else {
                       xsltfile = new File(args[i + 1]);
                       i++;
  @@ -164,7 +210,8 @@
                   inputmode = XSLT_INPUT;
                   if ((i + 1 == args.length)
                           || (args[i + 1].charAt(0) == '-')) {
  -                    throw new FOPException("you must specify the input file for the 
'-xml' option");
  +                    throw new FOPException("you must specify the input file "
  +                            + "for the '-xml' option");
                   } else {
                       xmlfile = new File(args[i + 1]);
                       i++;
  @@ -238,7 +285,8 @@
                   setOutputMode(SVG_OUTPUT);
                   if ((i + 1 == args.length)
                           || (args[i + 1].charAt(0) == '-')) {
  -                    throw new FOPException("you must specify the svg output file"); 
               } else {
  +                    throw new FOPException("you must specify the svg output file");
  +                } else {
                       outfile = new File(args[i + 1]);
                       i++;
                   }
  @@ -395,6 +443,7 @@
       /**
        * Get the starter for the process.
        * @return the starter.
  +     * @throws FOPException In case of failure while getting the starter
        */
       public Starter getStarter() throws FOPException {
           Starter starter = null;
  @@ -424,51 +473,96 @@
           return starter;
       }
   
  +    /**
  +     * Returns the input mode (type of input data, ex. NOT_SET or FO_INPUT)
  +     * @return the input mode
  +     */
       public int getInputMode() {
           return inputmode;
       }
   
  +    /**
  +     * Returns the output mode (output format, ex. NOT_SET or PDF_OUTPUT)
  +     * @return the output mode
  +     */
       public int getOutputMode() {
           return outputmode;
       }
   
  +    /**
  +     * Returns the XSL-FO file if set.
  +     * @return the XSL-FO file, null if not set
  +     */
       public File getFOFile() {
           return fofile;
       }
   
  +    /**
  +     * Returns the input XML file if set.
  +     * @return the input XML file, null if not set
  +     */
       public File getXMLFile() {
           return xmlfile;
       }
   
  +    /**
  +     * Returns the stylesheet to be used for transformation to XSL-FO.
  +     * @return stylesheet
  +     */
       public File getXSLFile() {
           return xsltfile;
       }
   
  +    /**
  +     * Returns the output file
  +     * @return the output file
  +     */
       public File getOutputFile() {
           return outfile;
       }
   
  +    /**
  +     * Returns the user configuration file to be used.
  +     * @return the userconfig.xml file
  +     */
       public File getUserConfigFile() {
           return userConfigFile;
       }
   
  +    /**
  +     * Returns the default language
  +     * @return the default language
  +     */
       public String getLanguage() {
           return language;
       }
   
  +    /**
  +     * Indicates if FOP should be silent.
  +     * @return true if should be silent
  +     */
       public Boolean isQuiet() {
           return quiet;
       }
   
  +    /**
  +     * Indicates if FOP should dump its configuration during runtime.
  +     * @return true if config dump is enabled
  +     */
       public Boolean dumpConfiguration() {
           return dumpConfiguration;
       }
   
  +    /**
  +     * Indicates whether the XML renderer should generate course area XML
  +     * @return true if coarse area XML is desired
  +     */
       public Boolean isCoarseAreaXml() {
           return suppressLowLevelAreas;
       }
   
       /**
  +     * Returns the input file.
        * @return either the fofile or the xmlfile
        */
       public File getInputFile() {
  @@ -486,39 +580,41 @@
        * shows the commandline syntax including a summary of all available options 
and some examples
        */
       public static void printUsage() {
  -        System.err.println("\nUSAGE\nFop [options] [-fo|-xml] infile [-xsl file] 
[-awt|-pdf|-mif|-rtf|-pcl|-ps|-txt|-at|-print] <outfile>\n"
  -                           + " [OPTIONS]  \n"
  -                           + "  -d          debug mode   \n"
  -                           + "  -x          dump configuration settings  \n"
  -                           + "  -q          quiet mode  \n"
  -                           + "  -c cfg.xml  use additional configuration file 
cfg.xml\n"
  -                           + "  -l lang     the language to use for user 
information \n"
  -                           + "  -s          for area tree XML, down to block areas 
only\n\n"
  -                           + " [INPUT]  \n"
  -                           + "  infile            xsl:fo input file (the same as 
the next) \n"
  -                           + "  -fo  infile       xsl:fo input file  \n"
  -                           + "  -xml infile       xml input file, must be used 
together with -xsl \n"
  -                           + "  -xsl stylesheet   xslt stylesheet \n \n"
  -                           + " [OUTPUT] \n"
  -                           + "  outfile           input will be rendered as pdf 
file into outfile \n"
  -                           + "  -pdf outfile      input will be rendered as pdf 
file (outfile req'd) \n"
  -                           + "  -awt              input will be displayed on screen 
\n"
  -                           + "  -mif outfile      input will be rendered as mif 
file (outfile req'd)\n"
  -                           + "  -rtf outfile      input will be rendered as rtf 
file (outfile req'd)\n"
  -                           + "  -pcl outfile      input will be rendered as pcl 
file (outfile req'd) \n"
  -                           + "  -ps outfile       input will be rendered as 
PostScript file (outfile req'd) \n"
  -                           + "  -txt outfile      input will be rendered as text 
file (outfile req'd) \n"
  -                           + "  -svg outfile      input will be rendered as an svg 
slides file (outfile req'd) \n"
  -                           + "  -at outfile       representation of area tree as 
XML (outfile req'd) \n"
  -                           + "  -print            input file will be rendered and 
sent to the printer \n"
  -                           + "                    see options with \"-print help\" 
\n\n"
  -                           + " [Examples]\n" + "  Fop foo.fo foo.pdf \n"
  -                           + "  Fop -fo foo.fo -pdf foo.pdf (does the same as the 
previous line)\n"
  -                           + "  Fop -xsl foo.xsl -xml foo.xml -pdf foo.pdf\n"
  -                           + "  Fop foo.fo -mif foo.mif\n"
  -                           + "  Fop foo.fo -rtf foo.rtf\n"
  -                           + "  Fop foo.fo -print or Fop -print foo.fo \n"
  -                           + "  Fop foo.fo -awt \n");
  +        System.err.println(
  +              "\nUSAGE\nFop [options] [-fo|-xml] infile [-xsl file] "
  +                    + "[-awt|-pdf|-mif|-rtf|-pcl|-ps|-txt|-at|-print] <outfile>\n"
  +            + " [OPTIONS]  \n"
  +            + "  -d          debug mode   \n"
  +            + "  -x          dump configuration settings  \n"
  +            + "  -q          quiet mode  \n"
  +            + "  -c cfg.xml  use additional configuration file cfg.xml\n"
  +            + "  -l lang     the language to use for user information \n"
  +            + "  -s          for area tree XML, down to block areas only\n\n"
  +            + " [INPUT]  \n"
  +            + "  infile            xsl:fo input file (the same as the next) \n"
  +            + "  -fo  infile       xsl:fo input file  \n"
  +            + "  -xml infile       xml input file, must be used together with -xsl 
\n"
  +            + "  -xsl stylesheet   xslt stylesheet \n \n"
  +            + " [OUTPUT] \n"
  +            + "  outfile           input will be rendered as pdf file into outfile 
\n"
  +            + "  -pdf outfile      input will be rendered as pdf file (outfile 
req'd) \n"
  +            + "  -awt              input will be displayed on screen \n"
  +            + "  -mif outfile      input will be rendered as mif file (outfile 
req'd)\n"
  +            + "  -rtf outfile      input will be rendered as rtf file (outfile 
req'd)\n"
  +            + "  -pcl outfile      input will be rendered as pcl file (outfile 
req'd) \n"
  +            + "  -ps outfile       input will be rendered as PostScript file 
(outfile req'd) \n"
  +            + "  -txt outfile      input will be rendered as text file (outfile 
req'd) \n"
  +            + "  -svg outfile      input will be rendered as an svg slides file 
(outfile req'd) \n"
  +            + "  -at outfile       representation of area tree as XML (outfile 
req'd) \n"
  +            + "  -print            input file will be rendered and sent to the 
printer \n"
  +            + "                    see options with \"-print help\" \n\n"
  +            + " [Examples]\n" + "  Fop foo.fo foo.pdf \n"
  +            + "  Fop -fo foo.fo -pdf foo.pdf (does the same as the previous line)\n"
  +            + "  Fop -xsl foo.xsl -xml foo.xml -pdf foo.pdf\n"
  +            + "  Fop foo.fo -mif foo.mif\n"
  +            + "  Fop foo.fo -rtf foo.rtf\n"
  +            + "  Fop foo.fo -print or Fop -print foo.fo \n"
  +            + "  Fop foo.fo -awt \n");
       }
       
       /**
  
  
  
  1.11      +65 -7     xml-fop/src/org/apache/fop/apps/InputHandler.java
  
  Index: InputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/InputHandler.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- InputHandler.java 13 Jan 2003 21:05:12 -0000      1.10
  +++ InputHandler.java 27 Feb 2003 10:13:06 -0000      1.11
  @@ -1,10 +1,53 @@
   /*
    * $Id$
  - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
   // SAX
  @@ -18,16 +61,31 @@
   import java.net.URL;
   import java.io.File;
   
  -/*
  +/**
    * Abstract super class for input handlers.
    * Should be used to abstract the various possibilities on how input
    * can be provided to FOP (but actually isn't).
    */
   public abstract class InputHandler {
   
  +    /**
  +     * Get the input source associated with this input handler.
  +     * @return the input source
  +     */
       public abstract InputSource getInputSource();
  +
  +    /**
  +     * Get the SAX parser associated with this input handler.
  +     * @return the SAX parser
  +     * @throws FOPException in case of an error determining the SAX parser
  +     */
       public abstract XMLReader getParser() throws FOPException;
   
  +    /**
  +     * Creates an InputSource from a URL.
  +     * @param url URL to use
  +     * @return the newly created InputSource
  +     */
       public static InputSource urlInputSource(URL url) {
           return new InputSource(url.toString());
       }
  
  
  
  1.18      +51 -8     xml-fop/src/org/apache/fop/apps/Version.java
  
  Index: Version.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/Version.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Version.java      4 Sep 2002 08:36:35 -0000       1.17
  +++ Version.java      27 Feb 2003 10:13:06 -0000      1.18
  @@ -1,19 +1,62 @@
   /*
    * $Id$
  - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources."
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
   /**
  - * class representing the version of FOP.
  + * Class representing the version of FOP.
    */
   public class Version {
   
       /**
  -     * get the version of FOP
  +     * Get the version of FOP
        *
        * @return the version string
        */
  
  
  
  1.14      +62 -20    xml-fop/src/org/apache/fop/apps/PrintStarter.java
  
  Index: PrintStarter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/PrintStarter.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- PrintStarter.java 29 Nov 2002 23:18:52 -0000      1.13
  +++ PrintStarter.java 27 Feb 2003 10:13:06 -0000      1.14
  @@ -1,10 +1,53 @@
   /*
    * $Id$
  - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
   /*
  @@ -20,12 +63,9 @@
   
   
   import org.xml.sax.XMLReader;
  -import org.xml.sax.InputSource;
  -import org.xml.sax.SAXException;
  -import org.xml.sax.SAXParseException;
   
  -import java.awt.Graphics;
  -import java.awt.print.*;
  +import java.awt.print.PrinterException;
  +import java.awt.print.PrinterJob;
   import java.io.OutputStream;
   import java.io.IOException;
   import java.util.Vector;
  @@ -33,7 +73,7 @@
   import org.apache.fop.render.awt.AWTRenderer;
   
   /**
  - * This class prints a xsl-fo dokument without interaction.
  + * This class prints a XSL-FO dokument without interaction.
    * At the moment java has not the possibility to configure the printer and it's
    * options without interaction (30.03.2000).
    * This class allows to print a set of pages (from-to), even/odd pages and many 
copies.
  @@ -41,14 +81,19 @@
    * - Print to page xxx: property name - end, value int
    * - Print even/odd pages: property name - even, value boolean
    * - Print xxx copies: property name - copies, value int
  - *
    */
   public class PrintStarter extends CommandLineStarter {
   
  +    /**
  +     * @see 
org.apache.fop.apps.CommandLineStarter#CommandLineStarter(CommandLineOptions)
  +     */
       public PrintStarter(CommandLineOptions options) throws FOPException {
           super(options);
       }
   
  +    /**
  +     * @see org.apache.fop.apps.Starter#run()
  +     */
       public void run() throws FOPException {
           Driver driver = new Driver();
   
  @@ -121,10 +166,7 @@
               mode = EVEN_AND_ALL;
               String str = System.getProperty("even");
               if (str != null) {
  -                try {
  -                    mode = Boolean.valueOf(str).booleanValue() ? EVEN : ODD;
  -                } catch (Exception e) {}
  -
  +                mode = Boolean.valueOf(str).booleanValue() ? EVEN : ODD;
               }
   
           }
  @@ -146,9 +188,9 @@
                   printerJob.print();
               } catch (PrinterException e) {
                   e.printStackTrace();
  -                throw new IOException(
  -                    "Unable to print: " + e.getClass().getName() +
  -                    ": " + e.getMessage());
  +                throw new IOException("Unable to print: " 
  +                    + e.getClass().getName()
  +                    + ": " + e.getMessage());
               }
           }
   
  
  
  
  1.15      +52 -9     xml-fop/src/org/apache/fop/apps/Fop.java
  
  Index: Fop.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/Fop.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Fop.java  13 Jan 2003 21:05:12 -0000      1.14
  +++ Fop.java  27 Feb 2003 10:13:06 -0000      1.15
  @@ -1,18 +1,61 @@
   /*
    * $Id$
  - * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
  -/*
  +/**
    * The main application class for the FOP command line interface (CLI).
    */
   public class Fop {
   
  -    /*
  +    /**
        * The main routine for the command line interface
        * @param args the command line parameters
        */
  @@ -24,7 +67,7 @@
               Starter starter = options.getStarter();
               starter.run();
           } catch (FOPException e) {
  -            if (e.getMessage()==null) {
  +            if (e.getMessage() == null) {
                   System.err.println("Exception occured with a null error message");
               } else {
                   System.err.println("" + e.getMessage());
  
  
  
  1.12      +73 -24    xml-fop/src/org/apache/fop/apps/LayoutHandler.java
  
  Index: LayoutHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/LayoutHandler.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- LayoutHandler.java        13 Jan 2003 21:05:12 -0000      1.11
  +++ LayoutHandler.java        27 Feb 2003 10:13:06 -0000      1.12
  @@ -1,10 +1,53 @@
   /*
    * $Id$
  - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
   // Java
  @@ -35,44 +78,44 @@
   
       // TODO: Collecting of statistics should be configurable
       private final boolean collectStatistics = true;
  -    private final boolean MEM_PROFILE_WITH_GC = false;
  +    private static final boolean MEM_PROFILE_WITH_GC = false;
   
       /**
  -      Somewhere to get our stats from.
  +     * Somewhere to get our stats from.
        */
       private Runtime runtime;
   
       /**
  -      Keep track of the number of pages rendered.
  +     * Keep track of the number of pages rendered.
        */
       private int pageCount;
   
       /**
  -      Keep track of heap memory allocated,
  -      for statistical purposes.
  +     * Keep track of heap memory allocated,
  +     * for statistical purposes.
        */
       private long initialMemory;
   
       /**
  -      Keep track of time used by renderer.
  +     * Keep track of time used by renderer.
        */
       private long startTime;
   
       /**
  -      The stream to which this rendering is to be
  -      written to. <B>Note</B> that some renderers
  -      do not render to a stream, and that this
  -      member can therefore be null.
  +     * The stream to which this rendering is to be
  +     * written to. <B>Note</B> that some renderers
  +     * do not render to a stream, and that this
  +     * member can therefore be null.
        */
       private OutputStream outputStream;
   
       /**
  -      The renderer being used.
  +     * The renderer being used.
        */
       private Renderer renderer;
   
       /**
  -      The FontInfo for this renderer.
  +     * The FontInfo for this renderer.
        */
       private FontInfo fontInfo = new FontInfo();
   
  @@ -83,6 +126,7 @@
       private AreaTreeModel atModel;
   
       /**
  +     * Main constructor
        * @param outputStream the stream that the result is rendered to
        * @param renderer the renderer to call
        * @param store if true then use the store pages model and keep the
  @@ -90,8 +134,9 @@
        */
       public LayoutHandler(OutputStream outputStream, Renderer renderer,
                            boolean store) {
  -        if (collectStatistics)
  +        if (collectStatistics) {
               runtime = Runtime.getRuntime();
  +        }
           this.outputStream = outputStream;
           this.renderer = renderer;
   
  @@ -123,14 +168,16 @@
               if (MEM_PROFILE_WITH_GC) {
                   System.gc(); // This takes time but gives better results
               }
  +            
               initialMemory = runtime.totalMemory() - runtime.freeMemory();
               startTime = System.currentTimeMillis();
           }
           try {
               renderer.setupFontInfo(fontInfo);
               // check that the "any,normal,400" font exists
  -            if(!fontInfo.isSetupValid()) {
  -                throw new SAXException(new FOPException("no default font defined by 
OutputConverter"));
  +            if (!fontInfo.isSetupValid()) {
  +                throw new SAXException(new FOPException(
  +                        "No default font defined by OutputConverter"));
               }
               renderer.startRenderer(outputStream);
           } catch (IOException e) {
  @@ -186,7 +233,9 @@
        * @param seqTitle the title of the page sequence
        * @param lms the layout master set
        */
  -    public void startPageSequence(PageSequence pageSeq, org.apache.fop.fo.Title 
seqTitle, LayoutMasterSet lms) {
  +    public void startPageSequence(PageSequence pageSeq, 
  +                                  org.apache.fop.fo.Title seqTitle, 
  +                                  LayoutMasterSet lms) {
           Title title = null;
           if (seqTitle != null) {
               title = seqTitle.getTitleArea();
  @@ -203,7 +252,7 @@
        * @throws FOPException if there is an error formatting the pages
        */
       public void endPageSequence(PageSequence pageSequence)
  -    throws FOPException {
  +                throws FOPException {
           //areaTree.setFontInfo(fontInfo);
   
           if (collectStatistics) {
  @@ -245,7 +294,7 @@
               count++;
           }
           List list = model.getEndExtensions();
  -        for(count = 0; count < list.size(); count++) {
  +        for (count = 0; count < list.size(); count++) {
               TreeExt ext = (TreeExt)list.get(count);
               renderer.renderExtension(ext);
           }
  
  
  
  1.22      +56 -7     xml-fop/src/org/apache/fop/apps/CommandLineStarter.java
  
  Index: CommandLineStarter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/CommandLineStarter.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- CommandLineStarter.java   27 Jan 2003 09:25:19 -0000      1.21
  +++ CommandLineStarter.java   27 Feb 2003 10:13:06 -0000      1.22
  @@ -1,10 +1,53 @@
   /*
    * $Id$
  - * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
   // SAX
  @@ -22,10 +65,16 @@
    */
   public class CommandLineStarter extends Starter {
   
  +    /** the command-line options associated with this starter */
       protected CommandLineOptions commandLineOptions;
   
  +    /**
  +     * Main constructor
  +     * @param commandLineOptions command-line options to use
  +     * @throws FOPException In case of failure
  +     */
       public CommandLineStarter(CommandLineOptions commandLineOptions)
  -    throws FOPException {
  +                throws FOPException {
           this.commandLineOptions = commandLineOptions;
           super.setInputHandler(commandLineOptions.getInputHandler());
       }
  
  
  
  1.60      +121 -33   xml-fop/src/org/apache/fop/apps/Driver.java
  
  Index: Driver.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/Driver.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- Driver.java       13 Jan 2003 21:05:12 -0000      1.59
  +++ Driver.java       27 Feb 2003 10:13:06 -0000      1.60
  @@ -1,10 +1,53 @@
   /*
    * $Id$
  - * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
   // FOP
  @@ -39,8 +82,9 @@
   import java.io.OutputStream;
   import java.io.Reader;
   import java.util.Enumeration;
  -import java.util.Hashtable;
  -import java.util.Vector;
  +import java.util.Iterator;
  +import java.util.List;
  +import java.util.Map;
   
   /**
    * Primary class that drives overall FOP process.
  @@ -182,6 +226,11 @@
       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()
  @@ -194,18 +243,26 @@
       }
   
       /**
  -     * create a new Driver
  +     * Main constructor for the Driver class.
        */
       public Driver() {
           stream = null;
       }
   
  +    /**
  +     * Convenience constructor for directly setting input and output.
  +     * @param source InputSource to take the XSL-FO input from
  +     * @param stream Target output stream
  +     */
       public Driver(InputSource source, OutputStream stream) {
           this();
           this.source = source;
           this.stream = stream;
       }
   
  +    /**
  +     * Initializes the Driver object.
  +     */
       public void initialize() {
           stream = null;
           treeBuilder = new FOTreeBuilder();
  @@ -213,6 +270,11 @@
           setupDefaultMappings();
       }
   
  +    /**
  +     * Optionally sets the FOUserAgent instance for FOP to use. The Driver
  +     * class sets up its own FOUserAgent if none is set through this method.
  +     * @param agent FOUserAgent to use
  +     */
       public void setUserAgent(FOUserAgent agent) {
           userAgent = agent;
       }
  @@ -226,6 +288,14 @@
           return userAgent;
       }
   
  +    /**
  +     * Provide the Driver instance with a logger. More information on Avalon 
  +     * logging can be found at the 
  +     * <a href="http://avalon.apache.org";>Avalon site</a>.
  +     *
  +     * @param log the logger. Must not be <code>null</code>.
  +     * @see org.apache.avalon.framework.logger.LogEnabled#enableLogging(Logger)
  +     */
       public void enableLogging(Logger log) {
           if (this.log == null) {
               this.log = log;
  @@ -235,6 +305,11 @@
       }
   
   
  +    /**
  +     * Returns the logger for use by FOP.
  +     * @return the logger
  +     * @see #enableLogging(Logger)
  +     */
       protected Logger getLogger() {
           if (this.log == null) {
               this.log = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);
  @@ -256,6 +331,10 @@
           treeBuilder.reset();
       }
   
  +    /**
  +     * Indicates whether FOP has already received input data.
  +     * @return true, if input data was received
  +     */
       public boolean hasData() {
           return (treeBuilder.hasData());
       }
  @@ -264,7 +343,6 @@
        * Set the OutputStream to use to output the result of the Renderer
        * (if applicable)
        * @param stream the stream to output the result of rendering to
  -     *
        */
       public void setOutputStream(OutputStream stream) {
           this.stream = stream;
  @@ -298,14 +376,15 @@
           addElementMapping("org.apache.fop.extensions.ExtensionElementMapping");
   
           // add mappings from available services
  -        Enumeration providers =
  +        Iterator providers =
               Service.providers(org.apache.fop.fo.ElementMapping.class);
           if (providers != null) {
  -            while (providers.hasMoreElements()) {
  -                String str = (String)providers.nextElement();
  +            while (providers.hasNext()) {
  +                String str = (String)providers.next();
                   try {
                       addElementMapping(str);
                   } catch (IllegalArgumentException e) {
  +                    getLogger().warn("Error while adding element mapping", e);
                   }
   
               }
  @@ -373,12 +452,21 @@
           this.renderer = renderer;
       }
   
  +    /**
  +     * Returns the currently active renderer.
  +     * @return the renderer
  +     */
       public Renderer getRenderer() {
           return renderer;
       }
   
       /**
  -     * @deprecated use renderer.setProducer(version) + setRenderer(renderer) or 
just setRenderer(rendererType) which will use the default producer string.
  +     * Sets the renderer.
  +     * @param rendererClassName the fully qualified classname of the renderer
  +     * class to use.
  +     * @param version version number
  +     * @deprecated use renderer.setProducer(version) + setRenderer(renderer) or 
  +     * just setRenderer(rendererType) which will use the default producer string.
        * @see #setRenderer(int)
        * @see #setRenderer(Renderer)
        */
  @@ -395,7 +483,7 @@
        * @see #setRenderer(int)
        */
       public void setRenderer(String rendererClassName)
  -    throws IllegalArgumentException {
  +                throws IllegalArgumentException {
           try {
               renderer =
                   (Renderer)Class.forName(rendererClassName).newInstance();
  @@ -431,11 +519,11 @@
   
       /**
        * Add the element mapping with the given class name.
  -     * @param the class name representing the element mapping.
  +     * @param mappingClassName the class name representing the element mapping.
        * @throws IllegalArgumentException if there was not such element mapping.
        */
       public void addElementMapping(String mappingClassName)
  -        throws IllegalArgumentException {
  +                throws IllegalArgumentException {
           try {
               ElementMapping mapping =
                   (ElementMapping)Class.forName(mappingClassName).newInstance();
  @@ -464,7 +552,7 @@
        * @return a content handler for handling the SAX events.
        */
       public ContentHandler getContentHandler() {
  -        // TODO - do this stuff in a better way
  +        // TODO: - do this stuff in a better way
           // PIJ: I guess the structure handler should be created by the renderer.
           if (rendererType == RENDER_MIF) {
               structHandler = new org.apache.fop.mif.MIFHandler(stream);
  @@ -472,7 +560,8 @@
               structHandler = new org.apache.fop.rtf.renderer.RTFHandler(stream);
           } else {
               if (renderer == null) {
  -                throw new Error("Renderer not set when using standard 
structHandler");
  +                throw new IllegalStateException(
  +                        "Renderer not set when using standard structHandler");
               }
               structHandler = new LayoutHandler(stream, renderer, true);
           }
  @@ -492,7 +581,7 @@
        * @throws FOPException if anything goes wrong.
        */
       public synchronized void render(XMLReader parser, InputSource source)
  -        throws FOPException {
  +                throws FOPException {
           parser.setContentHandler(getContentHandler());
           try {
               parser.parse(source);
  @@ -514,7 +603,7 @@
        * @throws FOPException if anything goes wrong.
        */
       public synchronized void render(Document document)
  -        throws FOPException {
  +                throws FOPException {
           try {
               DocumentInputSource source = new DocumentInputSource(document);
               DocumentReader reader = new DocumentReader();
  @@ -542,8 +631,7 @@
        * @throws IOException in case of IO errors.
        * @throws FOPException if anything else goes wrong.
        */
  -    public synchronized void run()
  -        throws IOException, FOPException {
  +    public synchronized void run() throws IOException, FOPException {
           if (renderer == null) {
               setRenderer(RENDER_PDF);
           }
  @@ -583,9 +671,9 @@
    */
   class Service {
   
  -    static private Hashtable providerMap = new Hashtable();
  +    private static Map providerMap = new java.util.Hashtable();
   
  -    public static synchronized Enumeration providers(Class cls) {
  +    public static synchronized Iterator providers(Class cls) {
           ClassLoader cl = cls.getClassLoader();
           // null if loaded by bootstrap class loader
           if (cl == null) {
  @@ -595,19 +683,19 @@
   
           // getLogger().debug("File: " + serviceFile);
   
  -        Vector v = (Vector)providerMap.get(serviceFile);
  -        if (v != null) {
  -            return v.elements();
  +        List lst = (List)providerMap.get(serviceFile);
  +        if (lst != null) {
  +            return lst.iterator();
           }
   
  -        v = new Vector();
  -        providerMap.put(serviceFile, v);
  +        lst = new java.util.Vector();
  +        providerMap.put(serviceFile, lst);
   
           Enumeration e;
           try {
               e = cl.getResources(serviceFile);
           } catch (IOException ioe) {
  -            return v.elements();
  +            return lst.iterator();
           }
   
           while (e.hasMoreElements()) {
  @@ -641,7 +729,7 @@
                           // Try and load the class
                           // Object obj = cl.loadClass(line).newInstance();
                           // stick it into our vector...
  -                        v.add(line);
  +                        lst.add(line);
                       } catch (Exception ex) {
                           // Just try the next line
                       }
  @@ -653,7 +741,7 @@
               }
   
           }
  -        return v.elements();
  +        return lst.iterator();
       }
   
   }
  
  
  
  1.12      +50 -8     xml-fop/src/org/apache/fop/apps/FOPException.java
  
  Index: FOPException.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/FOPException.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FOPException.java 13 Jan 2003 21:05:12 -0000      1.11
  +++ FOPException.java 27 Feb 2003 10:13:07 -0000      1.12
  @@ -1,17 +1,59 @@
   /*
    * $Id$
  - * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources."
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
   import org.xml.sax.SAXException;
   
  -
   /**
  - * Exception thrown when FOP has a problem
  + * Exception thrown when FOP has a problem.
    */
   public class FOPException extends Exception {
   
  
  
  
  1.12      +70 -14    xml-fop/src/org/apache/fop/apps/Starter.java
  
  Index: Starter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/Starter.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Starter.java      25 Oct 2002 09:29:39 -0000      1.11
  +++ Starter.java      27 Feb 2003 10:13:07 -0000      1.12
  @@ -1,10 +1,53 @@
   /*
    * $Id$
  - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
   // Avalon
  @@ -14,29 +57,42 @@
   import org.xml.sax.XMLReader;
   import org.xml.sax.SAXException;
   
  -// Java
  -import java.io.*;
  -import java.net.URL;
  -
   /**
  - * abstract super class
  + * Abstract super class.
    * Creates a SAX Parser (defaulting to Xerces).
  - *
    */
   public abstract class Starter extends AbstractLogEnabled {
   
  -    InputHandler inputHandler;
  +    /** InputHandler associated with this Starter */
  +    protected InputHandler inputHandler;
   
  +    /**
  +     * Main constructor
  +     * @throws FOPException In case of a problem constructing the Starter
  +     */
       public Starter() throws FOPException {
       }
   
  +    /**
  +     * Sets the InputHandler to use.
  +     * @param inputHandler input handler
  +     */
       public void setInputHandler(InputHandler inputHandler) {
           this.inputHandler = inputHandler;
       }
   
  +    /**
  +     * Runs the current setup.
  +     * @throws FOPException In case of a problem during the FOP run
  +     */
       public abstract void run() throws FOPException;
   
  -    // setting the parser features
  +    /**
  +     * Sets the parser features on an XMLReader
  +     * @param parser XMLReader to set features on
  +     * @throws FOPException if the XMLReader doesn't support the feature that
  +     * need to be set
  +     */
       public void setParserFeatures(XMLReader parser) throws FOPException {
           try {
               parser.setFeature("http://xml.org/sax/features/namespace-prefixes";,
  
  
  
  1.7       +84 -13    xml-fop/src/org/apache/fop/apps/StructureHandler.java
  
  Index: StructureHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/StructureHandler.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StructureHandler.java     15 Nov 2002 11:56:27 -0000      1.6
  +++ StructureHandler.java     27 Feb 2003 10:13:07 -0000      1.7
  @@ -1,10 +1,53 @@
   /*
    * $Id$
  - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  -
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + * 
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + * 
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + * 
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + * 
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + * 
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + * 
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + * 
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + * 
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
  + * 
  + * This software consists of voluntary contributions made by many individuals
  + * on behalf of the Apache Software Foundation and was originally created by
  + * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache
  + * Software Foundation, please see <http://www.apache.org/>.
  + */ 
   package org.apache.fop.apps;
   
   // Java
  @@ -15,9 +58,20 @@
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   
   // FOP
  -import org.apache.fop.fo.pagination.*;
  -import org.apache.fop.fo.flow.*;
  -import org.apache.fop.fo.*;
  +import org.apache.fop.fo.Title;
  +import org.apache.fop.fo.flow.Block;
  +import org.apache.fop.fo.flow.ExternalGraphic;
  +import org.apache.fop.fo.flow.Flow;
  +import org.apache.fop.fo.flow.InstreamForeignObject;
  +import org.apache.fop.fo.flow.Leader;
  +import org.apache.fop.fo.flow.ListBlock;
  +import org.apache.fop.fo.flow.ListItem;
  +import org.apache.fop.fo.flow.Table;
  +import org.apache.fop.fo.flow.TableBody;
  +import org.apache.fop.fo.flow.TableCell;
  +import org.apache.fop.fo.flow.TableRow;
  +import org.apache.fop.fo.pagination.LayoutMasterSet;
  +import org.apache.fop.fo.pagination.PageSequence;
   import org.apache.fop.layout.FontInfo;
   
   import org.xml.sax.SAXException;
  @@ -29,28 +83,45 @@
    */
   public class StructureHandler extends AbstractLogEnabled {
       /**
  -       The current set of id's in the FO tree
  -       This is used so we know if the FO tree contains duplicates
  +     * The current set of id's in the FO tree.
  +     * This is used so we know if the FO tree contains duplicates.
        */
       private Set idReferences = new HashSet();
   
  +    /**
  +     * Main constructor
  +     */
       public StructureHandler() {
       }
   
  +    /**
  +     * Retuns the set of ID references.
  +     * @return the ID references
  +     */
       public Set getIDReferences() {
           return idReferences;
       }
   
  +    /**
  +     * Returns the FontInfo object associated with this StructureHandler.
  +     * @return the FontInof object
  +     */
       public FontInfo getFontInfo() {
           return null;
       }
   
  +    /**
  +     * This method is called to indicate the start of a new document run.
  +     * @throws SAXException In case of a problem
  +     */
       public void startDocument() throws SAXException {
  -
       }
   
  +    /**
  +     * This method is called to indicate the end of a document run.
  +     * @throws SAXException In case of a problem
  +     */
       public void endDocument() throws SAXException {
  -
       }
   
       public void startPageSequence(PageSequence pageSeq, Title seqTitle, 
LayoutMasterSet lms) {
  
  
  

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

Reply via email to