/*
* 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);