Package com.sun.javadoc

Examples of com.sun.javadoc.AnnotationDesc$ElementValuePair


    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


    }
    return false;
  }

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

    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

    // Poor mans JavaBean property recognition
    // TODO: This won't cope with any of the more esoteric Jackson strategies for mapping properties (including auto-detection strategies)
    if (method.name().startsWith("get")
        || (method.name().startsWith("is") && method.returnType().simpleTypeName().equalsIgnoreCase("boolean"))) {
      // Jackson @JsonIgnore
      final AnnotationDesc jsonIgnore = Utils.findAnnotation(method.annotations(),
          "org.codehaus.jackson.annotate.JsonIgnore",
          "com.fasterxml.jackson.annotation.JsonIgnore");
      if (jsonIgnore == null || Boolean.FALSE.equals(Utils.getAnnotationValue(jsonIgnore))) {
        return true;
      } else {
View Full Code Here

  public static MethodDoc findAnnotatedMethod(final ClassDoc declaringClass, final MethodDoc method, final Class<?>... soughtAnnotations) {
    if(isExcluded(method)) {
        return null;
    }
    final AnnotationDesc onMethod = findAnnotation(method, soughtAnnotations);
    if (onMethod != null) {
      return method;
    }
    // try on the declaring class
    for (final MethodDoc declaringMethod : declaringClass.methods(false)) {
View Full Code Here

    return overridingMethod.name().equals(overriddenMethod.name()) && overridingMethod.signature().equals(overriddenMethod.signature());
  }

  public static AnnotationDesc findMethodAnnotation(final ClassDoc declaringClass, final MethodDoc method,
                                                    final Class<?>... soughtAnnotations) {
    final AnnotationDesc onMethod = findAnnotation(method, soughtAnnotations);
    if (onMethod != null) {
      return onMethod;
    }
    // try on the declaring class
    for (final MethodDoc declaringMethod : declaringClass.methods(false)) {
View Full Code Here

    return null;
  }

  public static AnnotationDesc findParameterAnnotation(final MethodDoc declaringMethod, final Parameter parameter, int parameterIndex,
                                                       final Class<?>... soughtAnnotations) {
    final AnnotationDesc onParameter = findAnnotation(parameter, soughtAnnotations);
    if (onParameter != null) {
      return onParameter;
    }
    // try on the declaring method
    Parameter overriddenParameter = declaringMethod.parameters()[parameterIndex];
View Full Code Here

      property = target.typeName();
    } else {
      table = (String) Utils.getAnnotationValue(joinTable, "name");
      AnnotationValue[] joinColumns = (AnnotationValue[]) Utils
          .getAnnotationValue(joinTable, owning ? "joinColumns" : "inverseJoinColumns");
      AnnotationDesc joinColumn = (AnnotationDesc) joinColumns[0].value();
      property = (String) Utils.getAnnotationValue(joinColumn, "name");
    }
    return table + "." + property;
  }
View Full Code Here

  public JPAClass(ClassDoc klass, Registry registry, JPADoclet doclet) {
    // System.err.println("Root: " + klass.name());
    this.klass = klass;
    this.registry = registry;
    this.doclet = doclet;
    AnnotationDesc tableAnnotation = Utils.findAnnotation(klass, Table.class);
    if (tableAnnotation != null) {
      name = (String) Utils.getAnnotationValue(tableAnnotation, "name");
    }
    if (name == null)
      name = klass.simpleTypeName();
View Full Code Here

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

    AnnotationDesc columnAnnotation = Utils.findAnnotation(property, javax.persistence.Column.class);
    if (columnAnnotation == null)
      columnAnnotation = Utils.findAnnotation(property, javax.persistence.JoinColumn.class);
    AnnotationDesc transientAnnotation = Utils.findAnnotation(property, Transient.class);
    boolean hasJPAAnnotation = columnAnnotation != null;
    boolean isTransient = transientAnnotation != null;
    if (property.isField()) {
      isTransient |= ((FieldDoc) property).isTransient();
    }
View Full Code Here

TOP

Related Classes of com.sun.javadoc.AnnotationDesc$ElementValuePair

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.