You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2007/12/06 13:39:36 UTC

svn commit: r601717 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/utils/ integration/ integration/test-resources/ComplexDataTypes/ kernel/src/org/apache/axis2/description/java2wsdl/

Author: deepal
Date: Thu Dec  6 04:39:33 2007
New Revision: 601717

URL: http://svn.apache.org/viewvc?rev=601717&view=rev
Log:
-excluding static fields from beans 
 - fixing Jira created by Sumedha 

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
    webservices/axis2/trunk/java/modules/integration/pom.xml
    webservices/axis2/trunk/java/modules/integration/test-resources/ComplexDataTypes/ComplexDataTypes.wsdl
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=601717&r1=601716&r2=601717&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Thu Dec  6 04:39:33 2007
@@ -106,9 +106,12 @@
                                             "elementName");
             }
 
-            AxisService axisService = MessageContext.getCurrentMessageContext().getAxisService();
+            AxisService axisService = null;
+            if (MessageContext.getCurrentMessageContext() !=null) {
+                axisService = MessageContext.getCurrentMessageContext().getAxisService();
+            }
             ArrayList excludes = null;
-            if (axisService.getBeanExludeMap() !=null) {
+            if (axisService !=null && axisService.getBeanExludeMap() !=null) {
                 excludes = (ArrayList) axisService.getBeanExludeMap().get(
                         jClass.getQualifiedName());
             }
@@ -117,6 +120,9 @@
             JProperty properties [] = jClass.getDeclaredProperties();
             for (int i = 0; i < properties.length; i++) {
                 JProperty property = properties[i];
+                if (excludes != null && excludes.contains("*")) {
+                    continue;
+                }
                 //Excluding properties if it is suppose to be
                 if(excludes != null && excludes.contains(
                         getCorrectName(getCorrectName(property.getSimpleName())))) {
@@ -132,6 +138,9 @@
                     excludes = (ArrayList) map.get(supClass.getQualifiedName());
                     for (int i = 0; i < properties.length; i++) {
                         JProperty property = properties[i];
+                        if (excludes != null && excludes.contains("*")) {
+                            continue;
+                        }
                         //Excluding properties if it is suppose to be
                         if(excludes != null && excludes.contains(
                                 getCorrectName(getCorrectName(property.getSimpleName())))) {

Modified: webservices/axis2/trunk/java/modules/integration/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/pom.xml?rev=601717&r1=601716&r2=601717&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/pom.xml Thu Dec  6 04:39:33 2007
@@ -41,6 +41,10 @@
                 </exclusion>
             </exclusions>
         </dependency>
+<dependency>
+                <groupId>org.apache.geronimo.specs</groupId>
+                <artifactId>geronimo-activation_1.1_spec</artifactId>
+            </dependency>
         <dependency>
             <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-scripting</artifactId>

Modified: webservices/axis2/trunk/java/modules/integration/test-resources/ComplexDataTypes/ComplexDataTypes.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test-resources/ComplexDataTypes/ComplexDataTypes.wsdl?rev=601717&r1=601716&r2=601717&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test-resources/ComplexDataTypes/ComplexDataTypes.wsdl (original)
+++ webservices/axis2/trunk/java/modules/integration/test-resources/ComplexDataTypes/ComplexDataTypes.wsdl Thu Dec  6 04:39:33 2007
@@ -599,14 +599,8 @@
         <xs:schema xmlns:ax23="http://arrays.data.complex.tempuri.org/xsd" xmlns:ax21="http://data.complex.tempuri.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://data.complex.tempuri.org/xsd">
             <xs:import namespace="http://arrays.data.complex.tempuri.org/xsd"/>
             <xs:complexType name="BitMask">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="BIT_FIVE" nillable="true" type="ns2:BitMask"/>
-                    <xs:element minOccurs="0" name="BIT_FOUR" nillable="true" type="ns2:BitMask"/>
-                    <xs:element minOccurs="0" name="BIT_ONE" nillable="true" type="ns2:BitMask"/>
-                    <xs:element minOccurs="0" name="BIT_THREE" nillable="true" type="ns2:BitMask"/>
-                    <xs:element minOccurs="0" name="BIT_TWO" nillable="true" type="ns2:BitMask"/>
-                </xs:sequence>
-            </xs:complexType>
+                <xs:sequence/>
+            </xs:complexType> 
             <xs:complexType name="Employee">
                 <xs:sequence>
                     <xs:element minOccurs="0" name="baseDetails" nillable="true" type="ns2:Person"/>

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java?rev=601717&r1=601716&r2=601717&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java Thu Dec  6 04:39:33 2007
@@ -508,8 +508,12 @@
                         javaType.getQualifiedName());
             }
             for (int i = 0; i < tempProperties.length; i++) {
-                if(excludes != null && excludes.contains(
-                        getCorrectName(tempProperties[i].getSimpleName()))) {
+                JProperty tempProperty = tempProperties[i];
+                if (excludes !=null && excludes.contains("*")){
+                      continue;
+                }
+                if (excludes != null && excludes.contains(
+                        getCorrectName(tempProperty.getSimpleName()))) {
                     continue;
                 }
                 propertiesSet.add(tempProperties[i]);
@@ -537,9 +541,16 @@
             for (int i = 0; i < tempFields.length; i++) {
                 // create a element for the field only if it is public
                 // and there is no property with the same name
-
                 if (tempFields[i].isPublic()) {
-                    if (excludes !=null && excludes.contains(tempFields[i].getSimpleName())) {
+                    if (tempFields[i].isStatic()){
+//                        We do not need to expose static fields
+                        continue;
+                    }
+                    if (excludes != null && excludes.contains("*")) {
+                        continue;
+                    }
+                    if (excludes !=null &&
+                            excludes.contains(tempFields[i].getSimpleName())) {
                         continue;
                     }
                     // skip field with same name as a property
@@ -705,8 +716,12 @@
         if ("javax.activation.DataHandler".equals(classType)) {
             return true;
         } else {
-            JClass superClass = clazz.getSuperclass();
-            return superClass != null && isDataHandler(superClass);
+            JClass supuerClass = clazz.getSuperclass();
+            if (supuerClass != null) {
+                return isDataHandler(supuerClass);
+            } else {
+                return false;
+            }
         }
     }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java?rev=601717&r1=601716&r2=601717&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java Thu Dec  6 04:39:33 2007
@@ -411,8 +411,12 @@
             }
             JProperty[] tempProperties = javaType.getDeclaredProperties();
             for (int i = 0; i < tempProperties.length; i++) {
-                if(excludes != null && excludes.contains(
-                        getCorrectName(tempProperties[i].getSimpleName()))) {
+                JProperty tempProperty = tempProperties[i];
+                if (excludes !=null && excludes.contains("*")){
+                      continue;
+                }
+                if (excludes != null && excludes.contains(
+                        getCorrectName(tempProperty.getSimpleName()))) {
                     continue;
                 }
                 propertiesSet.add(tempProperties[i]);
@@ -440,10 +444,19 @@
             for (int i = 0; i < tempFields.length; i++) {
                 // create a element for the field only if it is public
                 // and there is no property with the same name
-                if (excludes != null && excludes.contains(tempFields[i].getSimpleName())) {
-                    continue;
-                }
                 if (tempFields[i].isPublic()) {
+
+                    if (tempFields[i].isStatic()) {
+//                        We do not need to expose static fields
+                        continue;
+                    }
+                    if (excludes != null && excludes.contains("*")) {
+                        continue;
+                    }
+                    if (excludes != null &&
+                            excludes.contains(tempFields[i].getSimpleName())) {
+                        continue;
+                    }
 
                     // skip field with same name as a property
                     if (!propertiesNames.contains(tempFields[i].getSimpleName())) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org