Examples of AnnotationDesc


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

                    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

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

        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

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

     *
     * @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

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

                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

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

    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

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

        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

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

                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

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

        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

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

     *
     * @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

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
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.