01: /*
02: * Author: Chris Seguin
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 org.acm.seguin.refactor.method;
10:
11: import net.sourceforge.jrefactory.ast.SimpleNode;
12: import org.acm.seguin.refactor.TransformAST;
13:
14: /**
15: * Adds a method declaration to a AST
16: *
17: *@author Chris Seguin
18: */
19: public class AddMethodTransform extends TransformAST {
20: private SimpleNode methodDecl;
21:
22: /**
23: * Constructor for the AddMethodTransform object
24: *
25: *@param init the method declaration to add
26: */
27: public AddMethodTransform(SimpleNode init) {
28: methodDecl = init;
29: }
30:
31: /**
32: * Updates the AST
33: *
34: *@param root the root of the AST
35: */
36: public void update(SimpleNode root) {
37: // Apply each individual transformation
38: AddMethodVisitor afv = new AddMethodVisitor(methodDecl);
39: afv.visit(root, null);
40: }
41: }
|