Examples of AnnotationDesc


Examples of com.sun.javadoc.AnnotationDesc

      return Arrays.asList(Utils.getAnnotationValues(produces));
    }
  }

  public List<String> getConsumes() {
    AnnotationDesc consumes = getConsumesAnnotation();
    if (consumes == null) {
      return Collections.emptyList();
    } else {
      return Arrays.asList(Utils.getAnnotationValues(consumes));
    }
View Full Code Here

Examples of com.sun.javadoc.AnnotationDesc

  public JAXBClass(ClassDoc klass, Registry registry, JAXBDoclet doclet) {
    // System.err.println("Root: " + klass.name());
    this.klass = klass;
    this.registry = registry;
    this.doclet = doclet;
    AnnotationDesc rootAnnotation = Utils.findAnnotation(klass, XmlRootElement.class);
    if (rootAnnotation != null) {
      name = (String) Utils.getAnnotationValue(rootAnnotation, "name");
      namespace = (String) Utils.getAnnotationValue(rootAnnotation, "namespace");
    }
    if (name == null)
View Full Code Here

Examples of com.sun.javadoc.AnnotationDesc

    setupMembers(klass);
  }

  private void setupMembers(ClassDoc klass) {
    ClassDoc accessorAnnotationType = Utils.findAnnotatedClass(klass, XmlAccessorType.class);
    AnnotationDesc accessorAnnotation = null;
    if (accessorAnnotationType != null) {
      accessorAnnotation = Utils.findAnnotation(accessorAnnotationType, XmlAccessorType.class);
    } else {
      accessorAnnotation = Utils.findAnnotation(klass.containingPackage(), XmlAccessorType.class);
    }
View Full Code Here

Examples of com.sun.javadoc.AnnotationDesc

    if (property.isMethod() && !isProperty((MethodDoc) property))
      return;
    if (property.isStatic())
      return;

    AnnotationDesc xmlElementAnnotation = Utils.findAnnotation(property, XmlElement.class);
    AnnotationDesc xmlAttributeAnnotation = Utils.findAnnotation(property, XmlAttribute.class);
    AnnotationDesc xmlValueAnnotation = Utils.findAnnotation(property, XmlValue.class);
    AnnotationDesc xmlTransientAnnotation = Utils.findAnnotation(property, XmlTransient.class);
    boolean hasXmlAnnotation = xmlElementAnnotation != null || xmlAttributeAnnotation != null || xmlValueAnnotation != null;
    boolean isTransient = xmlTransientAnnotation != null;
    if (property.isField()) {
      isTransient |= ((FieldDoc) property).isTransient();
    }
View Full Code Here

Examples of com.sun.javadoc.AnnotationDesc

    members.put(propertyName, attribute);
    attributes.add(attribute);
  }

  private void addElement(ProgramElementDoc property, String propertyName, AnnotationDesc xmlElementAnnotation) {
    AnnotationDesc xmlElementWrapperAnnotation = Utils.findAnnotation(property, XmlElementWrapper.class);
    String name = propertyName;
    if (xmlElementAnnotation != null) {
      String overriddenName = (String) Utils.getAnnotationValue(xmlElementAnnotation, "name");
      if (overriddenName != null)
        name = overriddenName;
View Full Code Here

Examples of com.sun.javadoc.AnnotationDesc

    }
    return false;
  }

  private boolean isXmlList() {
    AnnotationDesc xmlListAnnot = Utils.findAnnotation(property, XmlList.class);
    return xmlListAnnot != null;
  }
View Full Code Here

Examples of com.sun.javadoc.AnnotationDesc

    Type type = getJavaType();
    return !type.isPrimitive() && klass.getRegistry().isJAXBClass(type.qualifiedTypeName());
  }

  public String getXSDType() {
    AnnotationDesc xmlSchemaTypeAnnot = Utils.findAnnotation(property, XmlSchemaType.class);
    if (xmlSchemaTypeAnnot != null) {
      String name = (String) Utils.getAnnotationValue(xmlSchemaTypeAnnot, "name");
      if (name != null) {
        return "xsd:" + name;
      }
View Full Code Here

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

    private static void addAnnotation(EndpointDescription endpointDesc, 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);
                }
            }
           
            // Inspect the interfaces.  This is done to pick up other
View Full Code Here

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

    public AnnotationDesc getAnnotationDesc(Class cls) {
      if (log.isDebugEnabled()) {
        log.debug("getAnnotationDesc for class " + cls);
      }
        String className = cls.getCanonicalName();    
        AnnotationDesc aDesc = annotationMap.get(className);
        if (aDesc == null) {
            // Cache miss
          if (log.isDebugEnabled()) {
            log.debug("creating AnnotationDesc");
          }
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.