[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-c-dev
Subject:    [Wsf-dev] [Jython] svn commit r67626 - in
From:       heshan () wso2 ! com
Date:       2010-06-05 3:59:21
Message-ID: E1OKkXZ-0002C9-TY () wso2 ! org
[Download RAW message or body]

Author: heshan
Date: Fri Jun  4 20:59:21 2010
New Revision: 67626
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=67626

Log:
Refactored code. 



Modified:
   trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/PythonDeployer.java
  trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/ComplexType.java
  trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/SchemaGenerator.java


Modified: trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/PythonDeployer.java
                
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/PythonDeployer.java?rev=67626&r1=67625&r2=67626&view=diff
 ==============================================================================
--- trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/PythonDeployer.java	(original)
                
+++ trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/PythonDeployer.java	Fri \
Jun  4 20:59:21 2010 @@ -41,6 +41,9 @@
 import org.wso2.wsf.jython.messagereceiver.PythonScriptReceiver;
 import org.wso2.wsf.jython.deployer.schemagenarator.*;
 
+/**
+ * Python service deployer.
+ */
 public class PythonDeployer implements Deployer {
     private static final Log log = LogFactory.getLog(PythonDeployer.class);
 
@@ -118,7 +121,7 @@
     }
 
     public ArrayList<AxisService> processService(DeploymentFileData currentFile,
-                                    AxisServiceGroup axisServiceGroup, String \
repoPath) +                                                 AxisServiceGroup \
axisServiceGroup, String repoPath)  throws AxisFault {
         try {
             String serviceName = \
DescriptionBuilder.getShortFileName(currentFile.getName()); @@ -128,7 +131,7 @@
             if (log.isDebugEnabled()) {
                 System.out.println(" Script Repo Path : " + repoPath);
                 log.debug(serviceName + " python script is being processed !");
-                log.debug("serviceName                :" + serviceName);
+                log.debug("serviceName                  :" + serviceName);
                 log.debug("currentFileName AbsolutePath :" + \
                currentFile.getAbsolutePath());
                 log.debug("currnetFileName              :" + currentFile.getName());
             }
@@ -196,9 +199,9 @@
      * Reads the annotations in the python script and maps the annotations to \
                schema. Generates the xml schema for the
      * python service
      *
-     * @param map             - The HashMap which contains the annotations of the \
                python service
-     * @param axisService     - The axis service
-     * @param schemaGenerator - The schema generator
+     * @param map             The HashMap which contains the annotations of the \
python service +     * @param axisService     The axis service
+     * @param schemaGenerator The schema generator
      */
     private void annotationsToSchema(HashMap map, AxisService axisService, \
SchemaGenerator schemaGenerator) {  //HashMap map = (HashMap) \
obj2.__tojava__(HashMap.class); @@ -310,7 +313,7 @@
                 inSchemaElement = schemaGenerator.createInputElement(inComplexType, \
                opName);
                 outSchemaElement = \
schemaGenerator.createOutputElement(outComplexType, opName);  } catch (Exception e) {
-                e.printStackTrace();  //To change body of catch statement use File | \
Settings | File Templates. +                e.printStackTrace();
             }
             QName inParamElementQname = inSchemaElement.getQName(); // set this to \
the QName of the in message  QName outParamElementQname = \
outSchemaElement.getQName();

Modified: trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/ComplexType.java
                
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/jython/server/core/src/main/java/org/ws \
o2/wsf/jython/deployer/schemagenarator/ComplexType.java?rev=67626&r1=67625&r2=67626&view=diff
 ==============================================================================
--- trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/ComplexType.java	(original)
                
+++ trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/ComplexType.java	Fri \
Jun  4 20:59:21 2010 @@ -20,9 +20,9 @@
 
 public class ComplexType extends Type{
 
-    private ArrayList members = new ArrayList();
+    private ArrayList<Type> members = new ArrayList<Type>();
 
-    public ArrayList getMembers() {
+    public ArrayList<Type> getMembers() {
         return members;
     }
 

Modified: trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/SchemaGenerator.java
                
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/jython/server/core/src/main/java/org/ws \
o2/wsf/jython/deployer/schemagenarator/SchemaGenerator.java?rev=67626&r1=67625&r2=67626&view=diff
 ==============================================================================
--- trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/SchemaGenerator.java	(original)
                
+++ trunk/wsf/jython/server/core/src/main/java/org/wso2/wsf/jython/deployer/schemagenarator/SchemaGenerator.java	Fri \
Jun  4 20:59:21 2010 @@ -32,6 +32,9 @@
 import javax.xml.namespace.QName;
 import java.util.Iterator;
 
+/**
+ * Schema generation class.
+ */
 public class SchemaGenerator {
 
     private String schemaTargetNamespace;
@@ -126,7 +129,7 @@
         xmlSchema.getItems().add(xmlSchemaComplexType);
 
         XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence();
-        Iterator iterator = complexType.getMembers().iterator();
+        Iterator<Type> iterator = complexType.getMembers().iterator();
         while (iterator.hasNext()) {
             Object object = iterator.next();
             XmlSchemaElement xmlSchemaElement;
@@ -183,9 +186,8 @@
         simpleType.setContent(simpleTypeRestriction);
 
         // Create enumeration facets for each value
-        for (int i = 0; i < enums.length; i++) {
-
-            String enumeration = enums[i].trim();
+        for (String anEnum : enums) {
+            String enumeration = anEnum.trim();
             XmlSchemaEnumerationFacet enumerationFacet = new \
XmlSchemaEnumerationFacet();  enumerationFacet.setValue(enumeration);
             simpleTypeRestriction.getFacets().add(enumerationFacet);

_______________________________________________
Wsf-dev mailing list
Wsf-dev@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/wsf-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic