axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r168580 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis/context/ core/src/org/apache/axis/storage/impl/ samples/src/interop/doclit/ wsdl/src/org/apache/axis/wsdl/databinding/ wsdl/src/org/apache/axis/wsdl/tojava/xslt/ wsdl/src/org/apache/axis/wsdl/util/
Date Fri, 06 May 2005 09:42:38 GMT
Author: ajith
Date: Fri May  6 02:42:37 2005
New Revision: 168580

URL: http://svn.apache.org/viewcvs?rev=168580&view=rev
Log:
Adding some comments and a small refactoring 

Added:
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/CsharpTypeMapper.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/JavaTypeMapper.java
Removed:
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/SimpleCsharpTypeMapper.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/SimpleJavaTypeMapper.java
Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/storage/impl/AxisFileStorage.java
    webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropProvider.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/DefaultTypeMapper.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMapper.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMappingAdapter.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/CSharpEmitter.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/ClassWriter.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/JavaEmitter.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/MultiLanguageClientEmitter.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/XSLTConstants.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/util/FileWriter.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/util/XSLTTemplateProcessor.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java
Fri May  6 02:42:37 2005
@@ -114,7 +114,6 @@
     public boolean outPutWritten = false;
 
     /**
-     * @param er            registry
      * @param initialProperties of the message context, should be null if no properties
      * @param sessionContext    of the message context, should be null if no sessionContext
      * @throws AxisFault

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/storage/impl/AxisFileStorage.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/storage/impl/AxisFileStorage.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/storage/impl/AxisFileStorage.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/storage/impl/AxisFileStorage.java
Fri May  6 02:42:37 2005
@@ -99,4 +99,6 @@
             return false;
         }
     }
+
+
 }

Modified: webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropProvider.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropProvider.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropProvider.java (original)
+++ webservices/axis/trunk/java/modules/samples/src/interop/doclit/InteropProvider.java Fri
May  6 02:42:37 2005
@@ -85,7 +85,7 @@
 
     public MessageContext invokeBusinessLogic(MessageContext msgContext) throws AxisFault{
         try {
-            if (WSDLService.STYLE_DOC.equals(msgContext.getOperationContext().getAxisOperation().getStyle()))
{
+          //   if (WSDLService.STYLE_DOC.equals(msgContext.getMessageStyle())) {
                 SOAPBody body = msgContext.getEnvelope().getBody();
                 XMLStreamReader xpp = body.getXMLStreamReader();
 
@@ -194,9 +194,9 @@
 //                msgContext.setEnvelope(responseEnvelope);
 //
 //                return msgContext;
-            } else {
-                throw new AxisFault("this Service only supports doc-lit");
-            }
+//            } else {
+//                throw new AxisFault("this Service only supports doc-lit");
+//            }
 
         } catch (SecurityException e) {
             throw AxisFault.makeFault(e);

Added: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/CsharpTypeMapper.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/CsharpTypeMapper.java?rev=168580&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/CsharpTypeMapper.java
(added)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/CsharpTypeMapper.java
Fri May  6 02:42:37 2005
@@ -0,0 +1,31 @@
+package org.apache.axis.wsdl.databinding;
+
+
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *  the C# type mapper
+ */
+public class CsharpTypeMapper extends TypeMappingAdapter{
+
+    /**
+     * Creats a basic Csharp type mapper
+     */
+    public CsharpTypeMapper() {
+        //Todo create the type mapping hastable here
+    }
+
+
+}

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/DefaultTypeMapper.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/DefaultTypeMapper.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/DefaultTypeMapper.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/DefaultTypeMapper.java
Fri May  6 02:42:37 2005
@@ -21,11 +21,23 @@
 import org.apache.axis.om.OMElement;
 
 /**
- * @author chathura@opensource.lk
+ * Copyright 2004,2005 The Apache Software Foundation.
  *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Default type mapper. Just a mock!
  */
 public class DefaultTypeMapper extends TypeMappingAdapter {
-
 	
 	public Class getTypeMapping(QName qname) {
 		return OMElement.class;

Added: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/JavaTypeMapper.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/JavaTypeMapper.java?rev=168580&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/JavaTypeMapper.java
(added)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/JavaTypeMapper.java
Fri May  6 02:42:37 2005
@@ -0,0 +1,48 @@
+package org.apache.axis.wsdl.databinding;
+
+
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *  Java type mapper implementation. It adds the following default mappings
+ * String	xsd:string
+ * Boolean	xsd:boolean
+ * boolean	xsd:boolean
+ * Double	xsd:double
+ * double	xsd:double
+ * Long	xsd:long
+ * long	xsd:long
+ * Float	xsd:float
+ * float	xsd:float
+ * Integer	xsd:int
+ * int	xsd:int
+ * Short	xsd:short
+ * short	xsd:short
+ * Byte	xsd:byte
+ * byte	xsd:byte
+ * BigDecimal	xsd:decimal
+ * GregorianCalendar	xsd:timeInstant!
+ * Date	xsd:date
+ * QName	xsd:QName
+
+ */
+public class JavaTypeMapper extends TypeMappingAdapter{
+
+    public JavaTypeMapper() {
+       this.map.put("string",String.class);
+       //add the rest todo the key should be a QName
+    }
+
+}

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMapper.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMapper.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMapper.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMapper.java
Fri May  6 02:42:37 2005
@@ -18,14 +18,43 @@
 
 import javax.xml.namespace.QName;
 
-/**
- * @author chathura@opensource.lk
- *
- */
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*  Interface for the type mapping
+*/
 public interface TypeMapper {
-	
-	public Class getTypeMapping(QName qname);
-	public String getParameterName(QName qname);
+    /**
+     * Get the type mapping class
+     * @param qname name of the XML element to be mapped
+     * @return a class that represents the particualr type
+     */
+    public Class getTypeMapping(QName qname);
+
+    /**
+     * Get the parameter name
+     * @param qname name of the XML element to get a parameter
+     * @return a unique parameter name
+     */
+    public String getParameterName(QName qname);
+
+    /**
+     * Adds a type mapping to the type mapper
+     * @param qname
+     * @param value
+     */
     public void addTypeMapping(QName qname,Object value);
 
 }

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMappingAdapter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMappingAdapter.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMappingAdapter.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMappingAdapter.java
Fri May  6 02:42:37 2005
@@ -21,23 +21,31 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
-*
+* Default abstract implementation of the type mapper
 */
 public abstract class  TypeMappingAdapter implements TypeMapper{
 
+    //hashmap that contains the type mappings
     protected  HashMap map = new HashMap();
+    //counter variable to generate unique parameter ID's
     protected int counter=0;
+    //Upper limit for the paramete count
     protected static final int UPPER_PARAM_LIMIT = 1000;
 
+    /**
+     *
+     * @see TypeMapper#getTypeMapping(javax.xml.namespace.QName)
+     */
     public Class getTypeMapping(QName qname) {
-        if (qname==null) return OMElement.class;
-
-        if (map.containsKey(qname.getLocalPart())){
+        if ((qname!=null) && map.containsKey(qname.getLocalPart())){
             return map.get(qname.getLocalPart()).getClass();
         }
         return Object.class;
     }
 
+    /**
+     * @see TypeMapper#getParameterName(javax.xml.namespace.QName)
+     */
     public String getParameterName(QName qname) {
         if (counter==UPPER_PARAM_LIMIT){
             counter=0;
@@ -45,6 +53,9 @@
         return "param" + counter++;
     }
 
+    /**
+     * @see TypeMapper#addTypeMapping(javax.xml.namespace.QName, Object)
+     */
     public void addTypeMapping(QName qname, Object value) {
         map.put(qname,value);
     }

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/CSharpEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/CSharpEmitter.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/CSharpEmitter.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/CSharpEmitter.java
Fri May  6 02:42:37 2005
@@ -3,7 +3,7 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.apache.axis.wsdl.databinding.SimpleCsharpTypeMapper;
+import org.apache.axis.wsdl.databinding.CsharpTypeMapper;
 import org.apache.axis.wsdl.databinding.TypeMapper;
 import org.apache.axis.wsdl.tojava.CodeGenConfiguration;
 import org.apache.crimson.tree.XmlDocument;
@@ -34,7 +34,7 @@
 
     public CSharpEmitter(CodeGenConfiguration configuration) {
         this.configuration = configuration;
-        this.mapper = new SimpleCsharpTypeMapper();
+        this.mapper = new CsharpTypeMapper();
 
     }
 
@@ -45,19 +45,11 @@
     }
 
 
-      /*
-    Format of the XML  - Interface
-    <interface namespace="" name="">
-        <method name="">
-            <input>
-            <param name="" type=""/>*
-            </input> ?
-            <output>
-            <param name="" type=""/>?
-            </output>?
-        </method>
-    </interface>
-*/
+    /**
+     *  @see org.apache.axis.wsdl.tojava.xslt.MultiLanguageClientEmitter#createDOMDocuementForInterface(org.apache.wsdl.WSDLBinding)
+     * @param binding
+     * @return
+     */
     protected XmlDocument createDOMDocuementForInterface(WSDLBinding binding){
         WSDLInterface boundInterface = binding.getBoundInterface();
 
@@ -98,6 +90,11 @@
 
     }
 
+    /**
+     * @see org.apache.axis.wsdl.tojava.xslt.MultiLanguageClientEmitter#createDOMDocuementForInterfaceImplementation(org.apache.wsdl.WSDLBinding)
+     * @param binding
+     * @return
+     */
     protected XmlDocument createDOMDocuementForInterfaceImplementation(WSDLBinding binding)
{
         return null;  
     }

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/ClassWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/ClassWriter.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/ClassWriter.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/ClassWriter.java
Fri May  6 02:42:37 2005
@@ -23,6 +23,9 @@
 * limitations under the License.
 *
 *
+* Abstract writer to be extended by writers. To use a class writer one needs to call the
+* methods in order
+* ususally it is setLanguage() ->loadTemplate() ->createOutFile() ->WriteOutFile()
 */
 public abstract class ClassWriter {
 

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/JavaEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/JavaEmitter.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/JavaEmitter.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/JavaEmitter.java
Fri May  6 02:42:37 2005
@@ -3,7 +3,7 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.apache.axis.wsdl.databinding.SimpleJavaTypeMapper;
+import org.apache.axis.wsdl.databinding.JavaTypeMapper;
 import org.apache.axis.wsdl.databinding.TypeMapper;
 import org.apache.axis.wsdl.tojava.CodeGenConfiguration;
 import org.apache.crimson.tree.XmlDocument;
@@ -14,50 +14,51 @@
 import org.w3c.dom.Element;
 
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * 
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* Java emiiter implementation
+*/
 public class JavaEmitter extends MultiLanguageClientEmitter{
 
+    /**
+     *
+     * @param configuration
+     */
     public JavaEmitter(CodeGenConfiguration configuration) {
         this.configuration = configuration;
-        this.mapper = new SimpleJavaTypeMapper();
+        this.mapper = new JavaTypeMapper();
 
     }
 
-     public JavaEmitter(CodeGenConfiguration configuration,TypeMapper mapper) {
+    /**
+     *
+     * @param configuration
+     * @param mapper
+     */
+    public JavaEmitter(CodeGenConfiguration configuration,TypeMapper mapper) {
         this.configuration = configuration;
         this.mapper =mapper;
 
     }
 
 
-      /*
-    Format of the XML  - Interface
-    <interface package="" name="">
-        <method name="">
-            <input>
-            <param name="" type=""/>*
-            </input> ?
-            <output>
-            <param name="" type=""/>?
-            </output>?
-        </method>
-    </interface>
-*/
+    /**
+     * @see org.apache.axis.wsdl.tojava.xslt.MultiLanguageClientEmitter#createDOMDocuementForInterface(org.apache.wsdl.WSDLBinding)
+     * @param binding
+     * @return
+     */
     protected XmlDocument createDOMDocuementForInterface(WSDLBinding binding){
         WSDLInterface boundInterface = binding.getBoundInterface();
 
@@ -72,6 +73,14 @@
         nameAttribute.setValue(boundInterface.getName().getLocalPart());
         rootElement.setAttributeNode(nameAttribute);
 
+        loadOperations(boundInterface, doc, rootElement);
+
+        doc.appendChild(rootElement);
+        return doc;
+
+    }
+
+    private void loadOperations(WSDLInterface boundInterface, XmlDocument doc, Element rootElement)
{
         Collection col = boundInterface.getOperations().values();
 
         Element methodElement = null;
@@ -93,52 +102,34 @@
             rootElement.appendChild(methodElement);
 
         }
-       doc.appendChild(rootElement);
-       return doc;
-
     }
 
+    /**
+     * @see org.apache.axis.wsdl.tojava.xslt.MultiLanguageClientEmitter#createDOMDocuementForInterfaceImplementation(org.apache.wsdl.WSDLBinding)

+     * @param binding
+     * @return
+     */
     protected XmlDocument createDOMDocuementForInterfaceImplementation(WSDLBinding binding)
{
         WSDLInterface boundInterface = binding.getBoundInterface();
 
-               XmlDocument doc = new XmlDocument();
-               Element rootElement = doc.createElement("class");
-
-               Attr packageAttribute = doc.createAttribute("package");
-               packageAttribute.setValue("something"); //todo set this
-               rootElement.setAttributeNode(packageAttribute);
-
-               Attr nameAttribute = doc.createAttribute("name");
-               nameAttribute.setValue(boundInterface.getName().getLocalPart()+"impl");
-               rootElement.setAttributeNode(nameAttribute);
-
-               Attr InterfaceNameAttribute = doc.createAttribute("interfaceName");
-               InterfaceNameAttribute.setValue(boundInterface.getName().getLocalPart());
-               rootElement.setAttributeNode(InterfaceNameAttribute);
-
-               Collection col = boundInterface.getOperations().values();
-
-               Element methodElement = null;
-               Attr methodNameAttr = null;
-               WSDLOperation operation = null;
-
-               for (Iterator iterator = col.iterator(); iterator.hasNext();) {
-
-                   operation = (WSDLOperation) iterator.next();
-
-                   methodElement = doc.createElement("method");
-                   methodNameAttr = doc.createAttribute("name");
-                   methodNameAttr.setValue(operation.getName().getLocalPart());
-                   methodElement.setAttributeNode(methodNameAttr);
+        XmlDocument doc = new XmlDocument();
+        Element rootElement = doc.createElement("class");
 
-                   methodElement.appendChild(getInputElement(doc,operation));
-                   methodElement.appendChild(getOutputElement(doc,operation));
+        Attr packageAttribute = doc.createAttribute("package");
+        packageAttribute.setValue("something"); //todo set this
+        rootElement.setAttributeNode(packageAttribute);
 
-                   rootElement.appendChild(methodElement);
+        Attr nameAttribute = doc.createAttribute("name");
+        nameAttribute.setValue(boundInterface.getName().getLocalPart()+"Stub");
+        rootElement.setAttributeNode(nameAttribute);
 
-               }
-              doc.appendChild(rootElement);
-              return doc;
+        Attr InterfaceNameAttribute = doc.createAttribute("interfaceName");
+        InterfaceNameAttribute.setValue(boundInterface.getName().getLocalPart());
+        rootElement.setAttributeNode(InterfaceNameAttribute);
+
+        loadOperations(boundInterface, doc, rootElement);
+        doc.appendChild(rootElement);
+        return doc;
 
     }
 }

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/MultiLanguageClientEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/MultiLanguageClientEmitter.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/MultiLanguageClientEmitter.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/MultiLanguageClientEmitter.java
Fri May  6 02:42:37 2005
@@ -31,41 +31,54 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
-*
+* Abstract Client emitter
+* the XML will look like the following
+* todo escape the following
+* <pre>
+    <interface package="">
+    <method name="">
+    <input>
+        <param name="" type=""/>*
+    </input> ?
+    <output>
+        <param name="" type=""/>?
+    </output>?
+    </method>
+    </interface>
+  </pre>
 */
 
-/*
-Format of the XML  - Interface
-<interface package="">
-<method name="">
-<input>
-<param name="" type=""/>*
-</input> ?
-<output>
-<param name="" type=""/>?
-</output>?
-</method>
 
-</interface>
-*/
 public abstract class MultiLanguageClientEmitter implements Emitter{
 
     protected InputStream xsltStream = null;
     protected CodeGenConfiguration configuration;
     protected TypeMapper mapper;
 
-
+   /**
+    * Sets the mapper
+    * @see org.apache.axis.wsdl.databinding.TypeMapper
+    * @param mapper
+    */
     public void setMapper(TypeMapper mapper) {
         this.mapper = mapper;
     }
 
+    /**
+     * Sets the code generator configuration
+     * @param configuration
+     */
     public void setCodeGenConfiguration(CodeGenConfiguration configuration) {
         this.configuration = configuration;
     }
 
-
+   /**
+    *
+    * @see org.apache.axis.wsdl.tojava.emitter.Emitter#emitStub()
+    */
     public void emitStub() throws CodeGenerationException {
         try {
+            //get the binding
             WSDLBinding axisBinding = this.configuration.getWom().getBinding(AxisBindingBuilder.AXIS_BINDING_QNAME);
             //write interfaces
             writeInterfaces(axisBinding);
@@ -77,6 +90,11 @@
         }
     }
 
+    /**
+     * Writes the interfaces
+     * @param axisBinding
+     * @throws Exception
+     */
     private void writeInterfaces(WSDLBinding axisBinding) throws Exception {
         XmlDocument interfaceModel = createDOMDocuementForInterface(axisBinding);
         InterfaceWriter interfaceWriter =
@@ -86,6 +104,11 @@
        writeClasses(interfaceModel,interfaceWriter);
     }
 
+    /**
+     * Writes the implementations
+     * @param axisBinding
+     * @throws Exception
+     */
     private void writeInterfaceImplementations(WSDLBinding axisBinding) throws Exception
{
         XmlDocument interfaceImplModel = createDOMDocuementForInterfaceImplementation(axisBinding);
         InterfaceImplementationWriter interfaceImplWriter =
@@ -94,6 +117,14 @@
                 );
         writeClasses(interfaceImplModel,interfaceImplWriter);
     }
+
+    /**
+     * A resusable method for the implementation of interface and implementation writing
+     * @param model
+     * @param writer
+     * @throws IOException
+     * @throws Exception
+     */
     private void writeClasses(XmlDocument model,ClassWriter writer) throws IOException,Exception
{
         ByteArrayOutputStream memoryStream = new ByteArrayOutputStream();
         model.write(memoryStream);
@@ -102,14 +133,34 @@
                 model.getDocumentElement().getAttribute("name"));
         writer.writeOutFile(new ByteArrayInputStream(memoryStream.toByteArray()));
     }
+
+    /**
+     * @see org.apache.axis.wsdl.tojava.emitter.Emitter#emitSkeleton()
+     */
     public void emitSkeleton() throws CodeGenerationException {
         throw new UnsupportedOperationException("Not supported yet");
     }
 
+    /**
+     * Creates the DOM tree for the interface creation
+     * @param binding
+     * @return
+     */
     protected abstract XmlDocument createDOMDocuementForInterface(WSDLBinding binding);
 
+    /**
+     * Creates the DOM tree for implementations
+     * @param binding
+     * @return
+     */
     protected abstract XmlDocument createDOMDocuementForInterfaceImplementation(WSDLBinding
binding);
 
+    /**
+     * Finds the input element for the xml document
+     * @param doc
+     * @param operation
+     * @return
+     */
     protected Element getInputElement(XmlDocument doc,WSDLOperation operation){
         Element inputElt = doc.createElement("input");
         //todo this should be multiple
@@ -126,6 +177,12 @@
         return inputElt;
     }
 
+    /**
+     * Finds the output element for the output element
+     * @param doc
+     * @param operation
+     * @return
+     */
     protected Element getOutputElement(XmlDocument doc,WSDLOperation operation){
         Element outputElt = doc.createElement("output");
         Element param = doc.createElement("param");

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/XSLTConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/XSLTConstants.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/XSLTConstants.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/tojava/xslt/XSLTConstants.java
Fri May  6 02:42:37 2005
@@ -15,21 +15,31 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
-*
+*   Constants for the XSLT related items
 */
 public interface XSLTConstants {
+    /**
+     * Language constants
+     */
     public interface LanguageTypes{
+
         public static final int JAVA=1;
         public static final int C_SHARP=2;
         public static final int C_PLUS_PLUS=3;
         public static final int VB_DOT_NET=4;
     }
 
+    /**
+     * Interface templates
+     */
     public interface XSLTInterfaceTemplates{
         public static final String JAVA_TEMPLATE = "/org/apache/axis/wsdl/template/java/InterfaceTemplate.xsl";
         public static final String CSHARP_TEMPLATE = "/org/apache/axis/wsdl/template/csharp/InterfaceTemplate.xsl";
     }
 
+    /**
+     * Interface implementation templates
+     */
     public interface XSLTInterfaceImplementationTemplates{
         public static final String JAVA_TEMPLATE = "/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl";
         public static final String CSHARP_TEMPLATE = "/org/apache/axis/wsdl/template/csharp/InterfaceImplementationTemplate.xsl";

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/util/FileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/util/FileWriter.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/util/FileWriter.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/util/FileWriter.java
Fri May  6 02:42:37 2005
@@ -20,11 +20,21 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
-*
+*  File writer utility for writing out class files
 */
 public class FileWriter {
 
-    public static File createClassFile(File rootLocation,String packageName,String javaFileName,int
fileType) throws IOException,Exception{
+    /**
+     * Creates/ returns a file object
+     * @param rootLocation - Location to be written
+     * @param packageName - package, can be '.' seperated
+     * @param fileName name of the file
+     * @param fileType  type of the file, java, csharp, cpp etc
+     * @return  the File that was created
+     * @throws IOException
+     * @throws Exception
+     */
+    public static File createClassFile(File rootLocation,String packageName,String fileName,int
fileType) throws IOException,Exception{
 
         File returnFile = null;
         File root = rootLocation;
@@ -46,11 +56,11 @@
 
         String extension = getExtension(fileType);
 
-        if (!javaFileName.endsWith(extension)){
-            javaFileName = javaFileName + extension;
+        if (!fileName.endsWith(extension)){
+            fileName = fileName + extension;
         }
 
-        returnFile = new File(root,javaFileName);
+        returnFile = new File(root,fileName);
 
         if (!returnFile.exists()){
             returnFile.createNewFile();
@@ -61,6 +71,11 @@
         return returnFile;
     }
 
+    /**
+     * Find the extension for a given file type
+     * @param fileType
+     * @return
+     */
     private static String getExtension(int fileType) {
         String extension = "";
         switch (fileType){

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/util/XSLTTemplateProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/util/XSLTTemplateProcessor.java?rev=168580&r1=168579&r2=168580&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/util/XSLTTemplateProcessor.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/util/XSLTTemplateProcessor.java
Fri May  6 02:42:37 2005
@@ -29,18 +29,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
- * 
+ *  The XSLT template processor
+ * this is based on the JDK built in transformers
  */
 public class XSLTTemplateProcessor {
 
-    public static  void parse(OutputStream out,InputStream xmlStream,InputStream xsltStream)
throws TransformerFactoryConfigurationError,TransformerException {
-
+    /**
+     * Parses an XML stream with an XSL stream
+     * @param out Stream to write the output
+     * @param xmlStream Source XML stream
+     * @param xsltStream Source XSL stream
+     * @throws TransformerFactoryConfigurationError
+     * @throws TransformerException
+     */
+    public static  void parse(OutputStream out,InputStream xmlStream,InputStream xsltStream)
+            throws TransformerFactoryConfigurationError,TransformerException {
             Source xmlSource = new StreamSource(xmlStream);
             Source xsltSource =  new StreamSource(xsltStream);
             Result result = new StreamResult(out);
             Transformer transformer = TransformerFactory.newInstance().newTransformer(xsltSource);
-            //set propoerties to remove the XML declaration
-            //transformer.setOutputProperty();
             transformer.transform(xmlSource, result);
 
     }



Mime
View raw message