forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject cvs commit: xml-forrest/src/core/tasks/org/apache/forrest UncopiedFileSelector.java
Date Thu, 19 Feb 2004 23:46:23 GMT
nicolaken    2004/02/19 15:46:23

  Modified:    scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/js/doc
                        GenerateHTMLDoc.java
               scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab
                        HTMLTag.java
               scratchpad/forrestdoc/src java.xml
               scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/xref
                        JavaLexer.java JavaXref.java
               scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src
                        Pass1.java Pass2.java
               src/core/tasks/org/apache/forrest UncopiedFileSelector.java
  Log:
  Clean imports, remove static methods and make static fields be accessed
  correctly.
  
  Revision  Changes    Path
  1.3       +5 -6      xml-forrest/scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/js/doc/GenerateHTMLDoc.java
  
  Index: GenerateHTMLDoc.java
  ===================================================================
  RCS file: /home/cvs/xml-forrest/scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/js/doc/GenerateHTMLDoc.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GenerateHTMLDoc.java	11 Feb 2004 19:13:59 -0000	1.2
  +++ GenerateHTMLDoc.java	19 Feb 2004 23:46:23 -0000	1.3
  @@ -61,14 +61,13 @@
   
   package org.apache.forrest.forrestdoc.js.doc;
   
  -import java.io.File;
   import java.io.BufferedReader;
  -import java.io.FileReader;
  +import java.io.File;
   import java.io.FileInputStream;
   import java.io.FileNotFoundException;
   import java.io.FileOutputStream;
  +import java.io.FileReader;
   import java.io.IOException;
  -import java.io.InputStreamReader;
   
   /**
    * @author Mailton
  
  
  
  1.2       +5 -5      xml-forrest/scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HTMLTag.java
  
  Index: HTMLTag.java
  ===================================================================
  RCS file: /home/cvs/xml-forrest/scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HTMLTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HTMLTag.java	9 Feb 2004 11:09:12 -0000	1.1
  +++ HTMLTag.java	19 Feb 2004 23:46:23 -0000	1.2
  @@ -60,10 +60,10 @@
    */
   package org.apache.forrest.forrestdoc.java.src.symtab;
   
  -import org.apache.forrest.forrestdoc.java.src.util.JSComparable;
  -
   import java.io.File;
   import java.util.StringTokenizer;
  +
  +import org.apache.forrest.forrestdoc.java.src.util.JSComparable;
   
   /**
    * An occurrence of an HTML Tag in a file
  
  
  
  1.2       +15 -8     xml-forrest/scratchpad/forrestdoc/src/java.xml
  
  Index: java.xml
  ===================================================================
  RCS file: /home/cvs/xml-forrest/scratchpad/forrestdoc/src/java.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- java.xml	11 Feb 2004 11:12:37 -0000	1.1
  +++ java.xml	19 Feb 2004 23:46:23 -0000	1.2
  @@ -19,12 +19,26 @@
      
      <target name="javasrc">
         <mkdir dir="${target.javasrc.dir}" />
  +      <taskdef name="javasrc" classname="org.apache.forrest.forrestdoc.java.src.JavaSrcTask">
  +        <classpath refid="task.classpath"/>
  +      </taskdef>
  +      <javasrc srcDir="${project.dir}" 
  +               destDir="${target.javasrc.dir}" 
  +               recurse="true"
  +               title="${project.dirname}"
  +               verbose="false"/>
  +   </target>   
  +
  +
  +   <target name="clijavasrc">
  +      <mkdir dir="${target.javasrc.dir}" />
         <java classname="org.apache.forrest.forrestdoc.java.src.Pass1"
                fork="true"
                dir="."
                failonerror="true"
                maxmemory="256m">
            <sysproperty key="recurse" value="true" />
  +         <sysproperty key="verbose" value="false" />
            <sysproperty  key="title" value="Java Code Documentation" />
            <sysproperty key="outdir" path="${target.javasrc.dir}" />
            <arg value="${project.dir}" />
  @@ -37,6 +51,7 @@
               failonerror="true"
               maxmemory="256m">
            <sysproperty key="recurse" value="true" />
  +         <sysproperty key="verbose" value="false" />
            <sysproperty key="title" value="Java Code Documentation" />
            <sysproperty key="outdir" path="${target.javasrc.dir}" />
            <arg value="${project.dir}" />
  @@ -48,14 +63,6 @@
               filtering="off" />
      </target>
      
  -   <target name="javasrc2">
  -      <mkdir dir="${target.javasrc.dir}" />
  -      <taskdef name="javasrc" classname="org.apache.forrest.forrestdoc.java.src.JavaSrcTask">
  -        <classpath refid="task.classpath"/>
  -      </taskdef>
  -      <javasrc srcDir="${project.dir}" destDir="${target.javasrc.dir}" />
  -   </target>   
  -
      <target name="uml" depends="xml, xml2dot, dot">
          <antcall target="dot">
           <param name="dot.format" value="svg"/>
  
  
  
  1.2       +13 -17    xml-forrest/scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/xref/JavaLexer.java
  
  Index: JavaLexer.java
  ===================================================================
  RCS file: /home/cvs/xml-forrest/scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/xref/JavaLexer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JavaLexer.java	9 Feb 2004 11:09:16 -0000	1.1
  +++ JavaLexer.java	19 Feb 2004 23:46:23 -0000	1.2
  @@ -3,30 +3,26 @@
   package org.apache.forrest.forrestdoc.java.src.xref;
   
   import java.io.InputStream;
  -import antlr.TokenStreamException;
  -import antlr.TokenStreamIOException;
  -import antlr.TokenStreamRecognitionException;
  -import antlr.CharStreamException;
  -import antlr.CharStreamIOException;
  -import antlr.ANTLRException;
   import java.io.Reader;
   import java.util.Hashtable;
  -import antlr.CharScanner;
  -import antlr.InputBuffer;
  +
  +import org.apache.forrest.forrestdoc.java.src.symtab.SymbolTable;
  +
  +import antlr.ANTLRHashString;
   import antlr.ByteBuffer;
   import antlr.CharBuffer;
  -import antlr.Token;
  -import antlr.CommonToken;
  -import antlr.RecognitionException;
  +import antlr.CharStreamException;
  +import antlr.CharStreamIOException;
  +import antlr.InputBuffer;
  +import antlr.LexerSharedInputState;
   import antlr.NoViableAltForCharException;
  -import antlr.MismatchedCharException;
  +import antlr.RecognitionException;
  +import antlr.Token;
   import antlr.TokenStream;
  -import antlr.ANTLRHashString;
  -import antlr.LexerSharedInputState;
  +import antlr.TokenStreamException;
  +import antlr.TokenStreamIOException;
  +import antlr.TokenStreamRecognitionException;
   import antlr.collections.impl.BitSet;
  -import antlr.SemanticException;
  -
  -  import org.apache.forrest.forrestdoc.java.src.symtab.SymbolTable;
   
   public class JavaLexer extends antlr.CharScanner implements JavaTokenTypes, TokenStream
    {
  
  
  
  1.2       +17 -19    xml-forrest/scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/xref/JavaXref.java
  
  Index: JavaXref.java
  ===================================================================
  RCS file: /home/cvs/xml-forrest/scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/xref/JavaXref.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JavaXref.java	9 Feb 2004 11:09:16 -0000	1.1
  +++ JavaXref.java	19 Feb 2004 23:46:23 -0000	1.2
  @@ -2,29 +2,27 @@
   
   package org.apache.forrest.forrestdoc.java.src.xref;
   
  -import antlr.TokenBuffer;
  -import antlr.TokenStreamException;
  -import antlr.TokenStreamIOException;
  -import antlr.ANTLRException;
  -import antlr.LLkParser;
  -import antlr.Token;
  -import antlr.TokenStream;
  -import antlr.RecognitionException;
  +import java.io.File;
  +import java.io.FileInputStream;
  +import java.io.InputStream;
  +
  +import org.apache.forrest.forrestdoc.java.src.symtab.DummyClass;
  +import org.apache.forrest.forrestdoc.java.src.symtab.JavaVector;
  +import org.apache.forrest.forrestdoc.java.src.symtab.SymbolTable;
  +import org.apache.forrest.forrestdoc.java.src.util.SkipCRInputStream;
  +
  +import antlr.ASTPair;
   import antlr.NoViableAltException;
  -import antlr.MismatchedTokenException;
  -import antlr.SemanticException;
   import antlr.ParserSharedInputState;
  -import antlr.collections.impl.BitSet;
  +import antlr.RecognitionException;
  +import antlr.SemanticException;
  +import antlr.Token;
  +import antlr.TokenBuffer;
  +import antlr.TokenStream;
  +import antlr.TokenStreamException;
   import antlr.collections.AST;
  -import antlr.ASTPair;
   import antlr.collections.impl.ASTArray;
  -
  -import java.util.Vector;
  -import java.io.*;
  -import org.apache.forrest.forrestdoc.java.src.symtab.SymbolTable;
  -import org.apache.forrest.forrestdoc.java.src.symtab.JavaVector;
  -import org.apache.forrest.forrestdoc.java.src.symtab.DummyClass;
  -import org.apache.forrest.forrestdoc.java.src.util.*;
  +import antlr.collections.impl.BitSet;
   
   public class JavaXref extends antlr.LLkParser
          implements JavaTokenTypes
  
  
  
  1.2       +17 -15    xml-forrest/scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/Pass1.java
  
  Index: Pass1.java
  ===================================================================
  RCS file: /home/cvs/xml-forrest/scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/Pass1.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Pass1.java	9 Feb 2004 11:09:18 -0000	1.1
  +++ Pass1.java	19 Feb 2004 23:46:23 -0000	1.2
  @@ -207,7 +207,7 @@
               if (args.length > 0) {
                   System.out.println("outDirPath is " + getOutDir());
                   symbolTable.setOutDirPath(getOutDir());
  -                System.err.println("Parsing...");
  +                System.out.println("Parsing...");
   
                   // for each directory/file specified on the command line
                   for (int i = 0; i < args.length; i++) {
  @@ -215,13 +215,13 @@
                               getRecurse(), this);    // parse it
                   }
   
  -                System.err.println("Resolving types...");
  +                System.out.println("Resolving types...");
   
                   // resolve the types of all symbols in the symbol table
                   symbolTable.resolveTypes();
                   symbolTable.resolveRefs();
               } else {
  -                System.err.println(USAGE);
  +                System.out.println(USAGE);
               }
   
               // Iterate through each package
  @@ -231,7 +231,7 @@
               while (pEnum.hasMoreElements()) {
                   PackageDef pDef = (PackageDef) pEnum.nextElement();
   
  -                System.out.println("Processing package " + pDef.getName());
  +                printAdvancement("Processing package " + pDef.getName());
   
                   // Generate tags for each package.  We cannot do one class
                   // at a time because more than one class might be in a
  @@ -761,12 +761,8 @@
           t = (HTMLTag) sortedList[0];
           javaFile = t.getFile();
   
  -        if (/* getVerbose() */true) {
  -            System.out.println("Writing tags for file " + javaFile.toString());
  -        } else {
  -            System.out.print(".");
  -        }
  -
  +        printAdvancement("Writing tags for file " + javaFile.toString());
  + 
           // Create first file
           try {
               output = createClassFile(sortedList, 0);
  @@ -777,11 +773,10 @@
               _currentColumn = 1;
           } catch (Exception e) {
               e.printStackTrace();
  -            System.exit(1);
               System.out.println("1: Could not open file:"
                       + javaFile.getAbsolutePath());
               System.out.println("   or html file.");
  -
  +            System.exit(1);
               return;
           }
   
  @@ -869,6 +864,13 @@
           ;
       }
   
  +    private void printAdvancement(String description) {
  +        if ( getVerbose() ) {
  +            System.out.println(description);
  +        } else {
  +            System.out.print(".");
  +        }
  +    }
       /**
        * Method main
        * 
  
  
  
  1.2       +18 -18    xml-forrest/scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/Pass2.java
  
  Index: Pass2.java
  ===================================================================
  RCS file: /home/cvs/xml-forrest/scratchpad/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/Pass2.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Pass2.java	9 Feb 2004 11:09:18 -0000	1.1
  +++ Pass2.java	19 Feb 2004 23:46:23 -0000	1.2
  @@ -111,7 +111,7 @@
        * 
        * @return 
        */
  -    public static String getOutDir() {
  +    public String getOutDir() {
           return _outDir;
       }
   
  @@ -120,7 +120,7 @@
        * 
        * @param d 
        */
  -    public static void setOutDir(String d) {
  +    public void setOutDir(String d) {
           _outDir = d;
       }
   
  @@ -129,7 +129,7 @@
        * 
        * @return 
        */
  -    public static String getTitle() {
  +    public String getTitle() {
           return _title;
       }
   
  @@ -138,7 +138,7 @@
        * 
        * @param t 
        */
  -    public static void setTitle(String t) {
  +    public void setTitle(String t) {
           _title = t;
       }
   
  @@ -147,7 +147,7 @@
        * 
        * @return 
        */
  -    public static boolean getVerbose() {
  +    public boolean getVerbose() {
           return _verbose;
       }
   
  @@ -156,7 +156,7 @@
        * 
        * @param val 
        */
  -    public static void setVerbose(boolean val) {
  +    public void setVerbose(boolean val) {
           _verbose = val;
       }
   
  @@ -979,7 +979,7 @@
   
               createOverviewSummaryFrameExtras(pw);
   
  -            pw.println("<h2>" + Pass2.getTitle() + "</h2>");
  +            pw.println("<h2>" + getTitle() + "</h2>");
   
               pw.println("<table class=\"summary\">");
               pw.println("<thead>");
  @@ -1045,7 +1045,7 @@
               outdir = DEFAULT_DIR;
           }
   
  -        Pass2.setOutDir(outdir);
  +        setOutDir(outdir);
   
           String title = (String) System.getProperty("title");
   
  @@ -1053,7 +1053,7 @@
               title = "Pass2: " + outdir;
           }
   
  -        Pass2.setTitle(title);
  +        setTitle(title);
   
           boolean verbose = false;
           String verboseStr = (String) System.getProperty("verbose");
  @@ -1069,7 +1069,7 @@
               }
           }
   
  -        Pass2.setVerbose(verbose);
  +        setVerbose(verbose);
       }
   
       /**
  @@ -1077,7 +1077,7 @@
        * 
        * @param f 
        */
  -    private static void createDirs(File f) {
  +    private void createDirs(File f) {
   
           String parentDir = f.getParent();
           File directory = new File(parentDir);
  @@ -1093,7 +1093,7 @@
        * @param args 
        * @throws Exception 
        */
  -    public static void main(String args[]) throws Exception {
  +    public void main(String args[]) throws Exception {
   
           Pass2 p2 = new Pass2();
   
  @@ -1108,13 +1108,13 @@
       Hashtable packageClasses;
   
       /** Field _outDir */
  -    private static String _outDir;
  +    private String _outDir;
   
       /** Field _title */
  -    private static String _title;
  +    private String _title;
   
       /** Field _verbose */
  -    private static boolean _verbose;
  +    private boolean _verbose;
   }
   
   /**
  
  
  
  1.2       +9 -5      xml-forrest/src/core/tasks/org/apache/forrest/UncopiedFileSelector.java
  
  Index: UncopiedFileSelector.java
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/core/tasks/org/apache/forrest/UncopiedFileSelector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UncopiedFileSelector.java	20 Oct 2003 15:38:36 -0000	1.1
  +++ UncopiedFileSelector.java	19 Feb 2004 23:46:23 -0000	1.2
  @@ -54,13 +54,17 @@
   
   package org.apache.forrest;
   
  -import org.apache.tools.ant.types.selectors.*;
  -import java.io.*;
  -import java.util.Set;
  +import java.io.BufferedReader;
  +import java.io.File;
  +import java.io.FileNotFoundException;
  +import java.io.FileReader;
  +import java.io.IOException;
   import java.util.HashSet;
  -import org.apache.tools.ant.Project;
  +import java.util.Set;
  +
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.types.Parameter;
  +import org.apache.tools.ant.types.selectors.BaseExtendSelector;
   
   /**
    * Ant selector that selects files listed in an external text file.  
  @@ -148,7 +152,7 @@
      */
     public void verifySettings() {
       if (configFile == null) {
  -      setError("The "+this.CONFIG_KEY+" attribute is required");
  +      setError("The "+UncopiedFileSelector.CONFIG_KEY+" attribute is required");
       }
     }
   
  
  
  

Mime
View raw message