01: /*
02: * Author: Mike Atkinson
03: *
04: * This software has been developed under the copyleft
05: * rules of the GNU General Public License. Please
06: * consult the GNU General Public License for more
07: * details about use and distribution of this software.
08: */
09: package net.sourceforge.jrefactory.ast;
10:
11: import net.sourceforge.jrefactory.parser.JavaParser;
12: import net.sourceforge.jrefactory.parser.JavaParserVisitor;
13:
14: /**
15: * Holds the array initializer
16: *
17: * @author Mike Atkinson
18: * @since jRefactory 2.9.0, created October 16, 2003
19: */
20: public class ASTArrayInitializer extends SimpleNode {
21: private boolean finalComma = false;
22:
23: /**
24: * Constructor for the ASTArrayInitializer node.
25: *
26: * @param identifier The id of this node (JJTARRAYINITIALIZER).
27: */
28: public ASTArrayInitializer(int identifier) {
29: super (identifier);
30: }
31:
32: /**
33: * Constructor for the ASTArrayInitializer node.
34: *
35: * @param parser The JavaParser that created this ASTArrayInitializer node.
36: * @param identifier The id of this node (JJTARRAYINITIALIZER).
37: */
38: public ASTArrayInitializer(JavaParser parser, int identifier) {
39: super (parser, identifier);
40: }
41:
42: /**
43: * Set the final comma.
44: *
45: * Final comma's are optional in array initializers.
46: *
47: * @param way <code>true</code> if there is a final comma.
48: */
49: public void setFinalComma(boolean way) {
50: finalComma = way;
51: }
52:
53: /**
54: * Return <code>true</code> if the construct included a final comma.
55: *
56: * @return <code>true</code> if there was a final comma.
57: */
58: public boolean isFinalComma() {
59: return finalComma;
60: }
61:
62: /**
63: * Accept the visitor.
64: *
65: * @param visitor An implementation of JavaParserVisitor that processes the ASTArrayInitializer node.
66: * @param data Some data being passed between the visitor methods.
67: * @return Usually the data parameter (possibly modified).
68: */
69: public Object jjtAccept(JavaParserVisitor visitor, Object data) {
70: return visitor.visit(this, data);
71: }
72: }
|