compositeRefactoring.codemanipulation
Class CreateAbstractMethod
java.lang.Object
|
+--org.eclipse.jdt.internal.core.JavaModelOperation
|
+--org.eclipse.jdt.internal.core.CreateElementInCUOperation
|
+--org.eclipse.jdt.internal.core.CreateTypeMemberOperation
|
+--org.eclipse.jdt.internal.core.CreateMethodOperation
|
+--compositeRefactoring.codemanipulation.CreateAbstractMethod
- All Implemented Interfaces:
- IProgressMonitor, IWorkspaceRunnable
- public class CreateAbstractMethod
- extends CreateMethodOperation
This is a convenience class to make the CreateMethodOperation public.
The class creates an abstract method (no body).
Methods inherited from class org.eclipse.jdt.internal.core.JavaModelOperation |
addDelta, beginTask, commonVerify, copyResources, createFile, createFolder, deleteEmptyPackageFragment, deleteResource, deleteResources, done, execute, executeNestedOperation, getCompilationUnitFor, getElementsToProcess, getElementToProcess, getJavaModel, getParentElement, getParentElements, getSubProgressMonitor, getWorkspace, hasModifiedResource, internalWorked, isCanceled, isReadOnly, makeWorkingCopiesConsistent, moveResources, newJavaElementDelta, registerDeltas, run, setCanceled, setNested, setTaskName, subTask, walkDeltaMakingWorkingCopiesConsistent, worked |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CreateAbstractMethod
public CreateAbstractMethod(IType parentType,
String name,
String returnType,
String[] parameters,
boolean force)
- creates an object of CreateAbstractMethod.
- Parameters:
parentType
- the type in which the method will be created.name
- the method's name.returnType
- the return type of the method.parameters
- the parameters of the method. The String array is supposed tp look like
{"Object o", "int i", "String s"}.force
- indicates if an existing method should be overridden.
- true if an existing method should be overriden
- false if an existing method cancels the operation.
verify
public IJavaModelStatus verify()
- verifies if the method can be created.
Possible failures:
- NO_ELEMENTS_TO_PROCESS - the parent element supplied to the operation is
null
.
- INVALID_CONTENTS - The source is
null
or has serious syntax errors.
- NAME_COLLISION - A name collision occurred in the destination
- Overrides:
verify
in class CreateTypeMemberOperation
- Returns:
- the status of this verification\
executeOperation
public void executeOperation()
- creates the abstract method.
- Overrides:
executeOperation
in class CreateElementInCUOperation
- Following copied from class:
org.eclipse.jdt.internal.core.CreateElementInCUOperation
- Throws:
JavaModelException
- if the operation is unable to complete