Add getXPathNodeName to the Node interface
A default implementation is available in AbstractNode to preserve compatibility with the previous way, which used Object.toString. Fixes #569
This commit is contained in:
@ -64,6 +64,12 @@ public abstract class AbstractPLSQLNode extends net.sourceforge.pmd.lang.ast.Abs
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getXPathNodeName() {
|
||||
return PLSQLParserTreeConstants.jjtNodeName[id];
|
||||
}
|
||||
|
||||
/*
|
||||
* You can override these two methods in subclasses of SimpleNode to
|
||||
* customize the way the node appears when the tree is dumped. If your
|
||||
@ -72,7 +78,7 @@ public abstract class AbstractPLSQLNode extends net.sourceforge.pmd.lang.ast.Abs
|
||||
*/
|
||||
|
||||
public String toString() {
|
||||
return PLSQLParserTreeConstants.jjtNodeName[id];
|
||||
return getXPathNodeName();
|
||||
}
|
||||
|
||||
public String toString(String prefix) {
|
||||
|
@ -45,7 +45,7 @@ public class DumpFacade extends PLSQLParserVisitorAdapter {
|
||||
writer.print(prefix);
|
||||
|
||||
// 2) JJT Name of the Node
|
||||
writer.print(node.toString());
|
||||
writer.print(node.getXPathNodeName());
|
||||
|
||||
//
|
||||
// If there are any additional details, then:
|
||||
|
Reference in New Issue
Block a user