org.acm.seguin.refactor.type
Class RenameClassRefactoring

java.lang.Object
  extended by org.acm.seguin.refactor.Refactoring
      extended by org.acm.seguin.refactor.type.RenameClassRefactoring

public class RenameClassRefactoring
extends Refactoring

Main program for renaming a class.

Author:
Chris Seguin

Field Summary
protected  java.io.File base
          The root directory
protected  java.lang.String newClassName
          The new name of the class
protected  java.lang.String oldClassName
          The name of the class
protected  java.lang.String srcPackage
          The source package
 
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
protected RenameClassRefactoring()
          Constructor for repackage
 
Method Summary
 java.lang.String getDescription()
          Gets the description of the refactoring
protected  FileSummary getFileSummary()
          Gets the file summary that we are changing
 int getID()
          Gets the id for this refactoring to track which refactorings are used.
protected  void preconditions()
          Preconditions for the refactoring to be applied
 void setDirectory(java.lang.String dir)
          Set the directory
 void setNewClassName(java.lang.String value)
          Sets the NewClassName attribute of the RenameClass object
 void setOldClassName(java.lang.String value)
          Sets the OldClassName attribute of the RenameClass object
protected  void transform()
          The transformation of all the source files
 
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

base

protected java.io.File base
The root directory


oldClassName

protected java.lang.String oldClassName
The name of the class


newClassName

protected java.lang.String newClassName
The new name of the class


srcPackage

protected java.lang.String srcPackage
The source package

Constructor Detail

RenameClassRefactoring

protected RenameClassRefactoring()
Constructor for repackage

Method Detail

setDirectory

public void setDirectory(java.lang.String dir)
Set the directory

Parameters:
dir - the initial directory

setOldClassName

public void setOldClassName(java.lang.String value)
Sets the OldClassName attribute of the RenameClass object

Parameters:
value - The new OldClassName value

setNewClassName

public void setNewClassName(java.lang.String value)
Sets the NewClassName attribute of the RenameClass object

Parameters:
value - The new NewClassName value

getDescription

public java.lang.String getDescription()
Gets the description of the refactoring

Specified by:
getDescription in class Refactoring
Returns:
the description

getID

public int getID()
Gets the id for this refactoring to track which refactorings are used.

Specified by:
getID in class Refactoring
Returns:
the id

getFileSummary

protected FileSummary getFileSummary()
Gets the file summary that we are changing

Returns:
The FileSummary value

preconditions

protected void preconditions()
                      throws RefactoringException
Preconditions for the refactoring to be applied

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

transform

protected void transform()
The transformation of all the source files

Specified by:
transform in class Refactoring