Package japa.parser.ast.body

Examples of japa.parser.ast.body.EnumConstantDeclaration


            if (constant.getName().equals(name.getSymbolName())) {
                throw new IllegalArgumentException("Enum constant '"
                        + name.getSymbolName() + "' already exists");
            }
        }
        final EnumConstantDeclaration newEntry = new EnumConstantDeclaration(
                name.getSymbolName());
        constants.add(constants.size(), newEntry);
    }
View Full Code Here


    printer.printLn(" {");
    printer.indent();
    if (n.getEntries() != null) {
      printer.printLn();
      for (Iterator<EnumConstantDeclaration> i = n.getEntries().iterator(); i.hasNext();) {
        EnumConstantDeclaration e = i.next();
        e.accept(this, arg);
        if (i.hasNext()) {
          printer.print(", ");
        }
      }
    }
View Full Code Here

    public Boolean visit(EmptyTypeDeclaration n1, Node arg) {
        return Boolean.TRUE;
    }

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

        // javadoc are checked at CompilationUnit

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

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

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

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

        return Boolean.TRUE;
    }
View Full Code Here

        printer.printLn(" {");
        printer.indent();
        if (n.getEntries() != null) {
            printer.printLn();
            for (Iterator<EnumConstantDeclaration> i = n.getEntries().iterator(); i.hasNext();) {
                EnumConstantDeclaration e = i.next();
                e.accept(this, arg);
                if (i.hasNext()) {
                    printer.print(", ");
                }
            }
        }
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;
View Full Code Here

                jj_la1[22] = jj_gen;
                ;
        }
        {
            if (true) {
                return new EnumConstantDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), annotations, name, args, classBody);
            }
        }
        throw new Error("Missing return statement in function");
    }
View Full Code Here

    List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
    List<Expression> args = visit(_n.getArgs(), _arg);
    List<BodyDeclaration> classBody = visit(_n.getClassBody(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    EnumConstantDeclaration r = new EnumConstantDeclaration(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
         annotations, _n.getName(), args, classBody
    );
    r.setComment(comment);
    return r;
  }
View Full Code Here

    printer.printLn(" {");
    printer.indent();
    if (n.getEntries() != null) {
      printer.printLn();
      for (final Iterator<EnumConstantDeclaration> i = n.getEntries().iterator(); i.hasNext();) {
        final EnumConstantDeclaration e = i.next();
        e.accept(this, arg);
        if (i.hasNext()) {
          printer.print(", ");
        }
      }
    }
View Full Code Here

  @Override public Boolean visit(final EmptyTypeDeclaration n1, final Node arg) {
    return Boolean.TRUE;
  }

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

    // javadoc are checked at CompilationUnit

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

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

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

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

    return Boolean.TRUE;
  }
View Full Code Here

TOP

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

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.