compositeRefactoring.changes
Class CreateAbstractMethodChange
java.lang.Object
|
+--org.eclipse.jdt.internal.corext.refactoring.base.Change
|
+--compositeRefactoring.changes.CreateAbstractMethodChange
- All Implemented Interfaces:
- IChange
- public class CreateAbstractMethodChange
- extends Change
- implements IChange
This class represents an IChange for the refactoring CreateAbstractMethodRefactoring.
It is created when the method CreateAbstractMethodRefactoring.createChange(IProgressMonitor pm) is called.
An abstract method (with no body) is created and stored in the parent element, here an IType object.
CreateAbstractMethodChange
public CreateAbstractMethodChange(IType parentType,
String name,
String returnType,
String[] parameters)
- creates a new CreateAbstractMethodChange object.
- Parameters:
parentType
- the Type in which the new method is to be created.name
- the name of the abstract method.returnType
- the return type of the abstract method.parameters
- the method's parameter. The String array should look like
{"Object o", "java.util.Vector", "int i"}.
perform
public void perform(ChangeContext context,
IProgressMonitor pm)
throws JavaModelException,
ChangeAbortException
- performs the change. When this method is called, a new abstract method is created in the parentType.
The method's declaration is "public abstrac 'methodName'('parameters');".
- Specified by:
perform
in interface IChange
- Parameters:
context
- the change context in which the change is performedpm
- a progress monitor tracking the changes.
getUndoChange
public IChange getUndoChange()
- gets the undo change. The undo change deletes the created method from the parentType.
- Specified by:
getUndoChange
in interface IChange
- Returns:
- the undo change.
getName
public String getName()
- gets the name of this change.
- Specified by:
getName
in interface IChange
- Following copied from interface:
org.eclipse.jdt.internal.corext.refactoring.base.IChange
- Returns:
- the change's name.
getModifiedLanguageElement
public Object getModifiedLanguageElement()
- gets the modified language element. In this case, the modified language element is a type.
- Specified by:
getModifiedLanguageElement
in interface IChange
- Returns:
- the modified language element.