You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ba...@apache.org on 2008/01/18 19:07:38 UTC

svn commit: r613218 - in /webservices/axis2/trunk/java/modules/metadata: src/org/apache/axis2/jaxws/description/builder/WebServiceRefAnnot.java test/org/apache/axis2/jaxws/description/builder/SparseAnnotTests.java

Author: barrettj
Date: Fri Jan 18 10:07:35 2008
New Revision: 613218

URL: http://svn.apache.org/viewvc?rev=613218&view=rev
Log:
Mark the WebServiceRefAnnot methods that deal with Value and Type as a String deprecated.  Since the actual annotation
deals with them as a Class, it seems the Builder composite annotation should also.

Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/WebServiceRefAnnot.java
    webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/builder/SparseAnnotTests.java

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/WebServiceRefAnnot.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/WebServiceRefAnnot.java?rev=613218&r1=613217&r2=613218&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/WebServiceRefAnnot.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/WebServiceRefAnnot.java Fri Jan 18 10:07:35 2008
@@ -29,7 +29,8 @@
     private Class value;
     private String mappedName = "";
     
-    // TODO: (JLB) Remove the String versions of the Class attributes?
+    // TODO: Remove the String versions of the Class attributes when the associated deprecated 
+    // methods are removed.
     private String typeString = "";
     private String valueString = "";
 
@@ -51,7 +52,18 @@
         this.mappedName = mappedName;
     }
 
-    // TODO: (JLB) Deprecate or remove this; has both Class and String for value and type
+    /**
+     * 
+     * @deprecated The String values for type and value shouldn't be used.  Use {@link #WebServiceRefAnnot(String, String, Class, Class, String)}
+     * 
+     * @param name
+     * @param wsdlLocation
+     * @param type
+     * @param value
+     * @param mappedName
+     * @param typeString
+     * @param valueString
+     */
     private WebServiceRefAnnot(
             String name,
             String wsdlLocation,
@@ -86,12 +98,22 @@
                                       mappedName);
     }
 
-    // TODO: (JLB) Why is there both a class and String for type and value?
-    // There isn't on the actual annotation, only the class is there
-    // Looks like SERV1/ws/code/websvcs/src/com/ibm/ws/websvcs/annotations/adapters/WebServiceRefAdapter.java
-    // only reference in WAS to the string "createWebServiceRefAnnotImpl", and it sets the String values, not the classes
-    // Check with Dustin, can they give us the class (instead of string) since we may not have the right classloader
-    // to create the class when the getter is called.
+    /**
+     * 
+     * @deprecated The String values for type and value should not be used.  Use {@link #createWebServiceRefAnnotImpl(String, String, Class, Class, String)}
+     * 
+     *  There shouldn't be both a class and String for type and value; there isn't on the actual 
+     *  annotation.
+     * 
+     * @param name
+     * @param wsdlLocation
+     * @param type
+     * @param value
+     * @param mappedName
+     * @param typeString
+     * @param valueString
+     * @return
+     */
     public static WebServiceRefAnnot createWebServiceRefAnnotImpl(
             String name,
             String wsdlLocation,
@@ -136,14 +158,17 @@
         return wsdlLocation;
     }
 
-    // TODO: (JLB) Remove this?
-    /** @return Returns the typeString. */
+    /** 
+     * @deprecated Use {@link #type()} 
+     * @return Returns the typeString. 
+     */
     public String getTypeString() {
         return typeString;
     }
 
-    // TODO: (JLB) Remove this?
-    /** @return Returns the valueString. */
+    /**
+     * @deprecated Use {@link #value()} 
+     * @return Returns the valueString. */
     public String getValueString() {
         return valueString;
     }
@@ -178,14 +203,16 @@
         return wsdlLocation;
     }
 
-    // TODO: (JLB) Remove this?
-    /** @param typeString The typeString to set. */
+    /** 
+     * @deprecated Use {@link #setType(Class)}
+     * @param typeString The typeString to set. */
     public void setTypeString(String typeString) {
         this.typeString = typeString;
     }
 
-    // TODO: (JLB) Remove this?
-    /** @param valueString The valueString to set. */
+    /**
+     * @deprecated {@link #setValue(Class)} 
+     * @param valueString The valueString to set. */
     public void setValueString(String valueString) {
         this.valueString = valueString;
     }
@@ -208,10 +235,14 @@
         sb.append(newLine);
         sb.append("@WebServiceRef.mappedName= " + mappedName);
         sb.append(newLine);
-        sb.append("@WebServiceRef.type= " + typeString);
+        sb.append("@WebServiceRef.typeString= " + typeString);
+        sb.append(newLine);
+        sb.append("@WebServiceRef.type= " + ((type != null) ? type.toString() : null));
+        sb.append(newLine);
+        sb.append("@WebServiceRef.valueString= " + valueString);
         sb.append(newLine);
-        sb.append("@WebServiceRef.value= " + valueString);
+        sb.append("@WebServiceRef.value= " + ((value != null) ? value.toString() : null));
         sb.append(newLine);
-		return sb.toString();
+        return sb.toString();
 	}
 }

Modified: webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/builder/SparseAnnotTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/builder/SparseAnnotTests.java?rev=613218&r1=613217&r2=613218&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/builder/SparseAnnotTests.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/builder/SparseAnnotTests.java Fri Jan 18 10:07:35 2008
@@ -73,6 +73,29 @@
         WebServiceClient wsClient = svcDescComposite.getWebServiceClientAnnot();
         assertTrue(wsClient instanceof WebServiceClientAnnot);
     }
+    /**
+     * The WebServiceRef annotation isn't processed by the JAXWS runtime.  The container (i.e. the
+     * client container, web container, or ejb container) processes it since it is responsible for
+     * doing resource injection.  This means none of the other tests deal with WebServiceRef, so
+     * this simple test validates a few aspects of the composite annotation processing.
+     */
+    public void testWebServiceRef() {
+        org.apache.axis2.jaxws.description.builder.WebServiceRefAnnot wsr = WebServiceRefAnnot.createWebServiceRefAnnotImpl();
+        assertTrue(wsr.name().equals(""));
+        assertTrue(wsr.wsdlLocation().equals(""));
+        assertTrue("".equals(wsr.getTypeString()));
+        assertTrue("".equals(wsr.getValueString()));
+        assertNull(wsr.type());
+        assertNull(wsr.value());
+        
+        wsr = WebServiceRefAnnot.createWebServiceRefAnnotImpl("name", "wsdlLocation", String.class, Object.class, "mappedName");
+        assertTrue(wsr.name().equals("name"));
+        assertTrue(wsr.wsdlLocation().equals("wsdlLocation"));
+        assertTrue("".equals(wsr.getTypeString()));
+        assertTrue("".equals(wsr.getValueString()));
+        assertTrue(wsr.type() == String.class);
+        assertTrue(wsr.value() == Object.class);
+    }
 
 }
 



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