com.xenoamess.p3c.pmd.lang.java.util.VariableUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of p3c-pmd Show documentation
Show all versions of p3c-pmd Show documentation
Alibaba Java Coding Guidelines PMD implementations(XenoAmess
TPM)
package com.xenoamess.p3c.pmd.lang.java.util;
import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclaratorId;
import net.sourceforge.pmd.lang.java.ast.AbstractJavaAccessNode;
/**
* @author caikang
* @date 2019/04/22
*/
public class VariableUtils {
public static String getVariableName(AbstractJavaAccessNode typeNode) {
ASTVariableDeclaratorId decl = typeNode.getFirstDescendantOfType(ASTVariableDeclaratorId.class);
if (decl != null) {
return decl.getImage();
}
return null;
}
}