ASTField extends AbstractApexNode<Field> implements CanSuppressWarnings { public String getValue() { if (node.getFieldInfo().getValue() != null) { return String.valueOf(node.getFieldInfo().getValue()); } return null; } @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 testGetValue() { ApexNode<Compilation> node = parse("public class Foo { private String myField = 'a'; }"); ASTField field = node.getFirstDescendantOfType(ASTField.class); Assert.assertEquals("a", field.getValue()); }
@Test public void testGetNoValue() { ApexNode<Compilation> node = parse("public class Foo { private String myField; }"); ASTField field = node.getFirstDescendantOfType(ASTField.class); Assert.assertNull(field.getValue()); }