compositeRefactoring.refactoring
Class CreateAbstractMethodRefactoring
java.lang.Object
|
+--org.eclipse.jdt.internal.corext.refactoring.base.Refactoring
|
+--compositeRefactoring.refactoring.CreateAbstractMethodRefactoring
- All Implemented Interfaces:
- IRefactoring
- public class CreateAbstractMethodRefactoring
- extends Refactoring
This class is the representation of a refactoring performing create abstract method transformation.
A method will be created that looks something like
public abstract 'returnType' 'methodName'('parameters');
CreateAbstractMethodRefactoring
public CreateAbstractMethodRefactoring(IType parentType,
String name,
String returnType,
String[] parameters)
- creates a CreateAbstractMethodRefactoring object.
- Parameters:
parentType
- the method's parent typename
- the name of the new methodreturnType
- the return type of the new methodparameters
- the parameters for the new method. They are suppposed to look something like
{"Object o", "int i", "String s"}.
checkActivation
public RefactoringStatus checkActivation(IProgressMonitor pm)
throws JavaModelException
- checks if there is a modifyable IType in which
the new method can be created.
- Overrides:
checkActivation
in class Refactoring
- Parameters:
pm
- the progress monitor which tracks the check.- Returns:
- the status of the check.
checkInput
public RefactoringStatus checkInput(IProgressMonitor pm)
throws JavaModelException
- checks if the method already exists and if the type of parameters and return type is valid.
- Overrides:
checkInput
in class Refactoring
- Parameters:
pm
- the progress monitor which tracks the check.- Returns:
- the status of the check.
createChange
public IChange createChange(IProgressMonitor pm)
throws JavaModelException
- creates the change object for this refactoring. The change object is the actual transformation
of code.
- Parameters:
pm
- the progress monitor tracking the change.- Returns:
- the change object.
getName
public String getName()
- gets the name of the refactoring.
- Returns:
- the name of the refactoring.