axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject cvs commit: ws-axis/java/tools/org/apache/axis/tools/ant/wsdl Wsdl2javaAntTask.java
Date Mon, 12 Apr 2004 18:17:31 GMT
gawor       2004/04/12 11:17:31

  Modified:    java/src/org/apache/axis/i18n resource.properties
               java/src/org/apache/axis/wsdl/gen Parser.java WSDL2.java
               java/src/org/apache/axis/wsdl/symbolTable SymbolTable.java
               java/src/org/apache/axis/wsdl/toJava JavaBindingWriter.java
               java/tools/org/apache/axis/tools/ant/wsdl
                        Wsdl2javaAntTask.java
  Log:
  added quiet switch. quiet switch disables any messages going to stdout and not stderr at
this point.
  
  Revision  Changes    Path
  1.83      +3 -0      ws-axis/java/src/org/apache/axis/i18n/resource.properties
  
  Index: resource.properties
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/i18n/resource.properties,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- resource.properties	22 Mar 2004 14:52:58 -0000	1.82
  +++ resource.properties	12 Apr 2004 18:17:31 -0000	1.83
  @@ -939,6 +939,7 @@
   optionClasspath=additional classpath elements
   optionNSInclude=include namespace in generated code
   optionNSExclude=exclude namespace from generated code
  +optionQuiet=do not print any informational or debug messages (except errors)
   
   cantCreateBean00=Unable to create JavaBean of type {0}.  Missing default constructor? 
Error was: {1}.
   faultDuringCleanup=AxisEngine faulted during cleanup!
  @@ -965,6 +966,8 @@
   j2wMissingClass00=The <class-of-portType> was not specified.
   w2jDuplicateWSDLURI00=The wsdl URI has already been specified as, {0}.  It cannot be specified
again as {1}.
   w2jMissingWSDLURI00=The wsdl URI was not specified.
  +exclusiveQuietVerbose=--quiet and --verbose are exclusive
  +exclusiveQuietDebug=--quiet and --Debug are exclusive
   
   badEnum02=Unrecognized {0}: ''{1}''
   badEnum03=Unrecognized {0}: ''{1}'', defaulting to ''{2}''
  
  
  
  1.22      +22 -0     ws-axis/java/src/org/apache/axis/wsdl/gen/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/gen/Parser.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Parser.java	30 Mar 2004 11:36:02 -0000	1.21
  +++ Parser.java	12 Apr 2004 18:17:31 -0000	1.22
  @@ -46,6 +46,9 @@
       /** Field debug */
       protected boolean debug = false;
   
  +    /** Field quiet */
  +    protected boolean quiet = false;
  +
       /** Field imports */
       protected boolean imports = true;
   
  @@ -93,6 +96,24 @@
       }    // setDebug
   
       /**
  +     * Method isQuiet
  +     * 
  +     * @return 
  +     */
  +    public boolean isQuiet() {
  +        return quiet;
  +    }    
  +
  +    /**
  +     * Method setQuiet
  +     * 
  +     * @param quiet
  +     */
  +    public void setQuiet(boolean quiet) {
  +        this.quiet = quiet;
  +    }   
  +    
  +    /**
        * Method isImports
        * 
        * @return 
  @@ -271,6 +292,7 @@
   
           symbolTable = new SymbolTable(genFactory.getBaseTypeMapping(), imports,
                   verbose, nowrap);
  +        symbolTable.setQuiet(quiet);
   
           // We run the actual Emitter in a thread that we can kill
           WSDLRunnable runnable = new WSDLRunnable(symbolTable, wsdlURI);
  
  
  
  1.19      +23 -1     ws-axis/java/src/org/apache/axis/wsdl/gen/WSDL2.java
  
  Index: WSDL2.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/gen/WSDL2.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- WSDL2.java	25 Feb 2004 14:02:50 -0000	1.18
  +++ WSDL2.java	12 Apr 2004 18:17:31 -0000	1.19
  @@ -52,6 +52,9 @@
       /** Field NOWRAP_OPT */
       protected static final int NOWRAP_OPT = 'W';
   
  +    /** Filed quiet */
  +    protected static final int QUIET_OPT = 'q';
  +
       /** Field options */
       protected CLOptionDescriptor[] options = new CLOptionDescriptor[]{
           new CLOptionDescriptor("help", CLOptionDescriptor.ARGUMENT_DISALLOWED,
  @@ -72,7 +75,11 @@
           new CLOptionDescriptor("noWrapped",
                   CLOptionDescriptor.ARGUMENT_DISALLOWED,
                   NOWRAP_OPT,
  -                Messages.getMessage("optionNoWrap00"))
  +                Messages.getMessage("optionNoWrap00")),
  +        new CLOptionDescriptor("quiet",
  +                CLOptionDescriptor.ARGUMENT_OPTIONAL,
  +                QUIET_OPT,
  +                Messages.getMessage("optionQuiet"))
       };
   
       /** Field wsdlURI */
  @@ -212,6 +219,10 @@
                   parser.setDebug(true);
                   break;
   
  +            case QUIET_OPT:
  +                parser.setQuiet(true);
  +                break;
  +
               case NOWRAP_OPT:
                   parser.setNowrap(true);
                   break;
  @@ -228,6 +239,17 @@
           if (wsdlURI == null) {
               System.out.println(Messages.getMessage("w2jMissingWSDLURI00"));
               printUsage();
  +        }
  +
  +        if (parser.isQuiet()) {
  +            if (parser.isVerbose()) {
  +                System.out.println(Messages.getMessage("exclusiveQuietVerbose"));
  +                printUsage();
  +            } 
  +            if (parser.isDebug()) {
  +                System.out.println(Messages.getMessage("exclusiveQuietDebug"));
  +                printUsage();
  +            }
           }
   
           // Set username and password if provided in URL
  
  
  
  1.98      +23 -4     ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java
  
  Index: SymbolTable.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- SymbolTable.java	12 Apr 2004 12:55:35 -0000	1.97
  +++ SymbolTable.java	12 Apr 2004 18:17:31 -0000	1.98
  @@ -138,6 +138,9 @@
       /** Field verbose */
       private boolean verbose;
   
  +    /** Field quiet */
  +    protected boolean quiet;
  +
       /** Field btm */
       private BaseTypeMapping btm = null;
   
  @@ -180,6 +183,24 @@
       }    // ctor
   
       /**
  +     * Method isQuiet
  +     * 
  +     * @return 
  +     */
  +    public boolean isQuiet() {
  +        return quiet;
  +    }    
  +
  +    /**
  +     * Method setQuiet
  +     * 
  +     * @param quiet
  +     */
  +    public void setQuiet(boolean quiet) {
  +        this.quiet = quiet;
  +    }   
  +
  +    /**
        * Get the raw symbol table HashMap.
        * 
        * @return 
  @@ -1702,9 +1723,7 @@
                   } else if (outdex >= 0) {
                       addOutParm(outputs, outdex, parameters, true);
                   } else {
  -                    if (verbose) {
  -                        System.err.println(Messages.getMessage("noPart00", name));
  -                    }
  +                    System.err.println(Messages.getMessage("noPart00", name));
                   }
               }
           }
  @@ -3547,7 +3566,7 @@
                   }
               }
           } else {
  -            if (verbose) {
  +            if (!quiet) {
                   System.out.println(Messages.getMessage("alreadyExists00",
                                                          "" + name));
               }
  
  
  
  1.24      +5 -2      ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaBindingWriter.java
  
  Index: JavaBindingWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaBindingWriter.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- JavaBindingWriter.java	25 Feb 2004 14:02:52 -0000	1.23
  +++ JavaBindingWriter.java	12 Apr 2004 18:17:31 -0000	1.24
  @@ -194,8 +194,11 @@
                       if (Utils.fileExists(fileName,
                               binding.getQName().getNamespaceURI(),
                               emitter.getNamespaces())) {
  -                        System.out.println(Messages.getMessage("wontOverwrite",
  -                                fileName));
  +                        if (!emitter.isQuiet()) {
  +                            System.out.println(
  +                                 Messages.getMessage("wontOverwrite",
  +                                                     fileName));
  +                        }
                       } else {
                           implWriter = getJavaImplWriter(emitter, bEntry,
                                   symbolTable);
  
  
  
  1.17      +22 -1     ws-axis/java/tools/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java
  
  Index: Wsdl2javaAntTask.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/tools/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Wsdl2javaAntTask.java	27 Feb 2004 15:00:14 -0000	1.16
  +++ Wsdl2javaAntTask.java	12 Apr 2004 18:17:31 -0000	1.17
  @@ -78,6 +78,7 @@
   {
       private boolean verbose = false;
       private boolean debug = false;
  +    private boolean quiet = false;
       private boolean server = false;
       private boolean skeletonDeploy = false;
       private boolean testCase = false;
  @@ -132,7 +133,16 @@
           if (!outdir.isDirectory() || !outdir.exists()) {
               throw new BuildException("output directory is not valid");
           }
  -
  +        if (quiet) {
  +            if (verbose) {
  +                throw new BuildException("quiet and verbose options are " +
  +                                         "exclusive");
  +            }
  +            if (debug) {
  +                throw new BuildException("quiet and debug options are " +
  +                                         "exclusive");
  +            }
  +        }
       }
   
       /**
  @@ -144,6 +154,7 @@
           log("Running Wsdl2javaAntTask with parameters:", logLevel);
           log("\tverbose:" + verbose, logLevel);
           log("\tdebug:" + debug, logLevel);
  +        log("\tquiet:" + quiet, logLevel);
           log("\tserver-side:" + server, logLevel);
           log("\tskeletonDeploy:" + skeletonDeploy, logLevel);
           log("\thelperGen:" + helperGen, logLevel);
  @@ -216,6 +227,7 @@
               emitter.setSkeletonWanted(skeletonDeploy);
               emitter.setVerbose(verbose);
               emitter.setDebug(debug);
  +            emitter.setQuiet(quiet);
               emitter.setTypeMappingVersion(typeMappingVersion);
               emitter.setNowrap(noWrapped);
               if (namespaceMappingFile != null) {
  @@ -286,6 +298,15 @@
        */
       public void setDebug(boolean debug) {
           this.debug = debug;
  +    }
  +
  +    /**
  +     *  flag for quiet output; default=false
  +     *
  +     *@param  quiet  The new quiet value
  +     */
  +    public void setQuiet(boolean quiet) {
  +        this.quiet = quiet;
       }
   
       /**
  
  
  

Mime
View raw message