|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation
org.aspectj.org.eclipse.jdt.internal.core.CreateElementInCUOperation
org.aspectj.org.eclipse.jdt.internal.core.CreatePackageDeclarationOperation
public class CreatePackageDeclarationOperation
This operation adds/replaces a package declaration in an existing compilation unit. If the compilation unit already includes the specified package declaration, it is not generated (it does not generate duplicates).
Required Attributes:
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaModelOperation |
|---|
JavaModelOperation.IPostAction |
| Field Summary | |
|---|---|
protected java.lang.String |
name
The name of the package declaration being created |
| Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.CreateElementInCUOperation |
|---|
anchorElement, creationOccurred, cuAST, INSERT_AFTER, INSERT_BEFORE, INSERT_LAST, insertionPolicy |
| Fields 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, TRUE |
| Constructor Summary | |
|---|---|
CreatePackageDeclarationOperation(java.lang.String name,
ICompilationUnit parentElement)
When executed, this operation will add a package declaration to the given compilation unit. |
|
| Method Summary | |
|---|---|
protected ASTNode |
generateElementAST(ASTRewrite rewriter,
ICompilationUnit cu)
|
protected IJavaElement |
generateResultHandle()
Creates and returns the handle for the element this operation created. |
protected StructuralPropertyDescriptor |
getChildPropertyDescriptor(ASTNode parent)
|
java.lang.String |
getMainTaskName()
Returns the name of the main task of this operation for progress reporting. |
protected void |
initializeDefaultPosition()
Sets the correct position for new package declaration: before the first import if no imports, before the first type if no type - first thing in the CU |
IJavaModelStatus |
verify()
Possible failures: NO_ELEMENTS_TO_PROCESS - no compilation unit was supplied to the operation INVALID_NAME - a name supplied to the operation was not a valid package declaration name. |
| Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.CreateElementInCUOperation |
|---|
checkCanceled, createAfter, createBefore, executeOperation, generateNewCompilationUnitAST, generateResultHandles, getCompilationUnit, getMainAmountOfWork, getSchedulingRule, insertASTNode, parse, setAlteredName, setRelativePosition |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String name
| Constructor Detail |
|---|
public CreatePackageDeclarationOperation(java.lang.String name,
ICompilationUnit parentElement)
| Method Detail |
|---|
protected StructuralPropertyDescriptor getChildPropertyDescriptor(ASTNode parent)
getChildPropertyDescriptor in class CreateElementInCUOperation
protected ASTNode generateElementAST(ASTRewrite rewriter,
ICompilationUnit cu)
throws JavaModelException
generateElementAST in class CreateElementInCUOperationJavaModelExceptionprotected IJavaElement generateResultHandle()
generateResultHandle in class CreateElementInCUOperationpublic java.lang.String getMainTaskName()
CreateElementInCUOperation
getMainTaskName in class CreateElementInCUOperationCreateElementInCUOperation.getMainTaskName()protected void initializeDefaultPosition()
initializeDefaultPosition in class CreateElementInCUOperationpublic IJavaModelStatus verify()
verify in class CreateElementInCUOperationIJavaModelStatus,
JavaConventions
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||