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: * Each class body is made up of a number of class body declarations.
16: *
17: * @author Mike Atkinson
18: * @since jRefactory 2.9.0, created October 16, 2003
19: */
20: public class ASTClassBodyDeclaration extends SimpleNode {
21: /**
22: * Constructor for the ASTClassBodyDeclaration node.
23: *
24: * @param identifier The id of this node (JJTCLASSBODYDECLARATION).
25: */
26: public ASTClassBodyDeclaration(int identifier) {
27: super (identifier);
28: }
29:
30: /**
31: * Constructor for the ASTClassBodyDeclaration node.
32: *
33: * @param parser The JavaParser that created this ASTClassBodyDeclaration node.
34: * @param identifier The id of this node (JJTCLASSBODYDECLARATION).
35: */
36: public ASTClassBodyDeclaration(JavaParser parser, int identifier) {
37: super (parser, identifier);
38: }
39:
40: /**
41: * Gets the anonymousInnerClass attribute of the ASTClassBodyDeclaration node.
42: *
43: * @return The anonymousInnerClass value
44: */
45: public boolean isAnonymousInnerClass() {
46: return jjtGetParent() instanceof ASTClassBody
47: && jjtGetParent().jjtGetParent() instanceof ASTAllocationExpression;
48: }
49:
50: /**
51: * Accept the visitor.
52: *
53: * @param visitor An implementation of JavaParserVisitor that processes the ASTClassBodyDeclaration node.
54: * @param data Some data being passed between the visitor methods.
55: * @return Usually the data parameter (possibly modified).
56: */
57: public Object jjtAccept(JavaParserVisitor visitor, Object data) {
58: return visitor.visit(this, data);
59: }
60: }
|