Package org.aspectj.apache.bcel.generic

Examples of org.aspectj.apache.bcel.generic.FieldGen.addAnnotation()


        SimpleElementValue svg = new SimpleElementValue(ElementValue.STRING, cg.getConstantPool(), deow.pointcut);
        List elems = new ArrayList();
        elems.add(new NameValuePair("value", svg, cg.getConstantPool()));
        AnnotationGen mag = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/Declare"
            + (deow.isError ? "Error" : "Warning")), elems, true, cg.getConstantPool());
        field.addAnnotation(mag);

        field.setValue(deow.message);
        cg.addField(field, null);

View Full Code Here


        if (annotationsOnRealMember != null) {
          for (int i = 0; i < annotationsOnRealMember.length; i++) {
            AnnotationAJ annotationX = annotationsOnRealMember[i];
            AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation();
            AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true);
            fg.addAnnotation(ag);
          }
        }

        if (weaver.getWorld().isInJava5Mode()) {
          String basicSignature = field.getSignature();
View Full Code Here

      if (annotationsOnRealMember != null) {
        for (int i = 0; i < annotationsOnRealMember.length; i++) {
          AnnotationAJ annotationX = annotationsOnRealMember[i];
          AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation();
          AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true);
          fg.addAnnotation(ag);
        }
      }

      gen.addField(fg, getSourceLocation());
      // this uses a shadow munger to add init method to constructors
View Full Code Here

        SimpleElementValue svg = new SimpleElementValue(ElementValue.STRING, cg.getConstantPool(), deow.pointcut);
        List<NameValuePair> elems = new ArrayList<NameValuePair>();
        elems.add(new NameValuePair("value", svg, cg.getConstantPool()));
        AnnotationGen mag = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/Declare"
            + (deow.isError ? "Error" : "Warning")), elems, true, cg.getConstantPool());
        field.addAnnotation(mag);

        field.setValue(deow.message);
        cg.addField(field, null);
      }
    }
View Full Code Here

        if (annotationsOnRealMember != null) {
          for (int i = 0; i < annotationsOnRealMember.length; i++) {
            AnnotationAJ annotationX = annotationsOnRealMember[i];
            AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation();
            AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true);
            fg.addAnnotation(ag);
          }
        }

        if (weaver.getWorld().isInJava5Mode()) {
          String basicSignature = field.getSignature();
View Full Code Here

      if (annotationsOnRealMember != null) {
        for (int i = 0; i < annotationsOnRealMember.length; i++) {
          AnnotationAJ annotationX = annotationsOnRealMember[i];
          AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation();
          AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true);
          fg.addAnnotation(ag);
        }
      }

      gen.addField(fg, getSourceLocation());
      // this uses a shadow munger to add init method to constructors
View Full Code Here

    newFieldGen.removeAnnotations();
    // List<AnnotationGen> alreadyHas = fg.getAnnotations();
    // if (annotations != null) {
    // fg.removeAnnotations();
    for (AnnotationAJ annotation : annotations) {
      newFieldGen.addAnnotation(new AnnotationGen(((BcelAnnotation) annotation).getBcelAnnotation(), cpool, true));
    }
    // for (int i = 0; i < annotations.length; i++) {
    // AnnotationAJ array_element = annotations[i];
    // boolean alreadyHasIt = false;
    // for (AnnotationGen gen : alreadyHas) {
View Full Code Here

            alreadyHasIt = true;
            break;
          }
        }
        if (!alreadyHasIt) {
          fg.addAnnotation(new AnnotationGen(((BcelAnnotation) array_element).getBcelAnnotation(), cpg, true));
        }
      }
    }
    field = fg.getField();
    annotationsAdded = false; // we are now correct again
View Full Code Here

        if (annotationsOnRealMember != null) {
          for (int i = 0; i < annotationsOnRealMember.length; i++) {
            AnnotationAJ annotationX = annotationsOnRealMember[i];
            AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation();
            AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true);
            fg.addAnnotation(ag);
          }
        }

        if (weaver.getWorld().isInJava5Mode()) {
          String basicSignature = field.getSignature();
View Full Code Here

      if (annotationsOnRealMember != null) {
        for (int i = 0; i < annotationsOnRealMember.length; i++) {
          AnnotationAJ annotationX = annotationsOnRealMember[i];
          AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation();
          AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true);
          fg.addAnnotation(ag);
        }
      }

      gen.addField(fg, getSourceLocation());
      // this uses a shadow munger to add init method to constructors
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.