use of apex.jorje.semantic.ast.statement.FieldDeclaration in project pmd by pmd.
the class Helper method getFQVariableName.
static String getFQVariableName(final ASTFieldDeclaration variable) {
FieldDeclaration n = variable.getNode();
String name = "";
try {
java.lang.reflect.Field f = n.getClass().getDeclaredField("name");
f.setAccessible(true);
Identifier nameField = (Identifier) f.get(n);
name = nameField.getValue();
} catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
throw new RuntimeException(e);
}
StringBuilder sb = new StringBuilder().append(n.getDefiningType().getApexName()).append(":").append(name);
return sb.toString();
}
Aggregations