Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.EnumDeclaration.bodyDeclarations()


    when(typeCount.getName()).thenReturn("Integer");
    when(typeCount.getQualifiedName()).thenReturn("Integer");

    enumGenerator.generateContructorParameters(clazz, ast, md);

    ed.bodyDeclarations().add(md);

    assertEquals(
        "public enum Company {; private Company(String name,Integer count);\n}\n",
        cu.toString());
  }
View Full Code Here


                /*
                 * It would be nice to be able to reuse the convenience methods from AbstractTypeDeclaration,
                 * but they don't exist in EnumDeclaration.  So we improvise!
                 */

                List<BodyDeclaration> bodyDecls = enumDeclaration.bodyDeclarations();
                for (BodyDeclaration bodyDecl : bodyDecls) {
                    if (bodyDecl instanceof FieldDeclaration) {
                        // fields of the class top level type
                        FieldMetadata fieldMetadata = getFieldMetadataFrom((FieldDeclaration)bodyDecl);
                        enumMetadata.getFields().add(fieldMetadata);
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.