Package org.apache.axis2.jaxws.description.builder

Examples of org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite


        List<MethodDescriptionComposite> mdcList = new
                ArrayList<MethodDescriptionComposite>();
        for (Method method : methods) {
            if (!ConverterUtils.isInherited(method, declaringClass)
                && Modifier.isPublic(method.getModifiers())) {
                MethodDescriptionComposite mdc = new MethodDescriptionComposite();
                setExceptionList(mdc, method);
                mdc.setMethodName(method.getName());
                setReturnType(mdc, method);
                setIsListType(mdc, method);
                mdc.setDeclaringClass(method.getDeclaringClass().getName());
                attachHandlerChainAnnotation(mdc, method);
                attachOnewayAnnotation(mdc, method);
                attachSoapBindingAnnotation(mdc, method);
                attachRequestWrapperAnnotation(mdc, method);
                attachResponseWrapperAnnotation(mdc, method);
                attachWebEndpointAnnotation(mdc, method);
                attachWebMethodAnnotation(mdc, method);
                attachWebResultAnnotation(mdc, method);
                attachWebServiceRefAnnotation(mdc, method);
                attachActionAnnotation(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);
            }
        }

        for (Constructor constructor : constructors) {
            MethodDescriptionComposite mdc = new MethodDescriptionComposite();
            mdc.setMethodName("<init>");
            mdc.setDeclaringClass(constructor.getDeclaringClass().getName());
            mdcList.add(mdc);
            if (constructor.getGenericParameterTypes().length > 0) {
                JavaParamToPDCConverter paramConverter = new JavaParamToPDCConverter(
                        constructor.getGenericParameterTypes(),
                        constructor.getParameterAnnotations());
View Full Code Here


        WebServiceAnnot webServiceAnnot = WebServiceAnnot.createWebServiceAnnotImpl();
        assertNotNull(webServiceAnnot);
        webServiceAnnot.setWsdlLocation(wsdlLocation);
        webServiceAnnot.setTargetNamespace(targetNamespace);

        MethodDescriptionComposite mdc = new MethodDescriptionComposite();
        mdc.setMethodName("addTwoNumbers");
        mdc.setReturnType("int");

        ParameterDescriptionComposite pdc1 = new ParameterDescriptionComposite();
        pdc1.setParameterType("int");
        ParameterDescriptionComposite pdc2 = new ParameterDescriptionComposite();
        pdc1.setParameterType("int");

        mdc.addParameterDescriptionComposite(pdc1);
        mdc.addParameterDescriptionComposite(pdc2);

        dbc.addMethodDescriptionComposite(mdc);
        dbc.setWebServiceAnnot(webServiceAnnot);
        dbc.setClassName(ValidateWSDLImpl1.class.getName());
        dbc.setWsdlDefinition(wsdlDefn);
View Full Code Here

        assertNotNull(webServiceAnnot);
        webServiceAnnot.setWsdlLocation(wsdlLocation);
        webServiceAnnot.setTargetNamespace(targetNamespace);
        webServiceAnnot.setServiceName("ValidateWSDLImpl1ServiceInvalidPort");

        MethodDescriptionComposite mdc = new MethodDescriptionComposite();
        mdc.setMethodName("addTwoNumbers");
        mdc.setReturnType("int");

        ParameterDescriptionComposite pdc1 = new ParameterDescriptionComposite();
        pdc1.setParameterType("int");
        ParameterDescriptionComposite pdc2 = new ParameterDescriptionComposite();
        pdc1.setParameterType("int");

        mdc.addParameterDescriptionComposite(pdc1);
        mdc.addParameterDescriptionComposite(pdc2);

        dbc.addMethodDescriptionComposite(mdc);
        dbc.setWebServiceAnnot(webServiceAnnot);
        dbc.setClassName(ValidateWSDLImpl2.class.getName());
        dbc.setWsdlDefinition(wsdlDefn);
View Full Code Here

        assertNotNull(implDBC);
        List<MethodDescriptionComposite> mdcList = sortList(implDBC.getMethodDescriptionsList());
        sortList(mdcList);
        assertNotNull(mdcList);
        assertEquals(mdcList.size(), 3);
        MethodDescriptionComposite mdc = mdcList.get(0);
        assertNotNull(mdc);
        assertEquals("<init>", mdc.getMethodName());
        mdc = mdcList.get(1);
        assertNotNull(mdc);
        assertEquals("invoke", mdc.getMethodName());
        assertEquals("java.lang.String", mdc.getReturnType());
        mdc = mdcList.get(2);
        assertNotNull(mdc);
        assertEquals("invoke2", mdc.getMethodName());
        assertEquals("int", mdc.getReturnType());
    }
View Full Code Here

    public static void testImplParams() {
        assertNotNull(implDBC);
        List<MethodDescriptionComposite> mdcList = sortList(implDBC.getMethodDescriptionsList());
        assertNotNull(mdcList);
        assertEquals(mdcList.size(), 3);
        MethodDescriptionComposite mdc = mdcList.get(0);
        assertNotNull(mdc);
        List<ParameterDescriptionComposite> pdcList = mdc.getParameterDescriptionCompositeList();
        assertNotNull(pdcList);
        assertEquals(0, pdcList.size());
        mdc = mdcList.get(1);
        assertNotNull(mdc);
        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(2);
        pdcList = mdc.getParameterDescriptionCompositeList();
        assertNotNull(pdcList);
        assertEquals(pdcList.size(), 2);
        pdc = pdcList.get(0);
        assertEquals("int", pdc.getParameterType());
        pdc = pdcList.get(1);
View Full Code Here

    public static void testSEIMethods() {
        assertNotNull(seiDBC);
        List<MethodDescriptionComposite> mdcList = sortList(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());
    }
View Full Code Here

    public static void testSEIParams() {
        assertNotNull(seiDBC);
        List<MethodDescriptionComposite> mdcList = sortList(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());
View Full Code Here

        //Retrieve the relevent method composites for this dbc (and those in the superclass chain)
        Iterator<MethodDescriptionComposite> iter = retrieveReleventMethods(dbc);

        if (log.isDebugEnabled())
            log.debug("EndpointInterfaceDescriptionImpl: Finished retrieving methods");
        MethodDescriptionComposite mdc = null;

        while (iter.hasNext()) {
            mdc = iter.next();

            mdc.setDeclaringClass(dbc.getClassName());

            // Only add if it is a method that would be or is in the WSDL i.e.
            // don't create an OperationDescriptor for the MDC representing the
            // constructor
            if (DescriptionUtils.createOperationDescription(mdc.getMethodName())) {
                //First check if this operation already exists on the AxisService, if so
                //then use that in the description hierarchy

                AxisService axisService = getEndpointDescription().getAxisService();
                AxisOperation axisOperation = axisService
View Full Code Here

        int baseLevel = hierarchyMap.get(mdc.getDeclaringClass());
        if (log.isDebugEnabled()) {
            log.debug("Base method: " + mdc.getMethodName() + " initial level: " + baseLevel);
        }
        for (; index < methodList.size(); index++) {
            MethodDescriptionComposite compareMDC = methodList.get(index);
            // If the two methods are the same method that means we have found an inherited
            // overridden case
            if (mdc.equals(compareMDC)) {
                if (log.isDebugEnabled()) {
                    log.debug("Found equivalent methods: " + mdc.getMethodName());
                }
                // get the declaration level of the method we are comparing to
                int compareLevel = hierarchyMap.get(compareMDC.getDeclaringClass());
                // if the method was declared by a class in a lower level of the hierarchy it
                // becomes the method that we will compare other methods to
                if (compareLevel < baseLevel) {
                    if (log.isDebugEnabled()) {
                        log.debug("Found method lower in hierarchy chain: " +
                                compareMDC.getMethodName()
                                + " of class: " + compareMDC.getMethodName());
                    }
                    mdc = compareMDC;
                    baseLevel = compareLevel;
                }
            }
View Full Code Here

            List<MethodDescriptionComposite> mdcList = dbc.getMethodDescriptionsList();

            if (mdcList != null) {
                iter = dbc.getMethodDescriptionsList().iterator();
                while (iter.hasNext()) {
                    MethodDescriptionComposite mdc = iter.next();

                    if (!DescriptionUtils.isExcludeTrue(mdc)) {
                        mdc.setDeclaringClass(dbc.getClassName());
                        retrieveList.add(mdc);
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.