Class CreateTypeOperation
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
org.aspectj.org.eclipse.jdt.internal.core.CreateElementInCUOperation
org.aspectj.org.eclipse.jdt.internal.core.CreateTypeMemberOperation
org.aspectj.org.eclipse.jdt.internal.core.CreateTypeOperation
- All Implemented Interfaces:
org.eclipse.core.resources.IWorkspaceRunnable,org.eclipse.core.runtime.ICoreRunnable,org.eclipse.core.runtime.IProgressMonitor
This operation creates a class or interface.
Required Attributes:
- Parent element - must be a compilation unit, or type.
- The source code for the type. No verification of the source is performed.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
JavaModelOperation.IPostAction -
Field Summary
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.CreateTypeMemberOperation
alteredName, createdNode, sourceFields inherited from class org.aspectj.org.eclipse.jdt.internal.core.CreateElementInCUOperation
anchorElement, creationOccurred, cuAST, INSERT_AFTER, INSERT_BEFORE, INSERT_LAST, insertionPolicyFields inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
actions, 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, TRUEFields inherited from interface org.eclipse.core.runtime.IProgressMonitor
UNKNOWN -
Constructor Summary
ConstructorsConstructorDescriptionCreateTypeOperation(IJavaElement parentElement, String source, boolean force) When executed, this operation will create a type unit in the given parent element (a compilation unit, type) -
Method Summary
Modifier and TypeMethodDescriptionprotected ASTNodegenerateElementAST(ASTRewrite rewriter, ICompilationUnit cu) protected IJavaElementCreates and returns the handle for the element this operation created.Returns the name of the main task of this operation for progress reporting.protected ITypegetType()Returns theITypethe member is to be created in.protected SimpleNamerename(ASTNode node, SimpleName newName) verify()Possible failures: NO_ELEMENTS_TO_PROCESS - the parent element supplied to the operation isnull.protected IJavaModelStatusVerify for a name collision in the destination container.Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.CreateTypeMemberOperation
generateSyntaxIncorrectAST, getChildPropertyDescriptor, setAlteredNameMethods inherited from class org.aspectj.org.eclipse.jdt.internal.core.CreateElementInCUOperation
checkCanceled, createAfter, createBefore, executeOperation, generateNewCompilationUnitAST, generateResultHandles, getCompilationUnit, getMainAmountOfWork, getSchedulingRule, initializeDefaultPosition, insertASTNode, parse, setRelativePositionMethods inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
addAction, addDelta, addReconcileDelta, applyTextEdit, beginTask, canModifyRoots, commonVerify, copyResources, createFile, createFolder, deleteEmptyPackageFragment, deleteResource, deleteResources, done, equalsOneOf, executeNestedOperation, firstActionWithID, getAttribute, getCompilationUnitFor, getCurrentOperationStack, getDocument, getElementToProcess, getJavaModel, getLatestASTLevel, 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, workedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.runtime.IProgressMonitor
clearBlocked, setBlocked, slice
-
Constructor Details
-
CreateTypeOperation
When executed, this operation will create a type unit in the given parent element (a compilation unit, type)
-
-
Method Details
-
generateElementAST
protected ASTNode generateElementAST(ASTRewrite rewriter, ICompilationUnit cu) throws JavaModelException - Overrides:
generateElementASTin classCreateTypeMemberOperation- Throws:
JavaModelException
-
generateResultHandle
Description copied from class:CreateElementInCUOperationCreates and returns the handle for the element this operation created.- Specified by:
generateResultHandlein classCreateElementInCUOperation- See Also:
-
getMainTaskName
Description copied from class:CreateElementInCUOperationReturns the name of the main task of this operation for progress reporting.- Specified by:
getMainTaskNamein classCreateElementInCUOperation- See Also:
-
getType
Returns theITypethe member is to be created in.- Overrides:
getTypein classCreateTypeMemberOperation
-
verifyNameCollision
Description copied from class:CreateTypeMemberOperationVerify for a name collision in the destination container.- Overrides:
verifyNameCollisionin classCreateTypeMemberOperation- See Also:
-
verify
Description copied from class:CreateTypeMemberOperationPossible failures:- NO_ELEMENTS_TO_PROCESS - the parent element supplied to the operation is
null. - INVALID_CONTENTS - The source is
nullor has serious syntax errors. - NAME_COLLISION - A name collision occurred in the destination
- Overrides:
verifyin classCreateTypeMemberOperation- See Also:
- NO_ELEMENTS_TO_PROCESS - the parent element supplied to the operation is
-
rename
- Specified by:
renamein classCreateTypeMemberOperation
-