Examples of ParameterDescription


Examples of org.apache.axis2.jaxws.description.ParameterDescription

    }

    public void test2() {
        Method[] methods = TestInterface.class.getMethods();
        Method method2 = methods[1];
        ParameterDescription pdc2 = new ParameterDescriptionImpl(0, method2.getParameterTypes()[0],
                                                                 method2.getGenericParameterTypes()[0],
                                                                 method2.getAnnotations(), null);
        assertNotNull(pdc2);
        assertEquals(String[].class, pdc2.getParameterActualType());
    }
View Full Code Here

Examples of org.apache.axis2.jaxws.description.ParameterDescription

    }

    public void test3() {
        Method[] methods = TestInterface.class.getMethods();
        Method method3 = methods[2];
        ParameterDescription pdc3 = new ParameterDescriptionImpl(0, method3.getParameterTypes()[0],
                                                                 method3.getGenericParameterTypes()[0],
                                                                 method3.getAnnotations(), null);
        assertNotNull(pdc3);
        assertEquals(List[].class, pdc3.getParameterActualType());
    }
View Full Code Here

Examples of org.apache.axis2.jaxws.description.ParameterDescription

    }

    public void test4() {
        Method[] methods = TestInterface.class.getMethods();
        Method method4 = methods[3];
        ParameterDescription pdc4 = new ParameterDescriptionImpl(0, method4.getParameterTypes()[0],
                                                                 method4.getGenericParameterTypes()[0],
                                                                 method4.getAnnotations(), null);
        assertNotNull(pdc4);
        assertEquals(String[].class, pdc4.getParameterActualType());
    }
View Full Code Here

Examples of org.apache.axis2.jaxws.description.ParameterDescription

    }

    public void test5() {
        Method[] methods = TestInterface.class.getMethods();
        Method method5 = methods[4];
        ParameterDescription pdc = new ParameterDescriptionImpl(0, method5.getParameterTypes()[0],
                                                                method5.getGenericParameterTypes()[0],
                                                                method5.getAnnotations(), null);
        assertNotNull(pdc);
        assertEquals(List[].class, pdc.getParameterActualType());
    }
View Full Code Here

Examples of org.apache.axis2.jaxws.description.ParameterDescription

            // Get the list of names for the output parameters
            List<String> names = new ArrayList<String>();
            List<ParameterDescription> pdList = new ArrayList<ParameterDescription>();
            for (int i = 0; i < pds.length; i++) {
                ParameterDescription pd = pds[i];
                if (pd.getMode() == Mode.OUT ||
                        pd.getMode() == Mode.INOUT) {
                    if (!pd.isHeader()) {
                        // Header names are not in the wrapped element
                        names.add(pd.getParameterName());
                    }
                    pdList.add(pd);
                }
            }


            if (!operationDesc.isResultHeader()) {
                // Normal case (Body Result) The return name is in the wrapped object
                if (isChildReturn && !isNoReturn) {
                    names.add(operationDesc.getResultPartName());
                }
            }

            // Get the child objects
            Object[] objects = wrapperTool.unWrap(wrapperObject, names,
                                                  marshalDesc.getPropertyDescriptorMap(
                                                          wrapperObject.getClass()));

            // Now create a list of paramValues so that we can populate the signature
            List<PDElement> pvList = new ArrayList<PDElement>();
            int bodyIndex = 0;
            for (int i = 0; i < pdList.size(); i++) {
                ParameterDescription pd = pdList.get(i);
                if (!pd.isHeader()) {
                    // Body elements are obtained from the unwrapped array of objects
                    Object value = objects[bodyIndex];
                    // The object in the PDElement must be an element
                    QName qName = new QName(pd.getTargetNamespace(),
                                            pd.getPartName());
                    Element element = null;
                    if (!marshalDesc.getAnnotationDesc(pd.getParameterActualType())
                            .hasXmlRootElement()) {
                        element = new Element(value, qName, pd.getParameterActualType());
                    } else {
                        element = new Element(value, qName);
                    }
                    pvList.add(new PDElement(pd, element, null));
                    bodyIndex++;
                } else {
                    // Header
                    // Get the Block from the header
                    String localName = pd.getParameterName();
                    JAXBBlockContext blkContext = new JAXBBlockContext(packages, packagesKey);

                    // Set up "by java type" unmarshalling if necessary
                    if (blkContext.getConstructionType() != JAXBUtils.CONSTRUCTION_TYPE
                            .BY_CONTEXT_PATH) {
                        Class actualType = pd.getParameterActualType();
                        if (MethodMarshallerUtils.isNotJAXBRootElement(actualType, marshalDesc)) {
                            blkContext.setProcessType(actualType);
                            blkContext.setIsxmlList(pd.isListType());
                        }
                    }
                    block = message.getHeaderBlock(pd.getTargetNamespace(), localName, blkContext,
                                                   factory);
                    Object value = block.getBusinessObject(true);
                    Element element =
                            new Element(value, new QName(pd.getTargetNamespace(), localName));
                    pvList.add(new PDElement(pd, element, blkContext.getProcessType()));
                }
            }

            // Populate the response Holders in the signature
View Full Code Here

Examples of org.apache.axis2.jaxws.description.ParameterDescription

            // Get the list of names for the input parameters
            List<String> xmlNames = new ArrayList<String>();
            List<ParameterDescription> pdList = new ArrayList<ParameterDescription>();
            for (int i = 0; i < pds.length; i++) {
                ParameterDescription pd = pds[i];
                if (pd.getMode() == Mode.IN ||
                        pd.getMode() == Mode.INOUT) {
                    if (!pd.isHeader()) {
                        // Only the body parameters will be present in the wrapper object
                        xmlNames.add(pd.getParameterName());
                    }
                    pdList.add(pd);
                }

            }

            // Get the child objects
            Object[] objects = wrapperTool.unWrap(wrapperObject, xmlNames,
                                                  marshalDesc.getPropertyDescriptorMap(
                                                          wrapperObject.getClass()));

            // Now create a list of paramValues
            List<PDElement> pvList = new ArrayList<PDElement>();
            int bodyIndex = 0;
            for (int i = 0; i < pdList.size(); i++) {
                ParameterDescription pd = pdList.get(i);
                if (!pd.isHeader()) {
                    // Normal case: Get the parameter value from the list of objects
                    Object value = objects[bodyIndex];

                    //  The object in the PDElement must be an element
                    QName qName = new QName(pd.getTargetNamespace(), pd.getPartName());
                    Element element = null;
                    if (!marshalDesc.getAnnotationDesc(pd.getParameterActualType())
                            .hasXmlRootElement()) {
                        element = new Element(value, qName, pd.getParameterActualType());
                    } else {
                        element = new Element(value, qName);
                    }
                    pvList.add(new PDElement(pd, element, null));
                    bodyIndex++;
                } else {
                    // Header
                    // Get the Block from the header
                    String localName = pd.getParameterName();
                    JAXBBlockContext blkContext =
                            new JAXBBlockContext(packages, marshalDesc.getPackagesKey());
                    // Set up "by java type" unmarshalling if necessary
                    if (blkContext.getConstructionType() != JAXBUtils.CONSTRUCTION_TYPE
                            .BY_CONTEXT_PATH) {
                        Class actualType = pd.getParameterActualType();
                        if (MethodMarshallerUtils.isNotJAXBRootElement(actualType, marshalDesc)) {
                            blkContext.setProcessType(actualType);
                        } else {
                            Annotation annos[] = actualType.getAnnotations();
                            if (annos == null || annos.length == 0) {
                                blkContext.setProcessType(actualType);
                                blkContext.setIsxmlList(pd.isListType());
                            }
                        }
                    }
                    block = message.getHeaderBlock(pd.getTargetNamespace(), localName, blkContext,
                                                   factory);
                    Object value = block.getBusinessObject(true);
                    Element element =
                            new Element(value, new QName(pd.getTargetNamespace(), localName));
                    pvList.add(new PDElement(pd, element, blkContext.getProcessType()));
                }

            }
View Full Code Here

Examples of org.apache.axis2.jaxws.description.ParameterDescription

            // Get the list of names for the output parameters
            List<String> names = new ArrayList<String>();
            List<ParameterDescription> pdList = new ArrayList<ParameterDescription>();
            for (int i = 0; i < pds.length; i++) {
                ParameterDescription pd = pds[i];
                if (pd.getMode() == Mode.OUT ||
                        pd.getMode() == Mode.INOUT) {
                    names.add(pd.getParameterName());
                    pdList.add(pd);
                }
            }

            // The return name is added as the last name
            if (isChildReturn && !isNoReturn) {
                names.add(operationDesc.getResultPartName());
            }

            // Get the child objects
            Object[] objects = wrapperTool.unWrap(wrapperObject, names,
                                                  marshalDesc.getPropertyDescriptorMap(
                                                          wrapperObject.getClass()));

            // Now create a list of paramValues so that we can populate the signature
            List<PDElement> pvList = new ArrayList<PDElement>();
            for (int i = 0; i < pdList.size(); i++) {
                ParameterDescription pd = pdList.get(i);
                Object value = objects[i];
                // The object in the PDElement must be an element
                Element element = null;
                QName qName = new QName(pd.getTargetNamespace(), pd.getPartName());
                if (!marshalDesc.getAnnotationDesc(pd.getParameterActualType()).hasXmlRootElement())
                {
                    element = new Element(value, qName,
                                          pd.getParameterActualType());

                } else {
                    element = new Element(value, qName);
                }
                pvList.add(new PDElement(pd, element, null));
View Full Code Here

Examples of org.apache.axis2.jaxws.description.ParameterDescription

            // Get the list of names for the input parameters
            List<String> names = new ArrayList<String>();
            List<ParameterDescription> pdList = new ArrayList<ParameterDescription>();
            for (int i = 0; i < pds.length; i++) {
                ParameterDescription pd = pds[i];
                if (pd.getMode() == Mode.IN ||
                        pd.getMode() == Mode.INOUT) {
                    names.add(pd.getParameterName());
                    pdList.add(pd);
                }

            }

            // Get the child objects
            Object[] objects = wrapperTool.unWrap(wrapperObject, names,
                                                  marshalDesc.getPropertyDescriptorMap(
                                                          wrapperObject.getClass()));

            // Now create a list of paramValues
            List<PDElement> pvList = new ArrayList<PDElement>();
            for (int i = 0; i < pdList.size(); i++) {
                ParameterDescription pd = pdList.get(i);
                Object value = objects[i];
                // The object in the PDElement must be an element
                Element element = null;
                QName qName = new QName(pd.getTargetNamespace(),
                                        pd.getPartName());
                if (!marshalDesc.getAnnotationDesc(pd.getParameterActualType()).hasXmlRootElement())
                {
                    element = new Element(value, qName, pd.getParameterActualType());
                } else {
                    element = new Element(value, qName);
                }
                pvList.add(new PDElement(pd, element, null));
            }
View Full Code Here

Examples of org.apache.axis2.jaxws.description.ParameterDescription

            Class[] parameters = seiMethod.getParameterTypes();
            Type[] paramaterTypes = seiMethod.getGenericParameterTypes();
            Annotation[][] annotations = seiMethod.getParameterAnnotations();

            for (int i = 0; i < parameters.length; i++) {
                ParameterDescription paramDesc = new ParameterDescriptionImpl(i, parameters[i],
                                                                              paramaterTypes[i],
                                                                              annotations[i], this);
                buildParameterList.add(paramDesc);
            }

        } else {

            for (int i = 0; i < methodComposite.getParameterDescriptionCompositeList().size(); i++)
            {
                ParameterDescription paramDesc =
                        new ParameterDescriptionImpl(i,
                                                     methodComposite.getParameterDescriptionComposite(
                                                             i),
                                                     this);
                buildParameterList.add(paramDesc);
View Full Code Here

Examples of org.apache.axis2.jaxws.description.ParameterDescription

    }

    public ParameterDescription getParameterDescription(String parameterName) {
        // TODO: Validation: For BARE paramaterUse, only a single IN our INOUT paramater and a single output (either return or OUT or INOUT) is allowed
        //       Per JSR-224, Sec 3.6.2.2, pg 37
        ParameterDescription matchingParamDesc = null;
        if (parameterName != null && !parameterName.equals("")) {
            for (ParameterDescription paramDesc : parameterDescriptions) {
                if (parameterName.equals(paramDesc.getParameterName())) {
                    matchingParamDesc = paramDesc;
                    break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.