org.acm.seguin.refactor.method
Class RenameMethodRefactoring

java.lang.Object
  extended by org.acm.seguin.refactor.Refactoring
      extended by org.acm.seguin.refactor.method.RenameMethodRefactoring

public class RenameMethodRefactoring
extends Refactoring

Moves a method from one class to another. Generally used to move a method into a local variable or a parameter.

Since:
2.9.11
Author:
CMike Atkinson

Field Summary
protected  java.lang.String method
          The name of the method
protected  java.lang.String[] params
           
protected  TypeSummary typeSummary
          The type summary that contains the method
 
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
RenameMethodRefactoring()
          Constructor for the MoveMethodRefactoring object
 
Method Summary
protected  boolean checkParams(MethodSummary summary)
           
 java.lang.String getDescription()
          Gets the description of the refactoring
protected  FileSummary getFileSummary(Summary current)
          Gets the package summary for the specific object
 int getID()
          Gets the ID attribute of the MoveMethodRefactoring 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()
          Describes the preconditions that must be true for this refactoring to be applied
protected  void removeMethod(TypeSummary source, ComplexTransform transform, RemoveMethodTransform rft)
          Description of the Method
 void setClass(java.lang.String packageName, java.lang.String className)
          Sets the Class attribute of the MethodRefactoring object
 void setClass(TypeSummary init)
          Sets the Class attribute of the MethodRefactoring object
 void setMethod(MethodSummary value)
          Sets the Method attribute of the MoveMethodRefactoring object
 void setMethod(java.lang.String methodName)
          Sets the Method attribute of the MethodRefactoring object
 void setNewMethodName(java.lang.String newName)
          Sets the Destination attribute of the MoveMethodRefactoring object
 void setParams(java.lang.String[] params)
          Sets the types of the Parameters of the method of the MethodRefactoring object
protected  void transform()
          Performs the transform on the rest of the classes
 
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

method

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


params

protected java.lang.String[] params

typeSummary

protected TypeSummary typeSummary
The type summary that contains the method

Constructor Detail

RenameMethodRefactoring

public RenameMethodRefactoring()
Constructor for the MoveMethodRefactoring object

Since:
empty
Method Detail

setMethod

public void setMethod(MethodSummary value)
Sets the Method attribute of the MoveMethodRefactoring object

Parameters:
value - The new Method value
Since:
empty

setNewMethodName

public void setNewMethodName(java.lang.String newName)
Sets the Destination attribute of the MoveMethodRefactoring object

Parameters:
newName - The new newMethodName value
Since:
empty

getDescription

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

Specified by:
getDescription in class Refactoring
Returns:
the description
Since:
empty

getID

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

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

preconditions

protected void preconditions()
                      throws RefactoringException
Describes the preconditions that must be true for this refactoring to be applied

Specified by:
preconditions in class Refactoring
Throws:
RefactoringException - thrown if one or more of the preconditions is not satisfied. The text of the exception provides a hint of what went wrong.
Since:
empty

checkParams

protected boolean checkParams(MethodSummary summary)

transform

protected void transform()
Performs the transform on the rest of the classes

Specified by:
transform in class Refactoring
Since:
empty

setClass

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

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

setClass

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

Parameters:
init - The new Class value

setMethod

public void setMethod(java.lang.String methodName)
Sets the Method attribute of the MethodRefactoring object

Parameters:
methodName - The new Method value

setParams

public void setParams(java.lang.String[] params)
Sets the types of the Parameters of the method of the MethodRefactoring object

Parameters:
params - The new Parameter types

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

removeMethod

protected void removeMethod(TypeSummary source,
                            ComplexTransform transform,
                            RemoveMethodTransform rft)
Description of the Method

Parameters:
source - Description of Parameter
transform - Description of Parameter
rft - Description of Parameter