use of net.sourceforge.pmd.lang.ast.AbstractNode in project pmd-eclipse-plugin by pmd.
the class ASTUtil method returnType.
public static String returnType(ASTMethodDeclaration node) {
for (int ix = 0; ix < node.jjtGetNumChildren(); ix++) {
Node sn = node.jjtGetChild(ix);
if (sn instanceof ASTResultType) {
ASTResultType resultType = (ASTResultType) sn;
AbstractNode param = resultType.getFirstDescendantOfType(ASTClassOrInterfaceType.class);
if (param == null) {
param = resultType.getFirstDescendantOfType(ASTPrimitiveType.class);
}
if (param == null) {
continue;
}
return param.getImage();
}
}
return null;
}
use of net.sourceforge.pmd.lang.ast.AbstractNode in project pmd-eclipse-plugin by pmd.
the class ASTViewPage method highlightItem.
private void highlightItem(Object item) {
AbstractNode node = (AbstractNode) item;
highlight(node.getBeginLine() - 1, node.getBeginColumn() - 1, node.getEndLine() - 1, node.getEndColumn());
}
Aggregations