Package org.aspectj.apache.bcel.generic.annotation

Examples of org.aspectj.apache.bcel.generic.annotation.AnnotationGen


      } else if (a instanceof RuntimeAnnotations) {
    RuntimeAnnotations runtimeAnnotations = (RuntimeAnnotations)a;
    List l = runtimeAnnotations.getAnnotations();
    for (Iterator it = l.iterator(); it.hasNext();) {
      Annotation element = (Annotation) it.next();
      addAnnotation(new AnnotationGen(element,cp,false));
    }
      } else {
        addAttribute(a);
      }
    }
View Full Code Here


  }
 
  private List /*AnnotationGen*/ makeMutableVersion(Annotation[] mutableArray) {
    List result = new ArrayList();
    for (int i = 0; i < mutableArray.length; i++) {
    result.add(new AnnotationGen(mutableArray[i],getConstantPool(),false));
  }
    return result;
  }
View Full Code Here

    if (attr instanceof RuntimeVisibleAnnotations) {
      RuntimeVisibleAnnotations rva = (RuntimeVisibleAnnotations)attr;
      List annos = rva.getAnnotations();
      for (Iterator iter = annos.iterator(); iter.hasNext();) {
        Annotation a = (Annotation) iter.next();
        annotationGenObjs.add(new AnnotationGen(a,getConstantPool(),false));
      }
    } else if (attr instanceof RuntimeInvisibleAnnotations) {
      RuntimeInvisibleAnnotations ria = (RuntimeInvisibleAnnotations)attr;
      List annos = ria.getAnnotations();
      for (Iterator iter = annos.iterator(); iter.hasNext();) {
        Annotation a = (Annotation) iter.next();
        annotationGenObjs.add(new AnnotationGen(a,getConstantPool(),false));
      }
    }
  }
    return (AnnotationGen[])annotationGenObjs.toArray(new AnnotationGen[]{});
  }
View Full Code Here

          return;
        }
       
        if (annotations.size()>0) {
          for (Iterator iter = annotations.iterator(); iter.hasNext();) {
        AnnotationGen element = (AnnotationGen) iter.next();
        myGen.addAnnotation(element);
      }
//      Attribute[] annAttributes  = org.aspectj.apache.bcel.classfile.Utility.getAnnotationAttributes(getConstantPoolGen(),annotations);
//        for (int i = 0; i < annAttributes.length; i++) {
//      Attribute attribute = annAttributes[i];
View Full Code Here

 
  public boolean hasAnnotation(UnresolvedType t) {
   
    // annotations on the real thing
    AnnotationGen agens[] = myGen.getAnnotations();
    if (agens==null) return false;
    for (int i = 0; i < agens.length; i++) {
      AnnotationGen gen = agens[i];
      if (t.equals(UnresolvedType.forSignature(gen.getTypeSignature()))) return true;
    }
   
    // annotations added during this weave
   
    return false;
View Full Code Here

    return false;
  }
 
  public void addAnnotation(Annotation a) {
    if (!hasAnnotation(UnresolvedType.forSignature(a.getTypeSignature()))) {
      annotations.add(new AnnotationGen(a,getConstantPoolGen(),true));
    }
  }
View Full Code Here

        }
       
        if (newAnnotations!=null) {
      for (Iterator iter = newAnnotations.iterator(); iter.hasNext();) {
        AnnotationX element = (AnnotationX) iter.next();
        gen.addAnnotation(new AnnotationGen(element.getBcelAnnotation(),gen.getConstantPool(),true));
      }
        }
   
        if (memberView!=null && memberView.getAnnotations()!=null && memberView.getAnnotations().length!=0) {
      AnnotationX[] ans = memberView.getAnnotations();
          for (int i = 0, len = ans.length; i < len; i++) {
      Annotation a= ans[i].getBcelAnnotation();
            gen.addAnnotation(new AnnotationGen(a,gen.getConstantPool(),true));
          }
        }
       
        if (isSynthetic) {
      ConstantPoolGen cpg = gen.getConstantPool();
View Full Code Here

TOP

Related Classes of org.aspectj.apache.bcel.generic.annotation.AnnotationGen

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.