Package org.codehaus.groovy.ast

Examples of org.codehaus.groovy.ast.AnnotationNode.addMember()


  private AnnotationNode createGrabAnnotation(String group, String module,
      String version, String classifier, String type, boolean transitive) {
    AnnotationNode annotationNode = new AnnotationNode(new ClassNode(Grab.class));
    annotationNode.addMember("group", new ConstantExpression(group));
    annotationNode.addMember("module", new ConstantExpression(module));
    annotationNode.addMember("version", new ConstantExpression(version));
    if (classifier != null) {
      annotationNode.addMember("classifier", new ConstantExpression(classifier));
    }
    if (type != null) {
View Full Code Here


  private AnnotationNode createGrabAnnotation(String group, String module,
      String version, String classifier, String type, boolean transitive) {
    AnnotationNode annotationNode = new AnnotationNode(new ClassNode(Grab.class));
    annotationNode.addMember("group", new ConstantExpression(group));
    annotationNode.addMember("module", new ConstantExpression(module));
    annotationNode.addMember("version", new ConstantExpression(version));
    if (classifier != null) {
      annotationNode.addMember("classifier", new ConstantExpression(classifier));
    }
    if (type != null) {
      annotationNode.addMember("type", new ConstantExpression(type));
View Full Code Here

    AnnotationNode annotationNode = new AnnotationNode(new ClassNode(Grab.class));
    annotationNode.addMember("group", new ConstantExpression(group));
    annotationNode.addMember("module", new ConstantExpression(module));
    annotationNode.addMember("version", new ConstantExpression(version));
    if (classifier != null) {
      annotationNode.addMember("classifier", new ConstantExpression(classifier));
    }
    if (type != null) {
      annotationNode.addMember("type", new ConstantExpression(type));
    }
    annotationNode.addMember("transitive", new ConstantExpression(transitive));
View Full Code Here

    annotationNode.addMember("version", new ConstantExpression(version));
    if (classifier != null) {
      annotationNode.addMember("classifier", new ConstantExpression(classifier));
    }
    if (type != null) {
      annotationNode.addMember("type", new ConstantExpression(type));
    }
    annotationNode.addMember("transitive", new ConstantExpression(transitive));
    annotationNode.addMember("initClass", new ConstantExpression(false));
    return annotationNode;
  }
View Full Code Here

      annotationNode.addMember("classifier", new ConstantExpression(classifier));
    }
    if (type != null) {
      annotationNode.addMember("type", new ConstantExpression(type));
    }
    annotationNode.addMember("transitive", new ConstantExpression(transitive));
    annotationNode.addMember("initClass", new ConstantExpression(false));
    return annotationNode;
  }

  /**
 
View Full Code Here

    }
    if (type != null) {
      annotationNode.addMember("type", new ConstantExpression(type));
    }
    annotationNode.addMember("transitive", new ConstantExpression(transitive));
    annotationNode.addMember("initClass", new ConstantExpression(false));
    return annotationNode;
  }

  /**
   * Strategy called to test if dependencies can be added. Subclasses override as
View Full Code Here

  }

  private AnnotationNode createGrabAnnotation() {
    ClassNode classNode = new ClassNode(Grab.class);
    AnnotationNode annotationNode = new AnnotationNode(classNode);
    annotationNode.addMember("value", new ConstantExpression("spring-core"));
    return annotationNode;
  }

  private void assertGrabAnnotationHasBeenTransformation() {
    this.transformation.visit(new ASTNode[] { this.moduleNode }, this.sourceUnit);
View Full Code Here

    }

    private void visitModule(ModuleNode module) {
      for (ClassNode classNode : module.getClasses()) {
        AnnotationNode annotation = new AnnotationNode(new ClassNode(Grab.class));
        annotation.addMember("value", new ConstantExpression("groovy"));
        classNode.addAnnotation(annotation);
        // We only need to do it at most once
        break;
      }
      // Remove GrabReolvers because all the dependencies are local now
View Full Code Here

    final ClassNode springCacheAnnotationClassNode = GRAILS_ANNOTATION_CLASS_NODE_TO_SPRING_ANNOTATION_CLASS_NODE.get(
        grailsCacheAnnotationNode.getClassNode());
    final AnnotationNode springCacheAnnotationNode = new AnnotationNode(springCacheAnnotationClassNode);
    for (Map.Entry<String, Expression> entry : grailsAnnotationMembers.entrySet()) {
      springCacheAnnotationNode.addMember(entry.getKey(), entry.getValue());
    }
    return springCacheAnnotationNode;
  }
}
View Full Code Here

          classNode.addAnnotation(new AnnotationNode(new ClassNode(CompileStatic.class)));
        }
        classNode.addAnnotation(new AnnotationNode(new ClassNode(InheritConstructors.class)));
        if (scriptPath != null) {
          AnnotationNode scriptPathAnnotation = new AnnotationNode(new ClassNode(ScriptPath.class));
          scriptPathAnnotation.addMember("value", new ConstantExpression(scriptPath.toUri().toString()));
          classNode.addAnnotation(scriptPathAnnotation);
        }
      }
    });
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.