I've built up a list of FieldDeclarations and need to find out what the name of each field is:
List<FieldDeclaration> fields = classDeclaration.getFields();
for (FieldDeclaration field : fields)
{
String fieldName = field.get...?
}
I can't find any methods that retrieve the name of the field.
Strangely though, one of the constructors does accept a field argument so not sure why it doesn't have a getter. Do I need to get it from another node?
FieldDeclaration(NodeList modifiers, Type type, String name) Creates a FieldDeclaration. https://www.javadoc.io/doc/com.github.javaparser/javaparser-core/3.15.1