Examples of AnnotationDeclaration


Examples of com.bacoder.parser.java.api.AnnotationDeclaration

    super(adapters);
  }

  @Override
  public AnnotationDeclaration adapt(AnnotationTypeDeclarationContext context) {
    AnnotationDeclaration annotationDeclaration = createNode(context);

    TerminalNode identifierNode = getTerminalNode(context, JavaParser.Identifier);
    if (identifierNode != null) {
      annotationDeclaration.setName(getAdapter(IdentifierAdapter.class).adapt(identifierNode));
    }

    AnnotationTypeBodyContext annotationTypeBodyContext =
        getChild(context, AnnotationTypeBodyContext.class);
    if (annotationTypeBodyContext != null) {
      annotationDeclaration.setMemberDeclarations(transform(annotationTypeBodyContext,
          AnnotationTypeElementDeclarationContext.class,
          new Function<AnnotationTypeElementDeclarationContext, AnnotationMemberDeclaration>() {
            @Override
            public AnnotationMemberDeclaration apply(
                AnnotationTypeElementDeclarationContext context) {
View Full Code Here

Examples of com.bacoder.parser.java.api.AnnotationDeclaration

    }

    AnnotationTypeDeclarationContext annotationTypeDeclarationContext =
        getChild(context, AnnotationTypeDeclarationContext.class);
    if (annotationTypeDeclarationContext != null) {
      AnnotationDeclaration annotationDeclaration =
          getAdapter(AnnotationTypeDeclarationAdapter.class).adapt(
              annotationTypeDeclarationContext);
      setClassOrInterfaceModifiers(context, annotationDeclaration);
      return annotationDeclaration;
    }
View Full Code Here

Examples of japa.parser.ast.body.AnnotationDeclaration

        return Boolean.TRUE;
    }

    public Boolean visit(AnnotationDeclaration n1, Node arg) {
        AnnotationDeclaration n2 = (AnnotationDeclaration) arg;

        // javadoc are checked at CompilationUnit

        if (n1.getModifiers() != n2.getModifiers()) {
            return Boolean.FALSE;
        }

        if (!objEquals(n1.getName(), n2.getName())) {
            return Boolean.FALSE;
        }

        if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) {
            return Boolean.FALSE;
        }

        if (!nodesEquals(n1.getMembers(), n2.getMembers())) {
            return Boolean.FALSE;
        }

        return Boolean.TRUE;
    }
View Full Code Here

Examples of japa.parser.ast.body.AnnotationDeclaration

        jj_consume_token(IDENTIFIER);
        name = token.image;
        members = AnnotationTypeBody();
        {
            if (true) {
                return new AnnotationDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, name, members);
            }
        }
        throw new Error("Missing return statement in function");
    }
View Full Code Here

Examples of japa.parser.ast.body.AnnotationDeclaration

    JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
    List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
    List<BodyDeclaration> members = visit(_n.getMembers(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    AnnotationDeclaration r = new AnnotationDeclaration(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
         _n.getModifiers(), annotations, _n.getName(), members
    );
    r.setComment(comment);
    return r;
  }
View Full Code Here

Examples of japa.parser.ast.body.AnnotationDeclaration

    return Boolean.TRUE;
  }

  @Override public Boolean visit(final AnnotationDeclaration n1, final Node arg) {
    final AnnotationDeclaration n2 = (AnnotationDeclaration) arg;

    // javadoc are checked at CompilationUnit

    if (n1.getModifiers() != n2.getModifiers()) {
      return Boolean.FALSE;
    }

    if (!objEquals(n1.getName(), n2.getName())) {
      return Boolean.FALSE;
    }

    if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) {
      return Boolean.FALSE;
    }

    if (!nodesEquals(n1.getMembers(), n2.getMembers())) {
      return Boolean.FALSE;
    }

    return Boolean.TRUE;
  }
View Full Code Here

Examples of lombok.ast.AnnotationDeclaration

  public Node createAnnotationDeclaration(Node modifiers, Node name, List<Node> members, org.parboiled.Node<Node> typeOpen, org.parboiled.Node<Node> typeClose) {
    Node typeBody = createNormalTypeBody(members);
    if (typeOpen != null && typeClose != null) {
      typeBody.setPosition(new Position(typeOpen.getStartIndex(), typeClose.getEndIndex()));
    }
    AnnotationDeclaration decl = new AnnotationDeclaration().astName(createIdentifierIfNeeded(name, currentPos())).rawBody(typeBody);
    if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
    return posify(decl);
  }
View Full Code Here

Examples of lombok.ast.AnnotationDeclaration

        fillList(node.typarams, classDecl.rawTypeVariables());
        NormalTypeBody body = new NormalTypeBody();
        fillList(node.defs, body.rawMembers(), flagKeyMap);
        classDecl.astBody(body);
      } else if ((flags & Flags.ANNOTATION) != 0) {
        AnnotationDeclaration annDecl = new AnnotationDeclaration();
        typeDecl = annDecl;
        NormalTypeBody body = new NormalTypeBody();
        flagKeyMap.put(FlagKey.METHODS_ARE_ANNMETHODS, FlagKey.METHODS_ARE_ANNMETHODS);
        fillList(node.defs, body.rawMembers(), flagKeyMap);
        annDecl.astBody(body);
      } else if ((flags & Flags.INTERFACE) != 0) {
        InterfaceDeclaration itfDecl = new InterfaceDeclaration();
        typeDecl = itfDecl;
        fillList(node.typarams, itfDecl.rawTypeVariables());
        fillList(node.implementing, itfDecl.rawExtending(), FlagKey.TYPE_REFERENCE);
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.