use of apex.jorje.semantic.ast.expression.VariableExpression in project pmd by pmd.
the class Helper method getFQVariableName.
static String getFQVariableName(final ASTVariableExpression variable) {
final ASTReferenceExpression ref = variable.getFirstChildOfType(ASTReferenceExpression.class);
String objectName = "";
if (ref != null) {
if (ref.getNode().getNames().size() == 1) {
objectName = ref.getNode().getNames().get(0).getValue() + ".";
}
}
VariableExpression n = variable.getNode();
StringBuilder sb = new StringBuilder().append(n.getDefiningType().getApexName()).append(":").append(objectName).append(n.getIdentifier().getValue());
return sb.toString();
}
Aggregations