|
||||||||||
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.MoveMethodRefactoring
public class MoveMethodRefactoring
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
|
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 |
MoveMethodRefactoring()
Constructor for the MoveMethodRefactoring object |
Method Summary | |
---|---|
protected void |
addMethodToDest(ComplexTransform transform,
net.sourceforge.jrefactory.ast.SimpleNode methodDecl,
TypeSummary dest)
Adds the method to the destination class |
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 net.sourceforge.jrefactory.ast.SimpleNode |
removeMethod(TypeSummary source,
ComplexTransform transform)
Removes the method from the source |
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 |
setDestination(Summary value)
Sets the Destination attribute of the MoveMethodRefactoring 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 |
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
Constructor Detail |
---|
protected MoveMethodRefactoring()
Method Detail |
---|
public void setMethod(MethodSummary value)
value
- The new Method valuepublic void setDestination(Summary value)
value
- The new Destination 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 void transform()
transform
in class Refactoring
protected net.sourceforge.jrefactory.ast.SimpleNode removeMethod(TypeSummary source, ComplexTransform transform)
source
- the source typetransform
- the transform
protected void addMethodToDest(ComplexTransform transform, net.sourceforge.jrefactory.ast.SimpleNode methodDecl, TypeSummary dest)
transform
- The feature to be added to the MethodToDest attributemethodDecl
- The feature to be added to the MethodToDest attributedest
- The feature to be added to the MethodToDest attributepublic 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 |