ASTFieldDeclaration extends AbstractJavaAccessTypeNode implements Dimensionable, SignedNode<ASTFieldDeclaration>, Iterable<ASTVariableDeclaratorId> { public boolean isInterfaceMember() { if (getNthParent(2) instanceof ASTEnumBody) { return false; } ASTClassOrInterfaceBody classOrInterfaceBody = getFirstParentOfType(ASTClassOrInterfaceBody.class); if (classOrInterfaceBody == null || classOrInterfaceBody.isAnonymousInnerClass()) { return false; } if (classOrInterfaceBody.getParent() instanceof ASTClassOrInterfaceDeclaration) { ASTClassOrInterfaceDeclaration n = (ASTClassOrInterfaceDeclaration) classOrInterfaceBody.getParent(); return n.isInterface(); } return false; } @InternalApi @Deprecated  ASTFieldDeclaration(int id); @InternalApi @Deprecated  ASTFieldDeclaration(JavaParser p, int id); @Override Object jjtAccept(JavaParserVisitor visitor, Object data); boolean isSyntacticallyPublic(); @Override boolean isPublic(); boolean isSyntacticallyStatic(); @Override boolean isStatic(); boolean isSyntacticallyFinal(); @Override boolean isFinal(); @Override boolean isPrivate(); @Override boolean isPackagePrivate(); @Override boolean isProtected(); boolean isAnnotationMember(); boolean isInterfaceMember(); @Override @Deprecated boolean isArray(); @Override @Deprecated int getArrayDepth(); @Deprecated @DeprecatedAttribute(replaceWith = "VariableDeclaratorId/@Name") String getVariableName(); @Override JavaFieldSignature getSignature(); @Override Iterator<ASTVariableDeclaratorId> iterator(); @Override @Deprecated Class<?> getType(); @Override @Deprecated JavaTypeDefinition getTypeDefinition();  }
@Test public void testWithEnum() { ASTCompilationUnit cu = java5.parse(TEST4); ASTFieldDeclaration node = cu.findDescendantsOfType(ASTFieldDeclaration.class).get(0); assertFalse(node.isInterfaceMember()); }