Composite Refactoring
v1.0

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).


Fields inherited from class org.eclipse.jdt.internal.core.CreateMethodOperation
fParameterTypes
 
Fields inherited from class org.eclipse.jdt.internal.core.CreateTypeMemberOperation
fAlteredName, fDOMNode, fSource
 
Fields inherited from class org.eclipse.jdt.internal.core.CreateElementInCUOperation
fAnchorElement, fCreatedElement, fCreationOccurred, fCUDOM, fInsertionPolicy, fInsertionPosition, fReplacementLength, INSERT_AFTER, INSERT_BEFORE, INSERT_LAST
 
Fields inherited from class org.eclipse.jdt.internal.core.JavaModelOperation
fDeltas, fElementsToProcess, fForce, fgEmptyResult, fMonitor, fNested, fParentElements, fResultElements, hasModifiedResource
 
Fields inherited from interface org.eclipse.core.runtime.IProgressMonitor
UNKNOWN
 
Constructor Summary
CreateAbstractMethod(IType parentType, String name, String returnType, String[] parameters, boolean force)
          creates an object of CreateAbstractMethod.
 
Method Summary
 void executeOperation()
          creates the abstract method.
 IJavaModelStatus verify()
          verifies if the method can be created.
 
Methods inherited from class org.eclipse.jdt.internal.core.CreateMethodOperation
convertDOMMethodTypesToSignatures, generateElementDOM, generateResultHandle, getMainTaskName, verifyNameCollision
 
Methods inherited from class org.eclipse.jdt.internal.core.CreateTypeMemberOperation
generateNewCompilationUnitDOM, generateSyntaxIncorrectDOM, getType, setAlteredName
 
Methods inherited from class org.eclipse.jdt.internal.core.CreateElementInCUOperation
checkCanceled, createAfter, createBefore, generateResultHandles, getCompilationUnit, getMainAmountOfWork, getResultElements, initializeDefaultPosition, insertDOMNode, setRelativePosition
 
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
 

Constructor Detail

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.
Method Detail

verify

public IJavaModelStatus verify()
verifies if the method can be created. Possible failures:
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

Composite Refactoring
v1.0