Package com.sun.xml.bind.api

Examples of com.sun.xml.bind.api.TypeReference


                }
                exName = wf.name();
            }

            QName exQName = new QName(exNameSpace, exName);
            TypeReference tf = new TypeReference(exQName, exReturnType, anns);
            WSDLException wsdlEx = new WSDLException(exClass, tf);

            jmethod.addWSDLException(wsdlEx);

        }
View Full Code Here


        javaMethod.addRequest(request);

        boolean isOneway = method.isAnnotationPresent(Oneway.class);
        if (!isOneway) {
            QName resQN = new QName(targetNS, method.getName() + "Response");
            TypeReference typeRef = new TypeReference(resQN, this.getClass(), new Annotation[0]);
            WSDLParameter response = new WSDLParameter();
            response.setName(method.getName() + "Response");
            response.setStyle(JavaType.Style.OUT);
            javaMethod.addResponse(response);

            Class returnType = method.getReturnType();
            String resultName = method.getName() + "Response";
            String resultTNS = targetNS;
            String resultPartName = "return";
            WebResult webResult = method.getAnnotation(WebResult.class);
            boolean webResultHeader = false;
            if (webResult != null) {
                resultName = webResult.name().length() > 0 ? webResult.name() : resultName;
                resultPartName = webResult.partName().length() > 0 ? webResult.partName() : resultName;
                resultTNS = webResult.targetNamespace().length() > 0
                    ? webResult.targetNamespace() : resultTNS;
                webResultHeader = webResult.header();
            }
            QName resultQName = new QName(resultTNS, resultName);
            if (returnType != null && (!"void".equals(returnType.getName()))) {
                // Annotation[] rann = method.getAnnotations();
                Annotation[] rann = new Annotation[0];
                typeRef = new TypeReference(resultQName, returnType, rann);
                JavaParameter returnParameter = new JavaParameter(resultName, typeRef, JavaType.Style.OUT);
                returnParameter.setPartName(resultPartName);
                returnParameter.setTargetNamespace(resultTNS);
                returnParameter.setHeader(webResultHeader);
                response.addChildren(returnParameter);
View Full Code Here

                    partName = webParam.partName().length() > 0 ? webParam.partName() : paraName;
                    paraTNS = webParam.targetNamespace().length() > 0
                        ? webParam.targetNamespace() : paraTNS;

                    QName requestQN = new QName(paraTNS, paraName);
                    TypeReference typeref = new TypeReference(requestQN, clazz, paraAnns[i]);
                  
                    if (holder) {
                        if (webParam.mode() == WebParam.Mode.INOUT) {
                            jp = new JavaParameter(typeref.tagName.getLocalPart(), typeref,
                                                   JavaType.Style.INOUT);
                        } else {
                            jp = new JavaParameter(typeref.tagName.getLocalPart(), typeref,
                                                   JavaType.Style.OUT);
                        }
                    } else {
                        jp = new JavaParameter(typeref.tagName.getLocalPart(), typeref, JavaType.Style.IN);
                    }
                    jp.setPartName(partName);
                    jp.setHeader(webParam.header());
                    jp.setTargetNamespace(paraTNS);
                }
            }
            if (paraAnns[i].length == 0) {
                TypeReference typeref = new TypeReference(new QName(paraTNS, paraName), clazz,
                                                          paraAnns[i]);            
                jp = new JavaParameter(typeref.tagName.getLocalPart(), typeref, JavaType.Style.IN);
                jp.setPartName(partName);
                jp.setTargetNamespace(paraTNS);            
View Full Code Here

                }
                exName = wf.name();
            }

            QName exQName = new QName(exNameSpace, exName);
            TypeReference tf = new TypeReference(exQName, exReturnType, anns);
            WSDLException wsdlEx = new WSDLException(exClass, tf);
            jmethod.addWSDLException(wsdlEx);

        }
    }
View Full Code Here

        if (StringUtils.isEmpty(requestWrapper.targetNamespace)) {
            requestWrapper.targetNamespace = model.getTargetNameSpace();
        }
        Class reqClass = requestWrapper.getWrapperClass();
        QName reqQN = new QName(requestWrapper.targetNamespace, requestWrapper.localName);
        TypeReference typeRef = new TypeReference(reqQN, reqClass, new Annotation[0]);
        WSDLParameter request = new WSDLParameter(requestWrapper.localName, typeRef, JavaType.Style.IN);
        request.setTargetNamespace(requestWrapper.targetNamespace);
        javaMethod.addRequest(request);

      
        if (!isOneWayMethod(method)) {
            // process response
            Wrapper responseWrapper = WrapperUtil.getResponseWrapper(method);
            if (StringUtils.isEmpty(responseWrapper.targetNamespace)) {
                responseWrapper.targetNamespace = model.getTargetNameSpace();
            }
           
            Class resClass = responseWrapper.getWrapperClass();
            QName resQN = new QName(responseWrapper.targetNamespace, responseWrapper.localName);
            typeRef = new TypeReference(resQN, resClass, new Annotation[0]);
            WSDLParameter response = new WSDLParameter(responseWrapper.localName,
                                                       typeRef,
                                                       JavaType.Style.OUT);
            response.setTargetNamespace(responseWrapper.targetNamespace);
            javaMethod.addResponse(response);
View Full Code Here

                    partName = webParam.partName().length() > 0 ? webParam.partName() : paraName;
                    paraTNS = webParam.targetNamespace().length() > 0
                        ? webParam.targetNamespace() : paraTNS;

                    QName requestQN = new QName(paraTNS, paraName);
                    TypeReference typeref = new TypeReference(requestQN, clazz, paraAnns[i]);
                   
                    if (holder) {
                        if (webParam.mode() == WebParam.Mode.INOUT) {
                            jp = new JavaParameter(typeref.tagName.getLocalPart(), typeref,
                                                   JavaType.Style.INOUT);
                        } else {
                            jp = new JavaParameter(typeref.tagName.getLocalPart(), typeref,
                                                   JavaType.Style.OUT);
                        }
                    } else {
                        jp = new JavaParameter(typeref.tagName.getLocalPart(), typeref, JavaType.Style.IN);
                    }
                    jp.setName(paraName);
                    jp.setPartName(partName);
                    jp.setHeader(webParam.header());
                    jp.setTargetNamespace(paraTNS);
                }
            }
            if (paraAnns[i].length == 0) {
                TypeReference typeref = new TypeReference(new QName(paraTNS, paraName), clazz,
                                                          paraAnns[i]);            
                jp = new JavaParameter(typeref.tagName.getLocalPart(), typeref, JavaType.Style.IN);
                jp.setPartName(partName);
                jp.setTargetNamespace(paraTNS);            
View Full Code Here

                }
                exName = wf.name();
            }

            QName exQName = new QName(exNameSpace, exName);
            TypeReference tf = new TypeReference(exQName, exReturnType, anns);
            WSDLException wsdlEx = new WSDLException(exClass, tf);

            jmethod.addWSDLException(wsdlEx);

        }
View Full Code Here

        if (resultQName != null && !isOneWayMethod(method) && (returnType != null)
            && (!"void".equals(returnType.getName()))) {
            // Annotation[] annotations = method.getAnnotations();
            Annotation[] annotations = new Annotation[0];
            if (resultQName.getLocalPart() != null) {
                TypeReference rTypeReference = new TypeReference(resultQName, returnType, annotations);
                jpara = new JavaParameter();
                jpara.setName(method.getName() + "Response");
                jpara.setTypeReference(rTypeReference);
                jpara.setStyle(JavaType.Style.OUT);
                jpara.setHeader(isHeader);
View Full Code Here

        if (honorJaxbAnnotation && anns.length > 0) {
            //RpcLit will use the JAXB Bridge to unmarshall part message when it is
            //annotated with @XmlList,@XmlAttachmentRef,@XmlJavaTypeAdapter
            //TODO:Cache the JAXBRIContext
            QName qname = new QName(null, part.getConcreteName().getLocalPart());
            TypeReference typeReference = new TypeReference(qname, part.getTypeClass(), anns);
            return JAXBEncoderDecoder.unmarshalWithBridge(typeReference,
                                                          databinding.getContextClasses(),
                                                          reader,
                                                          getAttachmentUnmarshaller());
        }
View Full Code Here

                } else if (honorJaxbAnnotation && anns.length > 0) {
                    //RpcLit will use the JAXB Bridge to marshall part message when it is
                    //annotated with @XmlList,@XmlAttachmentRef,@XmlJavaTypeAdapter
                    //TODO:Cache the JAXBRIContext
                    QName qname = new QName(null, part.getConcreteName().getLocalPart());
                    TypeReference typeReference = new TypeReference(qname, part.getTypeClass(), anns);
                   
                    JAXBEncoderDecoder.marshalWithBridge(typeReference,
                                                         databinding.getContextClasses(),
                                                         obj,
                                                         output,
View Full Code Here

TOP

Related Classes of com.sun.xml.bind.api.TypeReference

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.