axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/wsdl/fromJava Emitter.java
Date Wed, 02 Jan 2002 20:30:03 GMT
scheu       02/01/02 12:30:03

  Modified:    java/src/org/apache/axis/utils XMLUtils.java
               java/src/org/apache/axis/wsdl/fromJava Emitter.java
  Log:
  Added Emitter.emitToString(mode) method
  
  Revision  Changes    Path
  1.40      +3 -0      xml-axis/java/src/org/apache/axis/utils/XMLUtils.java
  
  Index: XMLUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/XMLUtils.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- XMLUtils.java	30 Nov 2001 13:28:37 -0000	1.39
  +++ XMLUtils.java	2 Jan 2002 20:30:03 -0000	1.40
  @@ -266,6 +266,9 @@
           privateElementToWriter(doc.getDocumentElement(), writer, false, false);
       }
   
  +    public static void PrettyDocumentToWriter(Document doc, Writer writer) {
  +        privateElementToWriter(doc.getDocumentElement(), writer, false, true);
  +    }
       /**
        * Convert a simple string to an element with a text node
        * 
  
  
  
  1.6       +19 -0     xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Emitter.java	31 Dec 2001 18:31:41 -0000	1.5
  +++ Emitter.java	2 Jan 2002 20:30:03 -0000	1.6
  @@ -93,6 +93,7 @@
   
   import java.io.File;
   import java.io.FileOutputStream;
  +import java.io.StringWriter;
   import java.lang.reflect.Method;
   import java.lang.reflect.Modifier;
   import java.util.ArrayList;
  @@ -219,6 +220,24 @@
   
           // Return the document
           return doc;
  +    }
  +
  +    /**
  +     * Generates a String containing the WSDL for a given <code>Class</code>.
The sections of
  +     * the WSDL generated are controlled by the mode parameter 
  +     * mode 0: All
  +     * mode 1: Interface
  +     * mode 2: Implementation
  +     * 
  +     * @param mode generation mode - all, interface, implementation                   
 
  +     * @return String                     
  +     * @throws Exception
  +     */
  +    public String emitToString(int mode) throws Exception {
  +        Document doc = emit(mode);
  +        StringWriter sw = new StringWriter();
  +        XMLUtils.PrettyDocumentToWriter(doc, sw);
  +        return sw.toString();
       }
   
       /**
  
  
  

Mime
View raw message