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 org.acm.seguin.summary.MethodSummary;
12: import org.acm.seguin.refactor.TransformAST;
13: import net.sourceforge.jrefactory.ast.SimpleNode;
14:
15: /**
16: * A transform that removes a specific method
17: *
18: *@author Chris Seguin
19: */
20: public class RemoveMethodTransform extends TransformAST {
21: private SimpleNode methodDecl;
22: private MethodSummary method;
23:
24: /**
25: * Constructor for the RemoveMethodTransform object
26: *
27: *@param init the summary of the method
28: */
29: public RemoveMethodTransform(MethodSummary init) {
30: method = init;
31: }
32:
33: /**
34: * Gets the MethodDeclaration attribute of the RemoveMethodTransform object
35: *
36: *@return The MethodDeclaration value
37: */
38: public SimpleNode getMethodDeclaration() {
39: return methodDecl;
40: }
41:
42: /**
43: * Updates the root
44: *
45: *@param root the ro
46: */
47: public void update(SimpleNode root) {
48: RemoveMethodVisitor rfv = new RemoveMethodVisitor(method);
49: rfv.visit(root, null);
50: methodDecl = rfv.getMethodDeclaration();
51: }
52: }
|