public class CreateMethodOperation extends CreateTypeMemberOperation
This operation creates an instance method.
Required Attributes:
JavaModelOperation.IPostAction| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String[] |
parameterTypes |
alteredName, createdNode, sourceanchorElement, creationOccurred, cuAST, INSERT_AFTER, INSERT_BEFORE, INSERT_LAST, insertionPolicyactions, actionsEnd, actionsStart, APPEND, attributes, elementsToProcess, force, HAS_MODIFIED_RESOURCE_ATTR, isNested, KEEP_EXISTING, NO_ELEMENTS, OPERATION_STACKS, parentElements, POST_ACTION_VERBOSE, progressMonitor, REMOVEALL_APPEND, resultElements, TRUE| Constructor and Description |
|---|
CreateMethodOperation(IType parentElement,
java.lang.String source,
boolean force)
When executed, this operation will create a method
in the given type with the specified source.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String[] |
convertASTMethodTypesToSignatures()
Returns the type signatures of the parameter types of the
current
MethodDeclaration |
protected ASTNode |
generateElementAST(ASTRewrite rewriter,
ICompilationUnit cu) |
protected IJavaElement |
generateResultHandle()
Creates and returns the handle for the element this operation created.
|
java.lang.String |
getMainTaskName()
Returns the name of the main task of this operation for
progress reporting.
|
protected SimpleName |
rename(ASTNode node,
SimpleName newName) |
protected IJavaModelStatus |
verifyNameCollision()
Verify for a name collision in the destination container.
|
generateSyntaxIncorrectAST, getChildPropertyDescriptor, getType, setAlteredName, verifycheckCanceled, createAfter, createBefore, executeOperation, generateNewCompilationUnitAST, generateResultHandles, getCompilationUnit, getMainAmountOfWork, getSchedulingRule, initializeDefaultPosition, insertASTNode, parse, setRelativePositionaddAction, addDelta, addReconcileDelta, applyTextEdit, beginTask, canModifyRoots, commonVerify, copyResources, createFile, createFolder, deleteEmptyPackageFragment, deleteResource, deleteResources, done, equalsOneOf, executeNestedOperation, firstActionWithID, getAttribute, getCompilationUnitFor, getCurrentOperationStack, getDocument, getElementToProcess, getJavaModel, getNestedFolders, getParentElement, getParentElements, getResultElements, getSubProgressMonitor, hasModifiedResource, internalWorked, isCanceled, isReadOnly, isTopLevelOperation, moveResources, newJavaElementDelta, popOperation, postAction, prefixesOneOf, pushOperation, removeAllPostAction, removeReconcileDelta, run, runOperation, runPostActions, setAttribute, setCanceled, setNested, setTaskName, subTask, workedpublic CreateMethodOperation(IType parentElement, java.lang.String source, boolean force)
protected java.lang.String[] convertASTMethodTypesToSignatures()
MethodDeclarationprotected ASTNode generateElementAST(ASTRewrite rewriter, ICompilationUnit cu) throws JavaModelException
generateElementAST in class CreateTypeMemberOperationJavaModelExceptionprotected IJavaElement generateResultHandle()
CreateElementInCUOperationgenerateResultHandle in class CreateElementInCUOperationCreateElementInCUOperation.generateResultHandle()public java.lang.String getMainTaskName()
CreateElementInCUOperationgetMainTaskName in class CreateElementInCUOperationCreateElementInCUOperation.getMainTaskName()protected SimpleName rename(ASTNode node, SimpleName newName)
rename in class CreateTypeMemberOperationprotected IJavaModelStatus verifyNameCollision()
CreateTypeMemberOperationverifyNameCollision in class CreateTypeMemberOperationCreateTypeMemberOperation.verifyNameCollision()