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.refactor.TransformAST;
12: import net.sourceforge.jrefactory.ast.SimpleNode;
13: import org.acm.seguin.summary.MethodSummary;
14:
15: /**
16: * Changes the scope of the method
17: *
18: *@author Chris Seguin
19: */
20: class ChangeMethodScopeTransform extends TransformAST {
21: private int scope;
22: private MethodSummary methodSummary;
23:
24: /**
25: * Constructor for the ChangeMethodScopeTransform object
26: *
27: *@param init Description of Parameter
28: *@param changeTo Description of Parameter
29: */
30: ChangeMethodScopeTransform(MethodSummary init, int changeTo) {
31: methodSummary = init;
32: scope = changeTo;
33: }
34:
35: /**
36: * Updates the AST
37: *
38: *@param root the root of the AST
39: */
40: public void update(SimpleNode root) {
41: root.jjtAccept(new ChangeMethodScopeVisitor(methodSummary,
42: scope), null);
43: }
44: }
|