ASTField extends AbstractApexNode<Field> implements CanSuppressWarnings { public String getType() { return node.getFieldInfo().getType().getApexName(); } @Deprecated @InternalApi  ASTField(Field field); @Override Object jjtAccept(ApexParserVisitor visitor, Object data); @Override String getImage(); @Override boolean hasSuppressWarningsAnnotationFor(Rule rule); String getType(); ASTModifierNode getModifiers(); String getName(); String getValue();  }
@Test public void testGetType() { ApexNode<Compilation> node = parse("public class Foo { private String myField = 'a'; }"); ASTField field = node.getFirstDescendantOfType(ASTField.class); Assert.assertEquals("myField", field.getImage()); Assert.assertEquals("String", field.getType()); Assert.assertEquals("a", field.getValue()); }