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: * Stores a static or dynamic initializer that is contained within the class.
16: *
17: * @author Mike Atkinson
18: * @since jRefactory 2.9.0, created October 16, 2003
19: */
20: public class ASTInitializer extends SimpleNode {
21: private boolean usingStatic;
22:
23: /**
24: * Constructor for the ASTInitializer node.
25: *
26: * @param identifier The id of this node (JJTINITIALIZER).
27: */
28: public ASTInitializer(int identifier) {
29: super (identifier);
30: }
31:
32: /**
33: * Constructor for the ASTInitializer node.
34: *
35: * @param parser The JavaParser that created this ASTInitializer node.
36: * @param identifier The id of this node (JJTINITIALIZER).
37: */
38: public ASTInitializer(JavaParser parser, int identifier) {
39: super (parser, identifier);
40: }
41:
42: /**
43: * Sets whether we are using the static modifier
44: *
45: * @param isStatic <code>true</code> if <code>static</code> being used.
46: */
47: public void setUsingStatic(boolean isStatic) {
48: usingStatic = isStatic;
49: }
50:
51: /**
52: * Return true if we used the static modifier
53: *
54: * @return <code>true</code> if we used <code>static</code>.
55: */
56: public boolean isUsingStatic() {
57: return usingStatic;
58: }
59:
60: /**
61: * Accept the visitor.
62: *
63: * @param visitor An implementation of JavaParserVisitor that processes the ASTInitializer node.
64: * @param data Some data being passed between the visitor methods.
65: * @return Usually the data parameter (possibly modified).
66: */
67: public Object jjtAccept(JavaParserVisitor visitor, Object data) {
68: return visitor.visit(this, data);
69: }
70: }
|