|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.acm.seguin.refactor.Refactoring
org.acm.seguin.refactor.method.RenameMethodRefactoring
public class RenameMethodRefactoring
Moves a method from one class to another. Generally used to move a method into a local variable or a parameter.
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 |
---|
protected java.lang.String method
protected java.lang.String[] params
protected TypeSummary typeSummary
Constructor Detail |
---|
public RenameMethodRefactoring()
Method Detail |
---|
public void setMethod(MethodSummary value)
value
- The new Method valuepublic void setNewMethodName(java.lang.String newName)
newName
- The new newMethodName valuepublic java.lang.String getDescription()
getDescription
in class Refactoring
public int getID()
getID
in class Refactoring
protected void preconditions() throws RefactoringException
preconditions
in class Refactoring
RefactoringException
- thrown if one or more of the preconditions is not satisfied. The text of the
exception provides a hint of what went wrong.protected boolean checkParams(MethodSummary summary)
protected void transform()
transform
in class Refactoring
public void setClass(java.lang.String packageName, java.lang.String className)
packageName
- the package nameclassName
- the class namepublic void setClass(TypeSummary init)
init
- The new Class valuepublic void setMethod(java.lang.String methodName)
methodName
- The new Method valuepublic void setParams(java.lang.String[] params)
params
- The new Parameter typesprotected boolean isInJavaLang(net.sourceforge.jrefactory.ast.ASTName type)
type
- the type
protected boolean isInJavaLang(TypeSummary type)
type
- the type
protected PackageSummary getPackage(Summary current)
current
- the summary
protected FileSummary getFileSummary(Summary current)
current
- the summary
protected void removeMethod(TypeSummary source, ComplexTransform transform, RemoveMethodTransform rft)
source
- Description of Parametertransform
- Description of Parameterrft
- Description of Parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |