Package org.codehaus.groovy.ast

Examples of org.codehaus.groovy.ast.AnnotatedNode


    public void visit(ASTNode[] nodes, SourceUnit source) {
        if (nodes.length != 2 || !(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) {
            throw new GroovyBugError("Internal error: expecting [AnnotationNode, AnnotatedNode] but got: " + Arrays.asList(nodes));
        }

        AnnotatedNode parent = (AnnotatedNode) nodes[1];
        AnnotationNode node = (AnnotationNode) nodes[0];
        if (!MY_TYPE.equals(node.getClassNode())) return;

        if (parent instanceof FieldNode) {
            FieldNode fNode = (FieldNode) parent;
View Full Code Here


      throw new RuntimeException("Internal error: wrong types: " + firstNode.getClass().getName() +
          " / " + secondNode.getClass().getName());
    }

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

        throw new IllegalArgumentException("Internal error: wrong types: " + firstNode.getClass().getName() +
            " / " + secondNode.getClass().getName());
      }

      AnnotationNode rolesAnnotationNode = (AnnotationNode) firstNode;
      AnnotatedNode annotatedNode = (AnnotatedNode) secondNode;

      AnnotationNode secured = createAnnotation(rolesAnnotationNode, sourceUnit);
      if (secured != null) {
        annotatedNode.addAnnotation(secured);
      }
    }
    catch (Exception e) {
      reportError(e.getMessage(), sourceUnit, firstNode);
    }
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.ast.AnnotatedNode

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.