Composite Refactoring
v1.0

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');


Constructor Summary
CreateAbstractMethodRefactoring(IType parentType, String name, String returnType, String[] parameters)
          creates a CreateAbstractMethodRefactoring object.
 
Method Summary
 RefactoringStatus checkActivation(IProgressMonitor pm)
          checks if there is a modifyable IType in which the new method can be created.
 RefactoringStatus checkInput(IProgressMonitor pm)
          checks if the method already exists and if the type of parameters and return type is valid.
 IChange createChange(IProgressMonitor pm)
          creates the change object for this refactoring.
 String getName()
          gets the name of the refactoring.
 
Methods inherited from class org.eclipse.jdt.internal.corext.refactoring.base.Refactoring
checkPreconditions, getUndoManager, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreateAbstractMethodRefactoring

public CreateAbstractMethodRefactoring(IType parentType,
                                       String name,
                                       String returnType,
                                       String[] parameters)
creates a CreateAbstractMethodRefactoring object.
Parameters:
parentType - the method's parent type
name - the name of the new method
returnType - the return type of the new method
parameters - the parameters for the new method. They are suppposed to look something like {"Object o", "int i", "String s"}.
Method Detail

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.

Composite Refactoring
v1.0