|
|||||||||
| 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.CreateCompilationUnitOperation
public class CreateCompilationUnitOperation
This operation creates a compilation unit (CU). If the CU doesn't exist yet, a new compilation unit will be created with the content provided. Otherwise the operation will override the contents of an existing CU with the new content.
Note: It is possible to create a CU automatically when creating a class or interface. Thus, the preferred method of creating a CU is to perform a create type operation rather than first creating a CU and secondly creating a type inside the CU.
Required Attributes:
".java" suffix (ex. "Object" -
the ".java" will be added for the name of the compilation unit.)
| 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 compilation unit being created. |
protected java.lang.String |
source
The source code to use when creating the element. |
| 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 | |
|---|---|
CreateCompilationUnitOperation(IPackageFragment parentElement,
java.lang.String name,
java.lang.String source,
boolean force)
When executed, this operation will create a compilation unit with the given name. |
|
| Method Summary | |
|---|---|
protected void |
executeOperation()
Creates a compilation unit. |
protected ICompilationUnit |
getCompilationUnit()
|
protected ISchedulingRule |
getSchedulingRule()
|
IJavaModelStatus |
verify()
Possible failures: NO_ELEMENTS_TO_PROCESS - the package fragment supplied to the operation is null. |
| 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
protected java.lang.String source
| Constructor Detail |
|---|
public CreateCompilationUnitOperation(IPackageFragment parentElement,
java.lang.String name,
java.lang.String source,
boolean force)
| Method Detail |
|---|
protected void executeOperation()
throws JavaModelException
executeOperation in class JavaModelOperationJavaModelException - if unable to create the compilation unit.protected ICompilationUnit getCompilationUnit()
CreateElementInCUOperation.getCompilationUnit()protected ISchedulingRule getSchedulingRule()
getSchedulingRule in class JavaModelOperationpublic IJavaModelStatus verify()
null.
null or has an invalid syntax
verify in class JavaModelOperationIJavaModelStatus
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||