Package japa.parser.ast.body

Examples of japa.parser.ast.body.BodyDeclaration


            final List<BodyDeclaration> bodyDeclarations = td.getMembers();
            if (bodyDeclarations == null || bodyDeclarations.size() != 1) {
                throw new IllegalStateException(
                        "Illegal state: JavaParser did not return body declarations correctly");
            }
            final BodyDeclaration bd = bodyDeclarations.get(0);
            if (!(bd instanceof FieldDeclaration)) {
                throw new IllegalStateException(
                        "Illegal state: JavaParser did not return a field declaration correctly");
            }
            final FieldDeclaration fd = (FieldDeclaration) bd;
View Full Code Here


            final List<BodyDeclaration> bodyDeclarations = td.getMembers();
            if (bodyDeclarations == null || bodyDeclarations.size() != 1) {
                throw new IllegalStateException(
                        "Illegal state: JavaParser did not return body declarations correctly");
            }
            final BodyDeclaration bd = bodyDeclarations.get(0);
            if (!(bd instanceof ConstructorDeclaration)) {
                throw new IllegalStateException(
                        "Illegal state: JavaParser did not return a method declaration correctly");
            }
            final ConstructorDeclaration cd = (ConstructorDeclaration) bd;
View Full Code Here

            final List<BodyDeclaration> bodyDeclarations = td.getMembers();
            if (bodyDeclarations == null || bodyDeclarations.size() != 1) {
                throw new IllegalStateException(
                        "Illegal state: JavaParser did not return body declarations correctly");
            }
            final BodyDeclaration bd = bodyDeclarations.get(0);
            if (!(bd instanceof MethodDeclaration)) {
                throw new IllegalStateException(
                        "Illegal state: JavaParser did not return a method declaration correctly");
            }
            final MethodDeclaration md = (MethodDeclaration) bd;
View Full Code Here

    final public EnumDeclaration EnumDeclaration(Modifier modifier) throws ParseException {
        String name;
        List impList = null;
        EnumConstantDeclaration entry;
        List entries = null;
        BodyDeclaration member;
        List members = null;
        int line = modifier.beginLine;
        int column = modifier.beginColumn;
        jj_consume_token(ENUM);
        if (line == -1) {
View Full Code Here

        throw new Error("Missing return statement in function");
    }

    final public List ClassOrInterfaceBody(boolean isInterface) throws ParseException {
        List ret = new LinkedList();
        BodyDeclaration member;
        jj_consume_token(LBRACE);
        label_12: while (true) {
            switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                case ABSTRACT:
                case BOOLEAN:
View Full Code Here

    }

    final public BodyDeclaration ClassOrInterfaceBodyDeclaration(boolean isInterface) throws ParseException {
        boolean isNestedInterface = false;
        Modifier modifier;
        BodyDeclaration ret;
        pushJavadoc();
        if (jj_2_6(2)) {
            ret = InitializerDeclaration();
            if (isInterface) {
                throwParseException(token, "An interface cannot have initializers");
View Full Code Here

        throw new Error("Missing return statement in function");
    }

    final public List AnnotationTypeBody() throws ParseException {
        List ret = null;
        BodyDeclaration member;
        jj_consume_token(LBRACE);
        label_47: while (true) {
            switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                case ABSTRACT:
                case BOOLEAN:
View Full Code Here

        throw new Error("Missing return statement in function");
    }

    final public BodyDeclaration AnnotationBodyDeclaration() throws ParseException {
        Modifier modifier;
        BodyDeclaration ret;
        pushJavadoc();
        switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case SEMICOLON:
                jj_consume_token(SEMICOLON);
                ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc());
View Full Code Here

   * @throws IOException
   */
  public static BodyDeclaration parseBodyDeclaration(final String body)
      throws ParseException {
    StringReader sr = new StringReader(body);
    BodyDeclaration bd = new ASTParser(sr).AnnotationBodyDeclaration();
    sr.close();
    return bd;
  }
View Full Code Here

TOP

Related Classes of japa.parser.ast.body.BodyDeclaration

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.