01: /*
02: * Copyright (C) 2007 Júlio Vilmar Gesser.
03: *
04: * This file is part of Java 1.5 parser and Abstract Syntax Tree.
05: *
06: * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License as published by
08: * the Free Software Foundation, either version 3 of the License, or
09: * (at your option) any later version.
10: *
11: * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public License
17: * along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
18: */
19: /*
20: * Created on 05/10/2006
21: */
22: package japa.parser.ast.body;
23:
24: import japa.parser.ast.TypeParameter;
25: import japa.parser.ast.expr.AnnotationExpr;
26: import japa.parser.ast.expr.NameExpr;
27: import japa.parser.ast.stmt.BlockStmt;
28: import japa.parser.ast.type.Type;
29: import japa.parser.ast.visitor.GenericVisitor;
30: import japa.parser.ast.visitor.VoidVisitor;
31:
32: import java.util.List;
33:
34: /**
35: * @author Julio Vilmar Gesser
36: */
37: public final class MethodDeclaration extends BodyDeclaration {
38:
39: public final int modifiers;
40:
41: public final List<AnnotationExpr> annotations;
42:
43: public final List<TypeParameter> typeParameters;
44:
45: public final Type type;
46:
47: public final String name;
48:
49: public final List<Parameter> parameters;
50:
51: public final int arrayCount;
52:
53: public final List<NameExpr> throws_;
54:
55: public final BlockStmt block;
56:
57: public MethodDeclaration(int line, int column, int modifiers,
58: List<AnnotationExpr> annotations,
59: List<TypeParameter> typeParameters, Type type, String name,
60: List<Parameter> parameters, int arrayCount,
61: List<NameExpr> throws_, BlockStmt block) {
62: super (line, column);
63: this .modifiers = modifiers;
64: this .annotations = annotations;
65: this .typeParameters = typeParameters;
66: this .type = type;
67: this .name = name;
68: this .parameters = parameters;
69: this .arrayCount = arrayCount;
70: this .throws_ = throws_;
71: this .block = block;
72: }
73:
74: @Override
75: public <A> void accept(VoidVisitor<A> v, A arg) {
76: v.visit(this , arg);
77: }
78:
79: @Override
80: public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
81: return v.visit(this, arg);
82: }
83: }
|