01: package net.sourceforge.pmd.ast;
02:
03: public class SimpleJavaNode extends SimpleNode implements JavaNode {
04:
05: public SimpleJavaNode(JavaParser p, int i) {
06: super (p, i);
07: }
08:
09: public SimpleJavaNode(int i) {
10: super (i);
11: }
12:
13: /**
14: * Accept the visitor. *
15: */
16: public Object jjtAccept(JavaParserVisitor visitor, Object data) {
17: return visitor.visit(this , data);
18: }
19:
20: /**
21: * Accept the visitor. *
22: */
23: public Object childrenAccept(JavaParserVisitor visitor, Object data) {
24: if (children != null) {
25: for (int i = 0; i < children.length; ++i) {
26: ((JavaNode) children[i]).jjtAccept(visitor, data);
27: }
28: }
29: return data;
30: }
31:
32: /* You can override these two methods in subclasses of SimpleNode to
33: customize the way the node appears when the tree is dumped. If
34: your output uses more than one line you should override
35: toString(String), otherwise overriding toString() is probably all
36: you need to do.
37:
38: Changing this method is dangerous, since it is used by the XPathRule
39: for evaluating Element Names !!
40: */
41:
42: public String toString() {
43: return JavaParserTreeConstants.jjtNodeName[id];
44: }
45: }
|