01: package org.acm.seguin.refactor.field;
02:
03: import net.sourceforge.jrefactory.ast.SimpleNode;
04: import org.acm.seguin.refactor.TransformAST;
05:
06: /**
07: * Adds a field declaration to a AST
08: *
09: *@author Chris Seguin
10: */
11: public class AddFieldTransform extends TransformAST {
12: private SimpleNode fieldDecl;
13:
14: /**
15: * Constructor for the AddFieldTransform object
16: *
17: *@param init the field declaration to add
18: */
19: public AddFieldTransform(SimpleNode init) {
20: fieldDecl = init;
21: }
22:
23: /**
24: * Updates the AST
25: *
26: *@param root the root of the AST
27: */
28: public void update(SimpleNode root) {
29: // Apply each individual transformation
30: AddFieldVisitor afv = new AddFieldVisitor(fieldDecl);
31: afv.visit(root, null);
32: }
33: }
|