Package net.sf.rej.java.attribute

Examples of net.sf.rej.java.attribute.RuntimeVisibleAnnotationsAttribute


   
    // Method annotations
    boolean deprecatedAnnotationAdded = false;
    RuntimeInvisibleAnnotationsAttribute methodAnnInvisible = method
        .getAttributes().getRuntimeInvisibleAnnotationsAttribute();
    RuntimeVisibleAnnotationsAttribute methodAnnVisible = method
        .getAttributes().getRuntimeVisibleAnnotationsAttribute();
    List<Annotation> methodAnnotations = new ArrayList<Annotation>();
    if (methodAnnInvisible != null) {
      methodAnnotations.addAll(methodAnnInvisible.getAnnotations());
    }
    if (methodAnnVisible != null) {
      methodAnnotations.addAll(methodAnnVisible.getAnnotations());
    }
    for (Annotation annotation : methodAnnotations) {
      MethodAnnotationDefRow madr = new MethodAnnotationDefRow(
          annotation);
      list.add(madr);
View Full Code Here


    private static void getAnnotationTypeImports(Imports imports, Attributes attrs) {
      RuntimeInvisibleAnnotationsAttribute attrInv = attrs.getRuntimeInvisibleAnnotationsAttribute();
      if (attrInv != null) {
        getAnnotationTypeImports(imports, attrInv.getAnnotations());
      }
      RuntimeVisibleAnnotationsAttribute attr = attrs.getRuntimeVisibleAnnotationsAttribute();
      if (attr != null) {
        getAnnotationTypeImports(imports, attr.getAnnotations());
      }
    }
View Full Code Here

      this.rows.add(versionComment);

    // Class annotations
    RuntimeInvisibleAnnotationsAttribute annInvisible = cf.getAttributes()
        .getRuntimeInvisibleAnnotationsAttribute();
    RuntimeVisibleAnnotationsAttribute annVisible = cf.getAttributes()
        .getRuntimeVisibleAnnotationsAttribute();
    List<Annotation> classAnnotations = new ArrayList<Annotation>();
    if (annInvisible != null) {
      classAnnotations.addAll(annInvisible.getAnnotations());
    }
    if (annVisible != null) {
      classAnnotations.addAll(annVisible.getAnnotations());
    }
    for (Annotation annotation : classAnnotations) {
      ClassAnnotationDefRow adr = new ClassAnnotationDefRow(annotation);
      this.rows.add(adr);
    }

    // Class
    this.classDef = new ClassDefRow(cf, true);
    this.rows.add(this.classDef);
    this.rows.add(new BlankRow());

    // Fields
    java.util.List fields = cf.getFields();
    for (int i = 0; i < fields.size(); i++) {
      Field field = (Field) fields.get(i);

      // Field annotations
      RuntimeInvisibleAnnotationsAttribute fieldAnnInvisible = field
          .getAttributes().getRuntimeInvisibleAnnotationsAttribute();
      RuntimeVisibleAnnotationsAttribute fieldAnnVisible = field
          .getAttributes().getRuntimeVisibleAnnotationsAttribute();
      List<Annotation> fieldAnnotations = new ArrayList<Annotation>();
      if (fieldAnnInvisible != null) {
        fieldAnnotations.addAll(fieldAnnInvisible.getAnnotations());
      }
      if (fieldAnnVisible != null) {
        fieldAnnotations.addAll(fieldAnnVisible.getAnnotations());
      }
      for (Annotation annotation : fieldAnnotations) {
        FieldAnnotationDefRow fadr = new FieldAnnotationDefRow(
            annotation);
        this.rows.add(fadr);
      }

      FieldDefRow fdr = new FieldDefRow(cf, field);
      this.rows.add(fdr);
      this.classDef.addField(fdr);
    }

    if (fields.size() > 0) {
      this.rows.add(new BlankRow());
    }

    // Methods
    java.util.List methods = cf.getMethods();
    for (int i = 0; i < methods.size(); i++) {
      Method method = (Method) methods.get(i);

      // Method annotations
      boolean deprecatedAnnotationAdded = false;
      RuntimeInvisibleAnnotationsAttribute methodAnnInvisible = method
          .getAttributes().getRuntimeInvisibleAnnotationsAttribute();
      RuntimeVisibleAnnotationsAttribute methodAnnVisible = method
          .getAttributes().getRuntimeVisibleAnnotationsAttribute();
      List<Annotation> methodAnnotations = new ArrayList<Annotation>();
      if (methodAnnInvisible != null) {
        methodAnnotations.addAll(methodAnnInvisible.getAnnotations());
      }
      if (methodAnnVisible != null) {
        methodAnnotations.addAll(methodAnnVisible.getAnnotations());
      }
      for (Annotation annotation : methodAnnotations) {
        MethodAnnotationDefRow madr = new MethodAnnotationDefRow(
            annotation);
        this.rows.add(madr);
View Full Code Here

TOP

Related Classes of net.sf.rej.java.attribute.RuntimeVisibleAnnotationsAttribute

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.