org.acm.seguin.refactor.field
Class RenameFieldRefactoring

java.lang.Object
  extended by org.acm.seguin.refactor.Refactoring
      extended by org.acm.seguin.refactor.field.RenameFieldRefactoring

public class RenameFieldRefactoring
extends Refactoring

Renames a field

Author:
Chris Seguin

Field Summary
protected  java.lang.String field
          The name of the field
protected  TypeSummary typeSummary
          The type summary that contains the field
 
Fields inherited from class org.acm.seguin.refactor.Refactoring
ADD_CHILD, ADD_PARENT, EXTRACT_INTERFACE, EXTRACT_METHOD, MOVE_METHOD, PUSH_DOWN_FIELD, PUSH_DOWN_METHOD, PUSH_UP_ABSTRACT_METHOD, PUSH_UP_FIELD, PUSH_UP_METHOD, REMOVE_CLASS, RENAME_CLASS, RENAME_FIELD, RENAME_METHOD, RENAME_PARAMETER, REPACKAGE
 
Constructor Summary
RenameFieldRefactoring()
          Constructor for the RenameFieldRefactoring object
 
Method Summary
 java.lang.String getDescription()
          Gets the Description attribute of the RenameFieldRefactoring object
protected  java.lang.Object getFieldType(net.sourceforge.jrefactory.ast.SimpleNode node, FileSummary fileSummary)
          Gets the FieldType attribute of the PullupFieldRefactoring object
protected  FileSummary getFileSummary(Summary current)
          Gets the package summary for the specific object
 int getID()
          Gets the ID attribute of the RenameFieldRefactoring object
protected  PackageSummary getPackage(Summary current)
          Gets the package summary for the specific object
protected  boolean isInJavaLang(net.sourceforge.jrefactory.ast.ASTName type)
          Determines if the specified type is in java.lang package
protected  boolean isInJavaLang(TypeSummary type)
          Determines if the specified type is in java.lang package
protected  void preconditions()
          Check that thsi refactoring can be performed
 void setClass(java.lang.String packageName, java.lang.String className)
          Sets the Class attribute of the PullupFieldRefactoring object
 void setClass(TypeSummary init)
          Sets the Class attribute of the PullupFieldRefactoring object
 void setField(java.lang.String fieldName)
          Sets the Field attribute of the PullupFieldRefactoring object
 void setNewName(java.lang.String value)
          Sets the NewName attribute of the RenameFieldRefactoring object
protected  void transform()
          Applies the transformation to the system to rename the method
 
Methods inherited from class org.acm.seguin.refactor.Refactoring
checkDestinationFile, getComplexTransform, run, setComplexTransform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

field

protected java.lang.String field
The name of the field


typeSummary

protected TypeSummary typeSummary
The type summary that contains the field

Constructor Detail

RenameFieldRefactoring

public RenameFieldRefactoring()
Constructor for the RenameFieldRefactoring object

Method Detail

setNewName

public void setNewName(java.lang.String value)
Sets the NewName attribute of the RenameFieldRefactoring object

Parameters:
value - The new NewName value

getDescription

public java.lang.String getDescription()
Gets the Description attribute of the RenameFieldRefactoring object

Specified by:
getDescription in class Refactoring
Returns:
The Description value

getID

public int getID()
Gets the ID attribute of the RenameFieldRefactoring object

Specified by:
getID in class Refactoring
Returns:
The ID value

preconditions

protected void preconditions()
                      throws RefactoringException
Check that thsi refactoring can be performed

Specified by:
preconditions in class Refactoring
Throws:
RefactoringException - Description of Exception

transform

protected void transform()
Applies the transformation to the system to rename the method

Specified by:
transform in class Refactoring

setClass

public void setClass(java.lang.String packageName,
                     java.lang.String className)
Sets the Class attribute of the PullupFieldRefactoring object

Parameters:
packageName - the package name
className - the class name

setClass

public void setClass(TypeSummary init)
Sets the Class attribute of the PullupFieldRefactoring object

Parameters:
init - The new Class value

setField

public void setField(java.lang.String fieldName)
Sets the Field attribute of the PullupFieldRefactoring object

Parameters:
fieldName - The new Field value

isInJavaLang

protected boolean isInJavaLang(net.sourceforge.jrefactory.ast.ASTName type)
Determines if the specified type is in java.lang package

Parameters:
type - the type
Returns:
true if it is in the package

isInJavaLang

protected boolean isInJavaLang(TypeSummary type)
Determines if the specified type is in java.lang package

Parameters:
type - the type
Returns:
true if it is in the package

getPackage

protected PackageSummary getPackage(Summary current)
Gets the package summary for the specific object

Parameters:
current - the summary
Returns:
the package summary

getFileSummary

protected FileSummary getFileSummary(Summary current)
Gets the package summary for the specific object

Parameters:
current - the summary
Returns:
the package summary

getFieldType

protected java.lang.Object getFieldType(net.sourceforge.jrefactory.ast.SimpleNode node,
                                        FileSummary fileSummary)
Gets the FieldType attribute of the PullupFieldRefactoring object

Parameters:
node - Description of Parameter
fileSummary - Description of Parameter
Returns:
The FieldType value