AddFieldTransform.java :  » UML » jrefactory » org » acm » seguin » refactor » field » Java Open Source

Java Open Source » UML » jrefactory 
jrefactory » org » acm » seguin » refactor » field » AddFieldTransform.java
package org.acm.seguin.refactor.field;

import net.sourceforge.jrefactory.ast.SimpleNode;
import org.acm.seguin.refactor.TransformAST;

/**
 *  Adds a field declaration to a AST 
 *
 *@author    Chris Seguin 
 */
public class AddFieldTransform extends TransformAST {
  private SimpleNode fieldDecl;


  /**
   *  Constructor for the AddFieldTransform object 
   *
   *@param  init  the field declaration to add 
   */
  public AddFieldTransform(SimpleNode init) {
    fieldDecl = init;
  }


  /**
   *  Updates the AST 
   *
   *@param  root  the root of the AST 
   */
  public void update(SimpleNode root) {
    //  Apply each individual transformation
    AddFieldVisitor afv = new AddFieldVisitor(fieldDecl);
    afv.visit(root, null);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.