ASTUserEnum extends ApexRootNode<UserEnum> { @Override public String getImage() { String apexName = getDefiningType(); return apexName.substring(apexName.lastIndexOf('.') + 1); } @Deprecated @InternalApi  ASTUserEnum(UserEnum userEnum); @Override Object jjtAccept(ApexParserVisitor visitor, Object data); @Override String getImage(); ASTModifierNode getModifiers();  }
@Test public void testEnumName() { ApexNode<Compilation> node = parse("class Foo { enum Bar { } }"); Assert.assertSame(ASTUserClass.class, node.getClass()); ASTUserEnum enumNode = node.getFirstDescendantOfType(ASTUserEnum.class); Assert.assertNotNull(enumNode); Assert.assertEquals("Bar", enumNode.getImage()); }