axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ngalla...@apache.org
Subject svn commit: r501235 - in /webservices/axis2/trunk/java/modules/metadata: src/org/apache/axis2/jaxws/description/builder/ src/org/apache/axis2/jaxws/description/builder/converter/ test/org/apache/axis2/jaxws/description/builder/converter/
Date Mon, 29 Jan 2007 23:35:56 GMT
Author: ngallardo
Date: Mon Jan 29 15:35:55 2007
New Revision: 501235

URL: http://svn.apache.org/viewvc?view=rev&rev=501235
Log:
AXIS2-2059
Contributor: Dustin Amrhein

Dustin's patch for the reflection based DBC converter.

Added:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/TMAnnotationComposite.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/TMFAnnotationComposite.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaClassToDBCConverter.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaFieldsToFDCConverter.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaParamToPDCConverter.java
    webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/builder/converter/
    webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/builder/converter/ReflectiveConverterTests.java
Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderComposite.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MethodDescriptionComposite.java

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderComposite.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderComposite.java?view=diff&rev=501235&r1=501234&r2=501235
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderComposite.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderComposite.java Mon Jan 29 15:35:55 2007
@@ -10,7 +10,7 @@
 
 import javax.wsdl.Definition;
 
-public class DescriptionBuilderComposite {
+public class DescriptionBuilderComposite implements TMAnnotationComposite, TMFAnnotationComposite {
 	/*
 	 * This structure contains the full reflected class, as well as, the
 	 * possible annotations found for this class...the class description 
@@ -356,6 +356,10 @@
 	public void addWebServiceRefAnnot(
 			WebServiceRefAnnot webServiceRefAnnot) {
 		webServiceRefAnnotList.add(webServiceRefAnnot);
+	}
+	
+	public void setWebServiceRefAnnot(WebServiceRefAnnot webServiceRefAnnot) {
+		addWebServiceRefAnnot(webServiceRefAnnot);
 	}
 
 	/**

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java?view=diff&rev=501235&r1=501234&r2=501235
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java Mon Jan 29 15:35:55 2007
@@ -4,7 +4,7 @@
 package org.apache.axis2.jaxws.description.builder;
 
 
-public class FieldDescriptionComposite {
+public class FieldDescriptionComposite implements TMFAnnotationComposite {
 	
 	//Method reflective information
 	private String 	fieldName;		//field name

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MethodDescriptionComposite.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MethodDescriptionComposite.java?view=diff&rev=501235&r1=501234&r2=501235
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MethodDescriptionComposite.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MethodDescriptionComposite.java Mon Jan 29 15:35:55 2007
@@ -7,7 +7,7 @@
 import java.util.Iterator;
 import java.util.List;
 
-public class MethodDescriptionComposite {
+public class MethodDescriptionComposite implements TMAnnotationComposite, TMFAnnotationComposite {
 	
 	//Method reflective information
 	private String 		methodName;	//a public method name in this class

Added: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/TMAnnotationComposite.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/TMAnnotationComposite.java?view=auto&rev=501235
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/TMAnnotationComposite.java (added)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/TMAnnotationComposite.java Mon Jan 29 15:35:55 2007
@@ -0,0 +1,13 @@
+package org.apache.axis2.jaxws.description.builder;
+
+/**
+ * This interface will be implemented by the DescriptionBuilderComposite
+ * and MethodDescriptionComposite. It will declare setters for annotation
+ * types that are common to Types and Methods.
+ *
+ */
+public interface TMAnnotationComposite {
+
+	public void setSoapBindingAnnot(SoapBindingAnnot sbAnnot);
+	
+}

Added: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/TMFAnnotationComposite.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/TMFAnnotationComposite.java?view=auto&rev=501235
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/TMFAnnotationComposite.java (added)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/TMFAnnotationComposite.java Mon Jan 29 15:35:55 2007
@@ -0,0 +1,15 @@
+package org.apache.axis2.jaxws.description.builder;
+
+/**
+ * This interface will be implemented by the DescriptionBuilderComposite,
+ * MethodDescriptionComposite, and FieldDescriptionCompoiste. It will 
+ * declare setters for annotation types that are common to Types, Methods,
+ * and Fields.
+ *
+ */
+public interface TMFAnnotationComposite {
+	
+	public void setHandlerChainAnnot(HandlerChainAnnot hcAnnot);
+
+	public void setWebServiceRefAnnot(WebServiceRefAnnot wsrAnnot);
+}

Added: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java?view=auto&rev=501235
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java (added)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/ConverterUtils.java Mon Jan 29 15:35:55 2007
@@ -0,0 +1,205 @@
+package org.apache.axis2.jaxws.description.builder.converter;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.List;
+
+import javax.jws.HandlerChain;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.WebServiceRef;
+
+import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
+import org.apache.axis2.jaxws.description.builder.FieldDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.HandlerChainAnnot;
+import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.SoapBindingAnnot;
+import org.apache.axis2.jaxws.description.builder.TMAnnotationComposite;
+import org.apache.axis2.jaxws.description.builder.TMFAnnotationComposite;
+import org.apache.axis2.jaxws.description.builder.WebServiceRefAnnot;
+
+public class ConverterUtils {
+	
+	/**
+	 * Helper method to retrieve the annotation specified by a certain <code>Class</code>
+	 * @param annotationClass - <code>Class</code> the annotation <code>Class</code>
+	 * @param element - <code>AnnotatedElement</code> - the element on which we are 
+	 * looking for the annotation (i.e. Class, Method, Field)
+	 * @return - <code>Annotation</code> annotation represented by the given <code>Class</code>
+	 */
+	public static Annotation getAnnotation(Class annotationClass, AnnotatedElement element) {
+		return element.getAnnotation(annotationClass);
+	}
+	/**
+	 * This is a helper method to create a <code>HandlerChainAnnot</code> since the
+	 * @HandlerChain annotation may be present on a Type, Method, or Field.
+	 * @param handlerChain - <code>HandlerChain</code>
+	 * @return - <code>HandlerChainAnnot</code>
+	 */
+	public static HandlerChainAnnot createHandlerChainAnnot(HandlerChain handlerChain) {
+		HandlerChainAnnot hcAnnot = HandlerChainAnnot.createHandlerChainAnnotImpl();
+		hcAnnot.setFile(handlerChain.file());
+		hcAnnot.setName(handlerChain.name());
+		return hcAnnot;
+	}
+	
+	/**
+	 * This is a helper method to create a <code>SoapBindingAnnot</code> since the
+	 * @SOAPBinding annotation may be present on a Type or Method.
+	 * @param soapBinding - <code>SOAPBinding</code>
+	 * @return - <code>SoapBindingAnnot</code>
+	 */
+	public static SoapBindingAnnot createSoapBindingAnnot(SOAPBinding soapBinding) {
+		SoapBindingAnnot sbAnnot = SoapBindingAnnot.createSoapBindingAnnotImpl();
+		sbAnnot.setParameterStyle(soapBinding.parameterStyle());
+		sbAnnot.setStyle(soapBinding.style());
+		sbAnnot.setUse(soapBinding.use());
+		return sbAnnot;
+	}
+	
+	/**
+	 * This is a helper method to create a <code>WebServiceRefAnnot</code> since the
+	 * @WebServiceRef annotation may be present on a Type, Method, or Field.
+	 * @param webServiceRef - <code>WebServiceRef</code>
+	 * @return - <code>WebServiceRefAnnot</code>
+	 */
+	public static WebServiceRefAnnot createWebServiceRefAnnot(WebServiceRef webServiceRef) {
+		WebServiceRefAnnot wsrAnnot = WebServiceRefAnnot.createWebServiceRefAnnotImpl();
+		wsrAnnot.setMappedName(webServiceRef.mappedName());
+		wsrAnnot.setName(webServiceRef.name());
+		wsrAnnot.setType(webServiceRef.type());
+		wsrAnnot.setValue(webServiceRef.value());
+		wsrAnnot.setWsdlLocation(webServiceRef.wsdlLocation());
+		return wsrAnnot;
+	}
+	
+	/**
+	 * This method is use to attach @HandlerChain annotation data to a composite 
+	 * object.
+	 * @param composite - <code>TMFAnnotationComposite</code>
+	 * @param annotatedElement - <code>AnnotatedElement</code>
+	 */
+	public static void attachHandlerChainAnnotation(TMFAnnotationComposite composite, 
+			AnnotatedElement annotatedElement) {
+		HandlerChain handlerChain = (HandlerChain) ConverterUtils.getAnnotation(
+				HandlerChain.class, annotatedElement);
+		if(handlerChain != null) {
+			HandlerChainAnnot hcAnnot = ConverterUtils.createHandlerChainAnnot(
+					handlerChain);
+			composite.setHandlerChainAnnot(hcAnnot);
+		}
+	}
+
+	/**
+	 * This method is use to attach @SOAPBinding annotation data to a composite 
+	 * object.
+	 * @param composite - <code>TMAnnotationComposite</code>
+	 * @param annotatedElement - <code>AnnotatedElement</code>
+	 */
+	public static void attachSoapBindingAnnotation(TMAnnotationComposite composite, 
+			AnnotatedElement annotatedElement) {
+		SOAPBinding soapBinding = (SOAPBinding) ConverterUtils.getAnnotation(
+				SOAPBinding.class, annotatedElement);
+		if(soapBinding != null) {
+			SoapBindingAnnot sbAnnot = ConverterUtils.createSoapBindingAnnot(soapBinding);
+			composite.setSoapBindingAnnot(sbAnnot);
+		}
+	}
+	
+	/**
+	 * This method is use to attach @WebServiceRef annotation data to a composite 
+	 * object.
+	 * @param composite - <code>TMFAnnotationComposite</code>
+	 * @param annotatedElement - <code>AnnotatedElement</code>
+	 */
+	public static void attachWebServiceRefAnnotation(TMFAnnotationComposite composite, 
+			AnnotatedElement annotatedElement) {
+		WebServiceRef webServiceRef = (WebServiceRef) ConverterUtils.getAnnotation(
+				WebServiceRef.class, annotatedElement);
+		if(webServiceRef != null) {
+			WebServiceRefAnnot wsrAnnot = ConverterUtils.createWebServiceRefAnnot(
+					webServiceRef);
+			composite.setWebServiceRefAnnot(wsrAnnot);
+		}
+	}
+	
+	/**
+	 * This method will add FieldDescriptionComposite objects to a DescriptionBuilderComposite
+	 */
+	public static void attachFieldDescriptionComposites(DescriptionBuilderComposite 
+			composite, List<FieldDescriptionComposite> fdcList) {
+		for(FieldDescriptionComposite fdc : fdcList) {
+			composite.addFieldDescriptionComposite(fdc);
+		}
+	}
+	
+	/**
+	 * This method will add MethodDescriptionComposite objects to a DescriptionBuilderComposite
+	 */
+	public static void attachMethodDescriptionComposites(DescriptionBuilderComposite 
+			composite, List<MethodDescriptionComposite> mdcList) {
+		for(MethodDescriptionComposite mdc : mdcList) {
+			composite.addMethodDescriptionComposite(mdc);
+			mdc.setDescriptionBuilderCompositeRef(composite);
+		}
+	}
+	
+	/**
+	 * This method will add ParameterDescriptionComposite objects to a MethodDescriptionComposite
+	 */
+	public static void attachParameterDescriptionComposites(List
+			<ParameterDescriptionComposite> pdcList, MethodDescriptionComposite mdc) {
+		for(ParameterDescriptionComposite pdc : pdcList) {
+			mdc.addParameterDescriptionComposite(pdc);
+			pdc.setMethodDescriptionCompositeRef(mdc);
+		}
+	}
+	
+	/**
+	 * This method will check to see if a method's declaring class is the Object class.
+	 * @param method - <code>Method</code>
+	 * @return - <code>boolean</code>
+	 */
+	public static boolean isInherited(Method method, String declaringClass) {
+		if(method.getDeclaringClass().getName().equals(declaringClass)) {
+			return false;
+		}
+		return true;
+	}
+	
+	/**
+	 * This method will construct a <code>String</code> that represents the
+	 * full type of a parameterized variable.
+	 * @param pt - <code>ParameterizedType</code>
+	 * @param paramType - <code>String</code>
+	 * @return - <code>String</code>
+	 */
+	public static String getFullType(ParameterizedType pt, String paramType) {
+		if(pt.getRawType() instanceof Class) {
+			Class rawClass = (Class) pt.getRawType();
+			paramType = paramType + rawClass.getName();
+		}
+		Type[] genericTypes = pt.getActualTypeArguments();
+		if(genericTypes.length > 0) {
+			paramType = paramType + "<";
+			for(int i=0; i < genericTypes.length; i++) {
+				Type type = genericTypes[i];
+				if(type instanceof Class) {
+					if(i != genericTypes.length -1){
+						paramType = paramType + ((Class) type).getName() + ", ";
+					}
+					else {
+						paramType = paramType + ((Class) type).getName() + ">";
+					}
+				}
+				if(type instanceof ParameterizedType) {
+					paramType = getFullType((ParameterizedType)type, paramType) + ", ";
+				}
+			}
+		}
+		return paramType;
+	}
+}

Added: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaClassToDBCConverter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaClassToDBCConverter.java?view=auto&rev=501235
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaClassToDBCConverter.java (added)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaClassToDBCConverter.java Mon Jan 29 15:35:55 2007
@@ -0,0 +1,307 @@
+package org.apache.axis2.jaxws.description.builder.converter;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebFault;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.WebServiceRefs;
+
+import org.apache.axis2.jaxws.description.builder.*;
+
+public class JavaClassToDBCConverter {
+
+	private Class serviceClass;
+	
+	private String seiClassName;
+	
+	private List<Class> classes;
+	
+	public JavaClassToDBCConverter(Class serviceClass){
+		this.serviceClass = serviceClass;
+		classes = new ArrayList<Class>();
+		establishClassHierarchy(serviceClass);
+		establishInterfaceHierarchy(serviceClass.getInterfaces());
+	}
+	
+	/**
+	 * The only method we will expose to users of this class. It will 
+	 * trigger the creation of the <code>DescriptionBuilderComposite</code>
+	 * based on our service class. It will also handle the case of an impl
+	 * class that references an SEI.
+	 * @return - <code>DescriptionBuilderComposite</code>
+	 */
+	public HashMap<String, DescriptionBuilderComposite> produceDBC() {
+		HashMap<String, DescriptionBuilderComposite> dbcMap = new HashMap<String, 
+			DescriptionBuilderComposite>();
+		for(int i=0; i < classes.size(); i++ ) {
+			serviceClass = classes.get(i);
+			DescriptionBuilderComposite composite = new DescriptionBuilderComposite();
+			introspectClass(composite);
+			dbcMap.put(composite.getClassName(), composite);
+			if(seiClassName != null && !seiClassName.equals("")) {
+				DescriptionBuilderComposite seiComposite = new DescriptionBuilderComposite();
+				try {
+					serviceClass = Thread.currentThread().getContextClassLoader().loadClass(seiClassName);
+					if(serviceClass != null) {
+						introspectClass(seiComposite);
+						dbcMap.put(seiComposite.getClassName(), seiComposite);
+					}
+				}
+				catch(ClassNotFoundException e) {
+					System.out.println("DUSTIN CLASS NOT FOUND");
+				}
+			}
+		}
+		return dbcMap;
+	}
+	
+	/**
+	 * This method will drive the introspection of the class-level information.
+	 * It will store the gathered information in the pertinent data members
+	 * of the <code>DescriptionBuilderComposite</code>
+	 * @param composite - <code>DescriptionBuilderComposite</code>
+	 */
+	private void introspectClass(DescriptionBuilderComposite composite) {
+		// Need to investigate this, probably want to specify 
+		composite.setClassLoader(serviceClass.getClassLoader());
+		composite.setIsInterface(serviceClass.isInterface());
+		composite.setSuperClassName(serviceClass.getSuperclass() != null ? serviceClass.
+				getSuperclass().getName() : null);
+		composite.setClassName(serviceClass.getName());
+		setInterfaces(composite);
+		setTypeTargettedAnnotations(composite);
+		if(serviceClass.getFields().length > 0) {
+			JavaFieldsToFDCConverter fieldConverter = new JavaFieldsToFDCConverter(
+					serviceClass.getFields());
+			List<FieldDescriptionComposite> fdcList = fieldConverter.convertFields();
+			ConverterUtils.attachFieldDescriptionComposites(composite, fdcList);
+		}
+		if(serviceClass.getMethods().length> 0) {
+			JavaMethodsToMDCConverter methodConverter = new JavaMethodsToMDCConverter(
+					serviceClass.getMethods(), serviceClass.getName());
+			List<MethodDescriptionComposite> mdcList = methodConverter.convertMethods();
+			ConverterUtils.attachMethodDescriptionComposites(composite, mdcList);	
+		}
+	}
+	
+	/**
+	 * This method is responsible for finding any interfaces implemented by the 
+	 * service class. We will then set these as a list of fully qualified class
+	 * names on the <code>DescriptionBuilderComposite</code>
+	 * @param composite <code>DescriptionBuilderComposite</code>
+	 */
+	private void setInterfaces(DescriptionBuilderComposite composite) {
+		Class[] interfaces = serviceClass.getInterfaces();
+		List<String> interfaceList = interfaces.length > 0 ? new ArrayList<String>()
+				: null;
+		for(int i=0; i < interfaces.length; i++) {
+			interfaceList.add(interfaces[i].getName());
+		}
+		// We only want to set this list if we found interfaces b/c the
+		// DBC news up an interface list as part of its static initialization.
+		// Thus, if we set this list to null we may cause an NPE
+		if(interfaceList != null) {
+			composite.setInterfacesList(interfaceList);
+		}
+	}
+	
+	/**
+	 * This method will drive the attachment of Type targetted annotations to the
+	 * <code>DescriptionBuilderComposite</code>
+	 * @param composite - <code>DescriptionBuilderComposite</code>
+	 */
+	private void setTypeTargettedAnnotations(DescriptionBuilderComposite composite) {
+		attachBindingTypeAnnotation(composite);
+		attachHandlerChainAnnotation(composite);
+		attachServiceModeAnnotation(composite);
+		attachSoapBindingAnnotation(composite);
+		attachWebFaultAnnotation(composite);
+		attachWebServiceAnnotation(composite);
+		attachWebServiceClientAnnotation(composite);
+		attachWebServiceProviderAnnotation(composite);
+		attachWebServiceRefsAnnotation(composite);
+		attachWebServiceRefAnnotation(composite);
+	}
+	
+	/**
+	 * This method will be used to attach @WebService annotation data to the 
+	 * <code>DescriptionBuildercomposite</code>
+	 * @param composite - <code>DescriptionBuilderComposite</code>
+	 */
+	private void attachWebServiceAnnotation(DescriptionBuilderComposite composite) {
+		WebService webService = (WebService) ConverterUtils.getAnnotation(
+				WebService.class, serviceClass);
+		if(webService != null) {
+			// Attach @WebService annotated data
+			WebServiceAnnot wsAnnot = WebServiceAnnot.createWebServiceAnnotImpl();
+			wsAnnot.setEndpointInterface(webService.endpointInterface());
+			// check for SEI and save name if necessary
+			seiClassName = webService.endpointInterface();
+			wsAnnot.setName(webService.name());
+			wsAnnot.setPortName(webService.portName());
+			wsAnnot.setServiceName(webService.serviceName());
+			wsAnnot.setTargetNamespace(webService.targetNamespace());
+			wsAnnot.setWsdlLocation(wsAnnot.wsdlLocation());
+			composite.setWebServiceAnnot(wsAnnot);
+		}
+	}
+	
+	/**
+	 * This method will be used to attach @WebServiceClient annotation data to 
+	 * the  <code>DescriptionBuildercomposite</code>
+	 * @param composite - <code>DescriptionBuilderComposite</code>
+	 */
+	private void attachWebServiceClientAnnotation(DescriptionBuilderComposite composite) {
+		WebServiceClient webServiceClient = (WebServiceClient) ConverterUtils.
+			getAnnotation(WebServiceClient.class, serviceClass);
+		if(webServiceClient != null) {
+			
+		}
+		
+	}
+	
+	/**
+	 * This method will be used to attach @WebServiceProvider annotation data to 
+	 * the <code>DescriptionBuilderComposite</code>
+	 * @param composite - <code>DescriptionBuildercomposite</code>
+	 */
+	private void attachWebServiceProviderAnnotation(DescriptionBuilderComposite composite) {
+		WebServiceProvider webServiceProvider = (WebServiceProvider) ConverterUtils.
+			getAnnotation(WebServiceProvider.class, serviceClass);
+		if(webServiceProvider != null) {
+			// Attach @WebServiceProvider annotation data
+			WebServiceProviderAnnot wspAnnot = WebServiceProviderAnnot.
+				createWebServiceAnnotImpl();
+			wspAnnot.setPortName(webServiceProvider.portName());
+			wspAnnot.setServiceName(webServiceProvider.serviceName());
+			wspAnnot.setTargetNamespace(webServiceProvider.targetNamespace());
+			wspAnnot.setWsdlLocation(webServiceProvider.wsdlLocation());
+			composite.setWebServiceProviderAnnot(wspAnnot);
+		}
+	}
+	
+	/**
+	 * This method will be used to attach @BindingType annotation data to 
+	 * the <code>DescriptionBuilderComposite</code>
+	 * @param composite - <code>DescriptionBuildercomposite</code>
+	 */
+	private void attachBindingTypeAnnotation(DescriptionBuilderComposite composite) {
+		BindingType bindingType = (BindingType) ConverterUtils.getAnnotation(
+				BindingType.class, serviceClass);
+		if(bindingType != null) {
+			// Attach @BindingType annotation data
+			BindingTypeAnnot btAnnot = BindingTypeAnnot.createBindingTypeAnnotImpl();
+			btAnnot.setValue(bindingType.value());
+			composite.setBindingTypeAnnot(btAnnot);
+		}
+	}
+	
+	/**
+	 * This method will be used to attach @HandlerChain annotation data to 
+	 * the <code>DescriptionBuilderComposite</code>
+	 * @param composite - <code>DescriptionBuildercomposite</code>
+	 */
+	private void attachHandlerChainAnnotation(DescriptionBuilderComposite composite){
+		ConverterUtils.attachHandlerChainAnnotation(composite, serviceClass);
+	}
+	
+	/**
+	 * This method will be used to attach @ServiceMode annotation data to 
+	 * the <code>DescriptionBuilderComposite</code>
+	 * @param composite - <code>DescriptionBuildercomposite</code>
+	 */
+	private void attachServiceModeAnnotation(DescriptionBuilderComposite composite) {
+		ServiceMode serviceMode = (ServiceMode) ConverterUtils.getAnnotation(
+				ServiceMode.class, serviceClass);
+		if(serviceMode != null) {
+			// Attach @ServiceMode annotated data
+			ServiceModeAnnot smAnnot = ServiceModeAnnot.createWebServiceAnnotImpl();
+			smAnnot.setValue(serviceMode.value());
+			composite.setServiceModeAnnot(smAnnot);
+		}
+	}
+	
+	/**
+	 * This method will be used to drive the setting of @SOAPBinding annotation
+	 * data to the <code>DescriptionBuilderComposite</code>
+	 * @param composite - <code>DescriptionBuildercomposite</code>
+	 */
+	private void attachSoapBindingAnnotation(DescriptionBuilderComposite composite) {
+		ConverterUtils.attachSoapBindingAnnotation(composite, serviceClass);
+	}
+	
+	/**
+	 * This method will be used to attach @WebFault annotation data to the 
+	 * <code>DescriptionBuilderComposite</code>
+	 * @param composite - <code>DescriptionBuilderComposite</code>
+	 */
+	private void attachWebFaultAnnotation(DescriptionBuilderComposite composite) {
+		WebFault webFault = (WebFault) ConverterUtils.getAnnotation(
+				WebFault.class, serviceClass);
+		if(webFault != null) {
+			WebFaultAnnot webFaultAnnot = WebFaultAnnot.createWebFaultAnnotImpl();
+			webFaultAnnot.setFaultBean(webFault.faultBean());
+			webFaultAnnot.setName(webFault.name());
+			webFaultAnnot.setTargetNamespace(webFault.targetNamespace());
+			composite.setWebFaultAnnot(webFaultAnnot);
+		}
+	}
+	
+	/**
+	 * This method will be used to attach @WebServiceRefs annotation data to the 
+	 * <code>DescriptionBuilderComposite</code>
+	 * @param composite - <code>DescriptionBuilderComposite</code>
+	 */
+	private void attachWebServiceRefsAnnotation(DescriptionBuilderComposite composite) {
+		WebServiceRefs webServiceRefs = (WebServiceRefs) ConverterUtils.getAnnotation(
+				WebServiceRefs.class, serviceClass);
+		if(webServiceRefs != null) {
+			WebServiceRef[] refs = webServiceRefs.value();
+			for(WebServiceRef ref : refs) {
+				WebServiceRefAnnot wsrAnnot = ConverterUtils.createWebServiceRefAnnot(
+						ref);
+				composite.setWebServiceRefAnnot(wsrAnnot);
+			}
+		}
+	}
+	
+	/**
+	 * This method will be used to drive the setting of @WebServiceRef annotation 
+	 * data to the <code>DescriptionBuilderComposite</code>
+	 * @param composite - <code>DescriptionBuilderComposite</code>
+	 */
+	private void attachWebServiceRefAnnotation(DescriptionBuilderComposite composite) {
+		ConverterUtils.attachWebServiceRefAnnotation(composite, serviceClass);
+		
+	}
+	
+	private void establishClassHierarchy(Class rootClass) {
+		classes.add(rootClass);
+		if(rootClass.getSuperclass() != null && !rootClass.getSuperclass().getName().
+				equals("java.lang.Object")) {
+			classes.add(rootClass.getSuperclass());	
+			establishInterfaceHierarchy(rootClass.getSuperclass().getInterfaces());
+			establishClassHierarchy(rootClass.getSuperclass());
+		}
+	}
+	
+	private void establishInterfaceHierarchy(Class[] interfaces) {
+		if(interfaces.length > 0) {
+			for(Class inter : interfaces) {
+				classes.add(inter);
+				establishInterfaceHierarchy(inter.getInterfaces());
+			}
+		}
+	}
+}

Added: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaFieldsToFDCConverter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaFieldsToFDCConverter.java?view=auto&rev=501235
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaFieldsToFDCConverter.java (added)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaFieldsToFDCConverter.java Mon Jan 29 15:35:55 2007
@@ -0,0 +1,62 @@
+package org.apache.axis2.jaxws.description.builder.converter;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.axis2.jaxws.description.builder.FieldDescriptionComposite;
+
+/**
+ * This class will be used to convert Java Fields into FieldDescriptionComposite
+ * objects.
+ *
+ */
+public class JavaFieldsToFDCConverter {
+	
+	private Field[] fields;
+
+	public JavaFieldsToFDCConverter(Field[] fields) {
+		this.fields = fields;
+	}
+	
+	/**
+	 * This method will be called to create <code>FieldDescriptionComposite</code>
+	 * objects for public fields in a given Class.
+	 * @return - <code>List</code>
+	 */
+	public List<FieldDescriptionComposite> convertFields() {
+		List<FieldDescriptionComposite> fdcList = new 
+			ArrayList<FieldDescriptionComposite>();
+		for(Field field : fields) {
+			FieldDescriptionComposite fdc = new FieldDescriptionComposite();
+			fdc.setFieldName(field.getName());
+			fdc.setModifierType(Modifier.toString(field.getModifiers()));
+			attachHandlerChainAnnotation(fdc, field);
+			attachWebServiceRefAnnotation(fdc, field);
+		}
+		return fdcList;
+	}
+	
+	/**
+	 * This method will drive the call to attach @HandlerChain annotation data
+	 * if it is found on the Field.
+	 * @param fdc - <code>FieldDescriptionComposite</code>
+	 * @param field - <code>Field</code>
+	 */
+	private void attachHandlerChainAnnotation(FieldDescriptionComposite fdc, 
+			Field field) {
+		ConverterUtils.attachHandlerChainAnnotation(fdc, field);
+	}
+	
+	/**
+	 * This method will drive the call to attach @WebServiceRef annotation data
+	 * if it is found on the Field.
+	 * @param fdc - <code>FieldDescriptionComposite</code>
+	 * @param field - <code>Field</code>
+	 */
+	private void attachWebServiceRefAnnotation(FieldDescriptionComposite fdc, 
+			Field field) {
+		ConverterUtils.attachWebServiceRefAnnotation(fdc, field);
+	}
+}

Added: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java?view=auto&rev=501235
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java (added)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaMethodsToMDCConverter.java Mon Jan 29 15:35:55 2007
@@ -0,0 +1,252 @@
+package org.apache.axis2.jaxws.description.builder.converter;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebResult;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+import javax.xml.ws.WebEndpoint;
+
+import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.RequestWrapperAnnot;
+import org.apache.axis2.jaxws.description.builder.ResponseWrapperAnnot;
+import org.apache.axis2.jaxws.description.builder.WebEndpointAnnot;
+import org.apache.axis2.jaxws.description.builder.WebMethodAnnot;
+import org.apache.axis2.jaxws.description.builder.WebResultAnnot;
+
+public class JavaMethodsToMDCConverter {
+	
+	private Method[] methods;
+	
+	private String declaringClass;
+	
+	public JavaMethodsToMDCConverter(Method[] methods, String declaringClass) {
+		this.methods = methods;
+		this.declaringClass = declaringClass;
+	}
+	
+	/**
+	 * This will drive the creation of a <code>MethodDescriptionComposite</code> 
+	 * for every Java Method in the methods array.
+	 * @return - <code>List</code>
+	 */
+	public List<MethodDescriptionComposite> convertMethods() {
+		List<MethodDescriptionComposite> mdcList = new 
+			ArrayList<MethodDescriptionComposite>();
+		for(Method method : methods) {
+			if(!ConverterUtils.isInherited(method, declaringClass)) {
+				MethodDescriptionComposite mdc = new MethodDescriptionComposite();
+				setExceptionList(mdc, method);
+				mdc.setMethodName(method.getName());
+				setReturnType(mdc, method);
+				mdc.setDeclaringClass(method.getDeclaringClass().getName());
+				attachHandlerChainAnnotation(mdc, method);
+				attachOnewayAnnotation(mdc, method);
+				attachRequestWrapperAnnotation(mdc, method);
+				attachResponseWrapperAnnotation(mdc, method);
+				attachWebEndpointAnnotation(mdc, method);
+				attachWebMethodAnnotation(mdc, method);
+				attachWebResultAnnotation(mdc, method);
+				attachWebServiceRefAnnotation(mdc, method);
+				if(method.getGenericParameterTypes().length > 0) {
+					JavaParamToPDCConverter paramConverter = new JavaParamToPDCConverter(
+							method.getGenericParameterTypes(), method.getParameterAnnotations());
+					List<ParameterDescriptionComposite> pdcList = paramConverter.
+						convertParams();
+					ConverterUtils.attachParameterDescriptionComposites(pdcList, mdc);
+				}
+				mdcList.add(mdc);
+			}
+		}
+			
+		return mdcList;
+	}
+	
+	/**
+	 * This method attaches the list of exceptions for a Java Method to the
+	 * <code>MethodDescriptionComposite</code>
+	 * @param mdc - <code>MethodDescriptionComposite</code>
+	 * @param method - <code>Method</code>
+	 */
+	private void setExceptionList(MethodDescriptionComposite mdc, Method method) {
+		if(method.getExceptionTypes().length > 0) {
+			Type[] exceptionTypes = method.getGenericExceptionTypes();
+			String[] exceptions = new String[exceptionTypes.length];
+			for(int i=0; i < exceptionTypes.length; i++) {
+				Type type = exceptionTypes[i];
+				if(type instanceof ParameterizedType) {
+					ParameterizedType pt = (ParameterizedType) type;
+					String fullType = "";
+					fullType = ConverterUtils.getFullType(pt, fullType);
+					exceptions[i] = fullType;
+				}
+				else if(type instanceof Class) {
+					exceptions[i]= ((Class) type).getName();
+				}
+			}
+			mdc.setExceptions(exceptions);
+		}
+	}
+	
+	/**
+	 * This method will drive the attachment of @HandlerChain annotation data to 
+	 * the <code>MethodDescriptionComposite</code>
+	 * @param mdc - <code>MethodDescriptionComposite</code>
+	 * @param method - <code>Method</code>
+	 */
+	private void attachHandlerChainAnnotation(MethodDescriptionComposite mdc, Method 
+			method) {
+		ConverterUtils.attachHandlerChainAnnotation(mdc, method);
+	}
+	
+	/**
+	 * This method will drive the attachment of @Oneway annotation data to 
+	 * the <code>MethodDescriptionComposite</code>
+	 * @param mdc - <code>MethodDescriptionComposite</code>
+	 * @param method - <code>Method</code>
+	 */
+	private void attachOnewayAnnotation(MethodDescriptionComposite mdc, Method 
+			method) {
+		Oneway oneway = (Oneway) ConverterUtils.getAnnotation(Oneway.class, method);
+		if(oneway != null) {
+			mdc.setOneWayAnnot(true);
+		}
+		else {
+			mdc.setOneWayAnnot(false);
+		}
+	}
+	
+	/**
+	 * This method will drive the attachment of @RequestWrapper annotation data to 
+	 * the <code>MethodDescriptionComposite</code>
+	 * @param mdc - <code>MethodDescriptionComposite</code>
+	 * @param method - <code>Method</code>
+	 */
+	private void attachRequestWrapperAnnotation(MethodDescriptionComposite mdc, Method 
+			method) {
+		RequestWrapper requestWrapper = (RequestWrapper) ConverterUtils.getAnnotation(
+				RequestWrapper.class, method);
+		if(requestWrapper != null) {
+			RequestWrapperAnnot rwAnnot = RequestWrapperAnnot.createRequestWrapperAnnotImpl();
+			rwAnnot.setClassName(requestWrapper.className());
+			rwAnnot.setLocalName(requestWrapper.localName());
+			rwAnnot.setTargetNamespace(requestWrapper.targetNamespace());
+			mdc.setRequestWrapperAnnot(rwAnnot);
+		}
+	}
+
+	/**
+	 * This method will drive the attachment of @ResponeWrapper annotation data to 
+	 * the <code>MethodDescriptionComposite</code>
+	 * @param mdc - <code>MethodDescriptionComposite</code>
+	 * @param method - <code>Method</code>
+	 */
+	private void attachResponseWrapperAnnotation(MethodDescriptionComposite mdc, Method 
+			method) {
+		ResponseWrapper responseWrapper = (ResponseWrapper) ConverterUtils.getAnnotation(
+				ResponseWrapper.class, method);
+		if(responseWrapper != null) {
+			ResponseWrapperAnnot rwAnnot = ResponseWrapperAnnot.createResponseWrapperAnnotImpl();
+			rwAnnot.setClassName(responseWrapper.className());
+			rwAnnot.setLocalName(responseWrapper.localName());
+			rwAnnot.setTargetNamespace(responseWrapper.targetNamespace());
+			mdc.setResponseWrapperAnnot(rwAnnot);
+		}
+	}
+	
+	/**
+	 * This method will drive the attachment of @WebEndpoint annotation data to 
+	 * the <code>MethodDescriptionComposite</code>
+	 * @param mdc - <code>MethodDescriptionComposite</code>
+	 * @param method - <code>Method</code>
+	 */
+	private void attachWebEndpointAnnotation(MethodDescriptionComposite mdc, Method 
+			method) {
+		WebEndpoint webEndpoint = (WebEndpoint) ConverterUtils.getAnnotation(
+				WebEndpoint.class, method);
+		if(webEndpoint != null) {
+			WebEndpointAnnot weAnnot = WebEndpointAnnot.createWebEndpointAnnotImpl();
+			weAnnot.setName(webEndpoint.name());
+			mdc.setWebEndpointAnnot(weAnnot);
+		}
+	}
+	
+	/**
+	 * This method will drive the attachment of @WebMethod annotation data to 
+	 * the <code>MethodDescriptionComposite</code>
+	 * @param mdc - <code>MethodDescriptionComposite</code>
+	 * @param method - <code>Method</code>
+	 */
+	private void attachWebMethodAnnotation(MethodDescriptionComposite mdc, Method 
+			method) {
+		WebMethod webMethod = (WebMethod) ConverterUtils.getAnnotation(WebMethod.class, 
+				method);
+		if(webMethod != null) {
+			WebMethodAnnot wmAnnot = WebMethodAnnot.createWebMethodAnnotImpl();
+			wmAnnot.setAction(webMethod.action());
+			wmAnnot.setExclude(webMethod.exclude());
+			wmAnnot.setOperationName(webMethod.operationName());
+			mdc.setWebMethodAnnot(wmAnnot);
+		}
+	}
+	
+	/**
+	 * This method will drive the attachment of @WebResult annotation data to 
+	 * the <code>MethodDescriptionComposite</code>
+	 * @param mdc - <code>MethodDescriptionComposite</code>
+	 * @param method - <code>Method</code>
+	 */
+	private void attachWebResultAnnotation(MethodDescriptionComposite mdc, Method 
+			method) {
+		WebResult webResult = (WebResult) ConverterUtils.getAnnotation(WebResult.class, 
+				method);
+		if(webResult != null) {
+			WebResultAnnot wrAnnot = WebResultAnnot.createWebResultAnnotImpl();
+			wrAnnot.setHeader(webResult.header());
+			wrAnnot.setName(webResult.name());
+			wrAnnot.setPartName(webResult.partName());
+			wrAnnot.setTargetNamespace(webResult.targetNamespace());
+			mdc.setWebResultAnnot(wrAnnot);
+		}
+	}
+	
+	/**
+	 * This method will drive the attachment of @WebServiceRef annotation data to 
+	 * the <code>MethodDescriptionComposite</code>
+	 * @param mdc - <code>MethodDescriptionComposite</code>
+	 * @param method - <code>Method</code>
+	 */
+	private void attachWebServiceRefAnnotation(MethodDescriptionComposite mdc, Method 
+			method) {
+		ConverterUtils.attachWebServiceRefAnnotation(mdc, method);
+	}
+	
+	/**
+	 * This method will determine the return type of a <code>Method</code> and
+	 * attach it to a <code>MethodDescriptionComposite</code> object.
+	 * @param mdc - <code>MethodDescriptionComposite</code>
+	 * @param method - <code>Method</code>
+	 */
+	private void setReturnType(MethodDescriptionComposite mdc, Method method) {
+		Type type = method.getGenericReturnType();
+		if(type == null) {
+			mdc.setReturnType("void");
+		}
+		else if(type instanceof ParameterizedType) {
+			ParameterizedType pt = (ParameterizedType) type;
+			String fullType = "";
+			fullType = ConverterUtils.getFullType(pt, fullType);
+			mdc.setReturnType(fullType);
+		}
+		else if(type instanceof Class) {
+			mdc.setReturnType(((Class) type).getName());
+		}
+	}
+}

Added: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaParamToPDCConverter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaParamToPDCConverter.java?view=auto&rev=501235
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaParamToPDCConverter.java (added)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/converter/JavaParamToPDCConverter.java Mon Jan 29 15:35:55 2007
@@ -0,0 +1,73 @@
+package org.apache.axis2.jaxws.description.builder.converter;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jws.WebParam;
+
+import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.WebParamAnnot;
+
+public class JavaParamToPDCConverter {
+
+	private Type[] paramTypes;
+	
+	private Annotation[][] paramAnnotations;
+	
+	public JavaParamToPDCConverter(Type[] paramTypes, Annotation[][] paramAnnotations) {
+		this.paramTypes = paramTypes;
+		this.paramAnnotations = paramAnnotations;
+	}
+	
+	public List<ParameterDescriptionComposite> convertParams() {
+		List<ParameterDescriptionComposite> pdcList = new 
+			ArrayList<ParameterDescriptionComposite>();
+		for(int i=0; i < paramTypes.length; i++) {
+			ParameterDescriptionComposite pdc = new ParameterDescriptionComposite();
+			Type paramType = paramTypes[i];
+			if(paramType instanceof Class) {
+				Class paramClass = (Class) paramType;
+				String fullType = "";
+				pdc.setParameterType(paramClass.getName());
+			}
+			else if(paramType instanceof ParameterizedType) {
+				ParameterizedType pt = (ParameterizedType) paramType;
+				String fullType = "";
+				fullType = ConverterUtils.getFullType(pt, fullType);
+				pdc.setParameterType(fullType);
+			}
+			pdc.setListOrder(i);
+			attachWebParamAnnotation(pdc, i);
+			pdcList.add(pdc);
+		}
+		return pdcList;
+	}
+	
+	
+	
+	/**
+	 * This method will attach @WebParam annotation data to the <code>
+	 * ParameterDescriptionComposite</code> if the annotation was found on the
+	 * parameter represented by this index in the parameter list.
+	 * @param pdc - <code>ParameterDescriptionComposite</code>
+	 * @param order - the current index in the parameter list
+	 */
+	private void attachWebParamAnnotation(ParameterDescriptionComposite pdc, int order) {
+		Annotation[] orderAnnots = paramAnnotations[order];
+		for(Annotation annot : orderAnnots) {
+			if(annot instanceof WebParam) {
+				WebParam webParam = (WebParam) annot;
+				WebParamAnnot wpAnnot = WebParamAnnot.createWebParamAnnotImpl();
+				wpAnnot.setHeader(webParam.header());
+				wpAnnot.setMode(webParam.mode());
+				wpAnnot.setName(webParam.name());
+				wpAnnot.setPartName(webParam.partName());
+				wpAnnot.setTargetNamespace(webParam.targetNamespace());
+				pdc.setWebParamAnnot(wpAnnot);
+			}
+		}
+	}
+}

Added: webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/builder/converter/ReflectiveConverterTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/builder/converter/ReflectiveConverterTests.java?view=auto&rev=501235
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/builder/converter/ReflectiveConverterTests.java (added)
+++ webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/builder/converter/ReflectiveConverterTests.java Mon Jan 29 15:35:55 2007
@@ -0,0 +1,228 @@
+package org.apache.axis2.jaxws.description.builder.converter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.jws.*;
+import javax.xml.ws.*;
+
+import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
+import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.WebMethodAnnot;
+import org.apache.axis2.jaxws.description.builder.WebParamAnnot;
+import org.apache.axis2.jaxws.description.builder.WebServiceAnnot;
+
+import junit.framework.TestCase;
+
+
+public class ReflectiveConverterTests extends TestCase {
+	private static DescriptionBuilderComposite implDBC;
+	private static DescriptionBuilderComposite seiDBC;
+	
+	public void setUp() {
+		JavaClassToDBCConverter converter = new JavaClassToDBCConverter(SimpleServiceImpl.class);
+		HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
+		assertNotNull(dbcMap);
+		implDBC = dbcMap.get(
+				"org.apache.axis2.jaxws.description.builder.converter." +
+				"ReflectiveConverterTests$SimpleServiceImpl");
+		seiDBC = dbcMap.get(
+				"org.apache.axis2.jaxws.description.builder.converter." +
+				"ReflectiveConverterTests$SimpleService");
+	}
+	
+	public static void testCreateImplDBC() {
+		assertNotNull(implDBC);
+		WebServiceAnnot wsAnnot = implDBC.getWebServiceAnnot();
+		assertNotNull(wsAnnot);
+		assertEquals("SimpleService", wsAnnot.serviceName());
+	}
+	
+	public static void testImplMethods() {
+		assertNotNull(implDBC);
+		List<MethodDescriptionComposite> mdcList = implDBC.getMethodDescriptionsList();
+		assertNotNull(mdcList);
+		assertEquals(mdcList.size(), 2);
+		MethodDescriptionComposite mdc = mdcList.get(0);
+		assertNotNull(mdc);
+		assertEquals("invoke", mdc.getMethodName());
+		assertEquals("java.lang.String", mdc.getReturnType());
+		mdc = mdcList.get(1);
+		assertNotNull(mdc);
+		assertEquals("invoke2", mdc.getMethodName());
+		assertEquals("int", mdc.getReturnType());
+	}
+	
+	public static void testImplParams() {
+		assertNotNull(implDBC);
+		List<MethodDescriptionComposite> mdcList = implDBC.getMethodDescriptionsList();
+		assertNotNull(mdcList);
+		assertEquals(mdcList.size(), 2);
+		MethodDescriptionComposite mdc = mdcList.get(0);
+		assertNotNull(mdc);
+		List<ParameterDescriptionComposite> pdcList = mdc.getParameterDescriptionCompositeList();
+		assertNotNull(pdcList);
+		assertEquals(pdcList.size(), 1);
+		ParameterDescriptionComposite pdc = pdcList.get(0);
+		assertEquals("java.util.List<java.lang.String>", pdc.getParameterType());
+	 	mdc = mdcList.get(1);
+	 	pdcList = mdc.getParameterDescriptionCompositeList();
+	 	assertNotNull(pdcList);
+	 	assertEquals(pdcList.size(), 2);
+	 	pdc = pdcList.get(0);
+	 	assertEquals("int", pdc.getParameterType());
+	 	pdc = pdcList.get(1);
+	 	assertNotNull(pdc);
+	 	assertEquals("int", pdc.getParameterType());
+	}
+	
+	public static void testCreateSEIDBC() {
+		assertNotNull(seiDBC);
+		WebServiceAnnot wsAnnot = seiDBC.getWebServiceAnnot();
+		assertNotNull(wsAnnot);
+		assertEquals("SimpleServicePort", wsAnnot.name());
+	}
+	
+	public static void testSEIMethods() {
+		assertNotNull(seiDBC);
+		List<MethodDescriptionComposite> mdcList = seiDBC.getMethodDescriptionsList();
+		assertNotNull(mdcList);
+		assertEquals(mdcList.size(), 2);
+		MethodDescriptionComposite mdc = mdcList.get(0);
+		assertEquals("invoke", mdc.getMethodName());
+		assertEquals("java.lang.String", mdc.getReturnType());
+		assertNotNull(mdc.getWebMethodAnnot());
+		WebMethodAnnot wmAnnot = mdc.getWebMethodAnnot();
+		assertEquals("invoke", wmAnnot.operationName());
+		mdc = mdcList.get(1);
+		assertEquals("invoke2", mdc.getMethodName());
+		assertEquals("int", mdc.getReturnType());
+	}
+	
+	public static void testSEIParams() {
+		assertNotNull(seiDBC);
+		List<MethodDescriptionComposite> mdcList = seiDBC.getMethodDescriptionsList();
+		assertNotNull(mdcList);
+		assertEquals(mdcList.size(), 2);
+		MethodDescriptionComposite mdc = mdcList.get(0);
+		assertNotNull(mdc);
+		List<ParameterDescriptionComposite> pdcList = mdc.getParameterDescriptionCompositeList();
+		assertNotNull(pdcList);
+		assertEquals(pdcList.size(), 1);
+		ParameterDescriptionComposite pdc = pdcList.get(0);
+		assertNotNull(pdc);
+		assertEquals("java.util.List<java.lang.String>", pdc.getParameterType());
+		WebParamAnnot wpAnnot = pdc.getWebParamAnnot();
+		assertNotNull(wpAnnot);
+		assertEquals("echoString", wpAnnot.name());
+		mdc = mdcList.get(1);
+		assertNotNull(mdc);
+		pdcList = mdc.getParameterDescriptionCompositeList();
+		assertNotNull(pdcList);
+		assertEquals(pdcList.size(), 2);
+		pdc = pdcList.get(0);
+		assertNotNull(pdc);
+		assertEquals("int", pdc.getParameterType());
+		assertNull(pdc.getWebParamAnnot());
+		pdc = pdcList.get(1);
+		assertNotNull(pdc);
+		assertEquals("int", pdc.getParameterType());
+		assertNull(pdc.getWebParamAnnot());
+	}
+	
+	public void testDBCHierarchy() {
+		JavaClassToDBCConverter converter = new JavaClassToDBCConverter(ChildClass.class);
+		HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
+		DescriptionBuilderComposite dbc = dbcMap.get("org.apache.axis2.jaxws.description.builder.converter." +
+				"ReflectiveConverterTests$ChildClass");
+		assertNotNull(dbc);
+		List<MethodDescriptionComposite> mdcList = dbc.getMethodDescriptionsList();
+		assertNotNull(mdcList);
+		assertEquals(mdcList.size(), 2);
+		assertEquals("doAbstract", mdcList.get(0).getMethodName());
+		assertEquals("extraMethod", mdcList.get(1).getMethodName());
+		dbc = dbcMap.get("org.apache.axis2.jaxws.description.builder.converter." +
+		"ReflectiveConverterTests$ParentClass");
+		assertNotNull(dbc);
+		mdcList = dbc.getMethodDescriptionsList();
+		assertNotNull(mdcList);
+		assertEquals(mdcList.size(), 1);
+		assertEquals("doParentAbstract", mdcList.get(0).getMethodName());
+		dbc = dbcMap.get("org.apache.axis2.jaxws.description.builder.converter." +
+		"ReflectiveConverterTests$ServiceInterface");
+		assertNotNull(dbc);
+		mdcList = dbc.getMethodDescriptionsList();
+		assertNotNull(mdcList);
+		assertEquals(mdcList.size(), 1);
+		assertEquals("doAbstract", mdcList.get(0).getMethodName());
+		dbc = dbcMap.get("org.apache.axis2.jaxws.description.builder.converter." +
+		"ReflectiveConverterTests$CommonService");
+		assertNotNull(dbc);
+		mdcList = dbc.getMethodDescriptionsList();
+		assertNotNull(mdcList);
+		assertEquals(mdcList.size(), 1);
+		assertEquals("extraMethod", mdcList.get(0).getMethodName());
+		dbc = dbcMap.get("org.apache.axis2.jaxws.description.builder.converter." +
+		"ReflectiveConverterTests$ParentServiceInterface");
+		assertNotNull(dbc);
+		mdcList = dbc.getMethodDescriptionsList();
+		assertNotNull(mdcList);
+		assertEquals(mdcList.size(), 1);
+		assertEquals("doParentAbstract", mdcList.get(0).getMethodName());
+		dbc = dbcMap.get("org.apache.axis2.jaxws.description.builder.converter." +
+		"ReflectiveConverterTests$AbstractService");
+		assertNotNull(dbc);
+		mdcList = dbc.getMethodDescriptionsList();
+		assertNotNull(mdcList);
+		assertEquals(mdcList.size(), 1);
+		assertEquals("someAbstractMethod", mdcList.get(0).getMethodName());
+		
+	}
+
+	@WebService(name="SimpleServicePort")
+	public interface SimpleService {
+		@WebMethod(operationName="invoke")
+		public String invoke(@WebParam(name="echoString")List<String> arg1);
+		public int invoke2(int arg1, int arg2);
+	}
+	
+	@WebService(serviceName="SimpleService", endpointInterface="org.apache.axis2.jaxws." +
+			"description.builder.converter.ReflectiveConverterTests$SimpleService")
+	public class SimpleServiceImpl {
+		public String invoke(List<String> myParam) {
+			return myParam.get(0);
+		}
+		public int invoke2(int num1, int num2) {
+			return num1 + num2;
+		}
+	}
+	
+	@WebService(serviceName="InheritanceTestChild")
+	public class ChildClass extends ParentClass implements ServiceInterface, CommonService {
+		public void doAbstract(){};
+		public void extraMethod(){};
+	}
+	
+	@WebService(serviceName="InhertianceTestParent") 
+	public class ParentClass extends AbstractService implements ParentServiceInterface {
+		public void doParentAbstract(){};
+	}
+	
+	public interface ServiceInterface {
+		public void doAbstract();
+	}
+	
+	public interface CommonService {
+		public void extraMethod();
+	}
+	
+	public interface ParentServiceInterface {
+		public void doParentAbstract();
+	}
+	
+	public class AbstractService {
+		public void someAbstractMethod() {};
+	}
+}



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


Mime
View raw message