Examples of addAnnotation()


Examples of org.aspectj.weaver.ResolvedMember.addAnnotation()

            LazyMethodGen annotationHolder = locateAnnotationHolderForFieldMunger(clazz, methodctorMunger);
            if (doesAlreadyHaveAnnotation(annotationHolder, unMangledInterMethod, decaMC, reportedErrors)) {
              continue; // skip this one...
            }
            annotationHolder.addAnnotation(decaMC.getAnnotation());
            unMangledInterMethod.addAnnotation(decaMC.getAnnotation());
            AsmRelationshipProvider.addDeclareAnnotationRelationship(asmManager, decaMC.getSourceLocation(),
                unMangledInterMethod.getSourceLocation(), false);
            isChanged = true;
            modificationOccured = true;
            forRemoval.add(decaMC);
View Full Code Here

Examples of org.aspectj.weaver.ResolvedType.addAnnotation()

      if (giveupnow) {
        CompilationAndWeavingContext.leavingPhase(tok);
        return false;
      }

      theTargetType.addAnnotation(new BcelAnnotation(new FakeAnnotation(name, sig,
          (abits & TagBits.AnnotationRuntimeRetention) != 0), factory.getWorld()));
      CompilationAndWeavingContext.leavingPhase(tok);
      return true;
    }
View Full Code Here

Examples of org.aspectj.weaver.bcel.LazyClassGen.addAnnotation()

      cg.setSuperClass(parent);
    }
    if (perclauseString == null) {
      AnnotationGen ag = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/Aspect"), Collections.EMPTY_LIST,
          true, cg.getConstantPool());
      cg.addAnnotation(ag);
    } else {
      // List elems = new ArrayList();
      List elems = new ArrayList();
      elems.add(new NameValuePair("value",
          new SimpleElementValue(ElementValue.STRING, cg.getConstantPool(), perclauseString), cg.getConstantPool()));
View Full Code Here

Examples of org.aspectj.weaver.bcel.LazyMethodGen.addAnnotation()

      List elems = new ArrayList();
      elems.add(new NameValuePair("value", svg, cg.getConstantPool()));
      AnnotationGen mag = new AnnotationGen(new ObjectType("org/aspectj/lang/annotation/Pointcut"), elems, true, cg
          .getConstantPool());
      AnnotationAJ max = new BcelAnnotation(mag, world);
      mg.addAnnotation(max);

      InstructionList body = mg.getBody();
      body.append(InstructionConstants.RETURN);
      cg.addMethodGen(mg);
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.AnnotatedNode.addAnnotation()

    final AnnotationNode grailsCacheAnnotationNode = (AnnotationNode) firstNode;
    final AnnotatedNode annotatedNode = (AnnotatedNode) secondNode;
    final AnnotationNode springCacheAnnotationNode = getCorrespondingSpringAnnotation(
        grailsCacheAnnotationNode);
    annotatedNode.addAnnotation(springCacheAnnotationNode);
  }

  protected AnnotationNode getCorrespondingSpringAnnotation(final AnnotationNode grailsCacheAnnotationNode) {
    final Map<String, Expression> grailsAnnotationMembers = grailsCacheAnnotationNode.getMembers();
View Full Code Here

Examples of org.codehaus.groovy.ast.ClassNode.addAnnotation()

  }

  @Test
  public void transformationOfAnnotationOnClass() {
    ClassNode classNode = new ClassNode("Test", 0, new ClassNode(Object.class));
    classNode.addAnnotation(this.grabAnnotation);
    this.moduleNode.addClass(classNode);

    assertGrabAnnotationHasBeenTransformation();
  }
View Full Code Here

Examples of org.codehaus.groovy.ast.ConstructorNode.addAnnotation()

                }
            } else {
                constructorNode = new ConstructorNode(Modifier.PUBLIC, constructorBody);
                classNode.addConstructor(constructorNode);
            }
            constructorNode.addAnnotation(new AnnotationNode(new ClassNode(GrailsDelegatingConstructor.class)));
            return constructorNode;
        }
        else {
            // create new constructor, restoring default constructor if there is none
            ConstructorNode cn = findConstructor(classNode, constructorParams);
View Full Code Here

Examples of org.codehaus.groovy.ast.FieldNode.addAnnotation()

        }
       
        MapExpression constructorArguments = new MapExpression();
        constructorArguments.addMapEntryExpression(new MapEntryExpression(new ConstantExpression("testClass"), new ClassExpression(classNode)));
        FieldNode mixinInstanceFieldNode = classNode.addField(fieldName, Modifier.STATIC, fieldType, new ConstructorCallExpression(fieldType, constructorArguments));
        mixinInstanceFieldNode.addAnnotation(new AnnotationNode(ClassHelper.make(MixinInstance.class)));
       
        addJunitRuleFields(classNode);
       
        return mixinInstanceFieldNode;
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.MethodNode.addAnnotation()

        MethodNode methodNode = new MethodNode(methodName,
                Modifier.PUBLIC, returnType, copyParameters(parameterTypes, genericsPlaceholders),
                GrailsArtefactClassInjector.EMPTY_CLASS_ARRAY, methodBody);
        copyAnnotations(declaredMethod, methodNode);
        if(shouldAddMarkerAnnotation(markerAnnotation, methodNode)) {
            methodNode.addAnnotation(markerAnnotation);
        }

        classNode.addMethod(methodNode);
        return methodNode;
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.PackageNode.addAnnotation()

  }

  @Test
  public void transformationOfAnnotationOnPackage() {
    PackageNode packageNode = new PackageNode("test");
    packageNode.addAnnotation(this.grabAnnotation);
    this.moduleNode.setPackage(packageNode);

    assertGrabAnnotationHasBeenTransformation();
  }
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.