Package org.apache.axis2.jaxws.runtime.description.marshal

Examples of org.apache.axis2.jaxws.runtime.description.marshal.AnnotationDesc


    private static void addXmlSeeAlsoPackages(Class clz,
                                              MarshalServiceRuntimeDescription msrd,
                                              TreeSet<String> set) {
        if (clz != null) {
            AnnotationDesc aDesc = msrd.getAnnotationDesc(clz);
            if (aDesc != null) {
                Class[] seeAlso = aDesc.getXmlSeeAlsoClasses();
                if (seeAlso != null) {
                    for (int i=0; i<seeAlso.length; i++) {
                        String pkg =
                            (seeAlso[i] == null) ? null :
                                (seeAlso[i].getPackage() == null) ? "" :
View Full Code Here


                    try {
                        faultBean = loadClass(faultBeanClassName, getContextClassLoader());
                    } catch (ClassNotFoundException e){
                        faultBean = loadClass(faultBeanClassName, ed.getAxisService().getClassLoader());
                    }
                    AnnotationDesc aDesc = AnnotationDescImpl.create(faultBean);
                    if (aDesc.hasXmlRootElement()) {
                        faultBeanLocalName = aDesc.getXmlRootElementName();
                    }
                } catch (Throwable t) {
                    throw ExceptionFactory.makeWebServiceException(t);
                }
            }
        }
        if (faultBeanLocalName == null || faultBeanLocalName.length() == 0) {
            faultBeanLocalName = getSimpleClassName(faultDesc.getExceptionClassName()) + "Bean";
        }

        /* Algorithm for fault bean namespace
        *   1) The namespace defined on the @WebFault of the exception.
        *   2) If not present, the namespace defined via the @XmlRootElement of the class name.
        *   3) If not present, the namespace of the method's declared class + "/jaxws"
        */
        String faultBeanNamespace = faultDesc.getTargetNamespace();
        if (faultBeanNamespace == null || faultBeanNamespace.length() == 0) {
            if (faultBeanClassName != null && faultBeanClassName.length() > 0) {
                try {
                    Class faultBean;
                    try {
                        faultBean = loadClass(faultBeanClassName, getContextClassLoader());
                    } catch (ClassNotFoundException e){
                        faultBean = loadClass(faultBeanClassName, ed.getAxisService().getClassLoader());
                    }
                    AnnotationDesc aDesc = AnnotationDescImpl.create(faultBean);
                    if (aDesc.hasXmlRootElement()) {
                        faultBeanNamespace = aDesc.getXmlRootElementNamespace();
                    }
                } catch (Throwable t) {
                   throw ExceptionFactory.makeWebServiceException(t);
                }
            }
View Full Code Here

                cls == BigInteger.class ||
                cls == BigDecimal.class) {

            return true;
        }
        AnnotationDesc aDesc = marshalDesc.getAnnotationDesc(cls);
        if (aDesc != null) {
            // XmlRootElementName returns null if @XmlRootElement is not specified
            return (aDesc.getXmlRootElementName() == null);
        }
        return true
    }
View Full Code Here

        this.packagesKey = packages.toString()// Unique key for searches
    }

    public AnnotationDesc getAnnotationDesc(Class cls) {
        String className = cls.getCanonicalName();
        AnnotationDesc aDesc = annotationMap.get(className);
        if (aDesc != null) {
            // Cache hit
            return aDesc;
        }
        // Cache miss...we cannot update the map because we don't want to introduce a sync call.
View Full Code Here

     *
     * @param cls Class
     * @return Class or null
     */
    private static Class getElement(Class cls, MarshalServiceRuntimeDescription msrd) {
        AnnotationDesc annotationDesc = msrd.getAnnotationDesc(cls);
        if (annotationDesc == null) {
            // This shouldn't happen
            annotationDesc = AnnotationDescImpl.create(cls);
        }
        if (annotationDesc.hasXmlRootElement()) {
            return cls;
        }
        return null;
    }
View Full Code Here

    private static void addAnnotation(Class cls, Map<String, AnnotationDesc> map) {

        String className = cls.getCanonicalName();
        if (map.get(className) == null) {
            AnnotationDesc desc = AnnotationDescImpl.create(cls);
            map.put(className, desc);
            if (cls.isPrimitive()) {
                Class class2 = ClassUtils.getWrapperClass(cls);
                AnnotationDesc desc2 = AnnotationDescImpl.create(class2);
                map.put(class2.getCanonicalName(), desc2);
            } else {
                Class class2 = ClassUtils.getPrimitiveClass(cls);
                if (class2 != null) {
                    AnnotationDesc desc2 = AnnotationDescImpl.create(class2);
                    map.put(class2.getCanonicalName(), desc2);
                }
            }
        }
    }
View Full Code Here

        String faultBeanLocalName = faultDesc.getName();
        if (faultBeanLocalName == null || faultBeanLocalName.length() == 0) {
            if (faultBeanClassName != null && faultBeanClassName.length() > 0) {
                try {
                    Class faultBean = loadClass(faultBeanClassName);
                    AnnotationDesc aDesc = AnnotationDescImpl.create(faultBean);
                    if (aDesc.hasXmlRootElement()) {
                        faultBeanLocalName = aDesc.getXmlRootElementName();
                    }
                } catch (Throwable t) {
                    ExceptionFactory.makeWebServiceException(t);
                }
            }
        }
        if (faultBeanLocalName == null || faultBeanLocalName.length() == 0) {
            faultBeanLocalName = getSimpleClassName(faultDesc.getExceptionClassName()) + "Bean";
        }

        /* Algorithm for fault bean namespace
        *   1) The namespace defined on the @WebFault of the exception.
        *   2) If not present, the namespace defined via the @XmlRootElement of the class name.
        *   3) If not present, the namespace of the method's declared class + "/jaxws"
        */
        String faultBeanNamespace = faultDesc.getTargetNamespace();
        if (faultBeanNamespace == null || faultBeanNamespace.length() == 0) {
            if (faultBeanClassName != null && faultBeanClassName.length() > 0) {
                try {
                    Class faultBean = loadClass(faultBeanClassName);
                    AnnotationDesc aDesc = AnnotationDescImpl.create(faultBean);
                    if (aDesc.hasXmlRootElement()) {
                        faultBeanNamespace = aDesc.getXmlRootElementNamespace();
                    }
                } catch (Throwable t) {
                    ExceptionFactory.makeWebServiceException(t);
                }
            }
View Full Code Here

            String charSetEncoding = BuilderUtil.getCharSetEncoding(contentTypeStr);
            msgContext.setProperty(
                    Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);
                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    if (HTTPTransportUtils.isRESTRequest(contentTypeStr)) {
                        RESTUtil.processPOSTRequest(msgContext, is, os,
                                request.getRequestLine().getUri(), contentType, builder, isRestDispatching);
                    } else {
View Full Code Here

            String contentTypeStr = contentType != null ?
                    contentType.getValue() : inferContentType();

            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);

                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    RESTUtil.processGetAndDeleteRequest(
                            msgContext, os, request.getRequestLine().getUri(),
                            request.getFirstHeader(HTTP.CONTENT_TYPE), builder,
                            method, isRestDispatching);
                }
View Full Code Here

        params = getListenerParameters();


        param = transportIn.getParameter(NhttpConstants.ENDPOINTS_CONFIGURATION);
        if (param != null && param.getValue() != null) {
            endpoints = new URLEndpointsConfigurationFactory().create(param.getValue().toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.runtime.description.marshal.AnnotationDesc

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.