Class ClassFileWorkingCopy
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.aspectj.org.eclipse.jdt.internal.core.JavaElement
org.aspectj.org.eclipse.jdt.internal.core.Openable
org.aspectj.org.eclipse.jdt.internal.core.CompilationUnit
org.aspectj.org.eclipse.jdt.internal.core.ClassFileWorkingCopy
- All Implemented Interfaces:
IBufferChangedListener,ICodeAssist,ICompilationUnit,IJavaElement,IOpenable,IParent,ISourceManipulation,ISourceReference,ITypeRoot,IWorkingCopy,ICompilationUnit,IDependent,SuffixConstants,org.eclipse.core.runtime.IAdaptable
A working copy on an
IClassFile.-
Field Summary
FieldsFields inherited from class org.aspectj.org.eclipse.jdt.internal.core.CompilationUnit
DOM_BASED_OPERATIONS, name, ownerFields inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaElement
JEM_ANNOTATION, JEM_CLASSFILE, JEM_COMPILATIONUNIT, JEM_COUNT, JEM_DELIMITER_ESCAPE, JEM_ESCAPE, JEM_FIELD, JEM_IMPORTDECLARATION, JEM_INITIALIZER, JEM_JAVAPROJECT, JEM_LAMBDA_EXPRESSION, JEM_LAMBDA_METHOD, JEM_LOCALVARIABLE, JEM_METHOD, JEM_MODULAR_CLASSFILE, JEM_MODULE, JEM_PACKAGEDECLARATION, JEM_PACKAGEFRAGMENT, JEM_PACKAGEFRAGMENTROOT, JEM_STRING, JEM_TYPE, JEM_TYPE_PARAMETER, NO_ELEMENTS, NO_INFO, NO_STRINGSFields inherited from interface org.aspectj.org.eclipse.jdt.core.ICompilationUnit
ENABLE_BINDINGS_RECOVERY, ENABLE_STATEMENTS_RECOVERY, FORCE_PROBLEM_DETECTION, IGNORE_METHOD_BODIES, NO_ASTFields inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.env.IDependent
JAR_FILE_ENTRY_SEPARATORFields inherited from interface org.aspectj.org.eclipse.jdt.core.IJavaElement
ANNOTATION, CLASS_FILE, COMPILATION_UNIT, FIELD, IMPORT_CONTAINER, IMPORT_DECLARATION, INITIALIZER, JAVA_MODEL, JAVA_MODULE, JAVA_PROJECT, LOCAL_VARIABLE, METHOD, PACKAGE_DECLARATION, PACKAGE_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE, TYPE_PARAMETERFields inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.util.SuffixConstants
EXTENSION_aj, EXTENSION_AJ, EXTENSION_class, EXTENSION_CLASS, EXTENSION_java, EXTENSION_JAVA, EXTENSION_jmod, EXTENSION_JMOD, SUFFIX_aj, SUFFIX_AJ, SUFFIX_class, SUFFIX_CLASS, SUFFIX_java, SUFFIX_JAVA, SUFFIX_STRING_aj, SUFFIX_STRING_AJ, SUFFIX_STRING_class, SUFFIX_STRING_CLASS, SUFFIX_STRING_java, SUFFIX_STRING_JAVA -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcommitWorkingCopy(boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) Commits the contents of this working copy to its underlying resource.Note: a buffer with no unsaved changes can be closed by the Java Model since it has a finite number of buffers allowed open at one time.char[]Answer the contents of the compilation unit.org.eclipse.core.runtime.IPathgetPath()Returns the path to the innermost resource enclosing this element.getPrimaryElement(boolean checkOwner) protected IBufferopenBuffer(org.eclipse.core.runtime.IProgressMonitor pm, IElementInfo info) Opens a buffer on the contents of this element, and returns the buffer, or returnsnullif opening fails.org.eclipse.core.resources.IResourceresource(PackageFragmentRoot root) protected voidtoStringName(StringBuilder buffer) Debugging purposesMethods inherited from class org.aspectj.org.eclipse.jdt.internal.core.CompilationUnit
applyTextEdit, becomeWorkingCopy, becomeWorkingCopy, bufferChanged, buildStructure, calculateHashCode, canBeRemovedFromCache, canBufferBeRemovedFromCache, cloneCachingContents, close, closing, codeComplete, codeComplete, codeComplete, codeComplete, codeComplete, codeComplete, codeComplete, codeSelect, codeSelect, commit, copy, createElementInfo, createImport, createImport, createPackageDeclaration, createType, delete, destroy, discardWorkingCopy, equals, findElements, findPrimaryType, findSharedWorkingCopy, findWorkingCopy, getAllTypes, getCompilationUnit, getCorrespondingResource, getCustomOptions, getElementAt, getElementName, getElementType, getFileName, getHandleFromMemento, getHandleMementoDelimiter, getImport, getImportContainer, getImports, getMainTypeName, getModule, getModuleName, getNameRange, getOrBuildAST, getOriginal, getOriginalElement, getOwner, getPackageDeclaration, getPackageDeclarations, getPackageName, getPerWorkingCopyInfo, getPrimary, getSharedWorkingCopy, getSource, getSourceRange, getType, getTypeRoot, getTypes, getUnderlyingResource, getWorkingCopy, getWorkingCopy, getWorkingCopy, getWorkingCopy, getWorkingCopy, hasBuffer, hasResourceChanged, ignoreOptionalProblems, isBasedOn, isConsistent, isPrimary, isSourceElement, isWorkingCopy, makeConsistent, makeConsistent, move, openAncestors, originalFromClone, reconcile, reconcile, reconcile, reconcile, reconcile, rename, restore, save, setOptions, toStringInfo, updateTimeStamp, validateCompilationUnit, validateExistenceMethods inherited from class org.aspectj.org.eclipse.jdt.internal.core.Openable
closeBuffer, codeComplete, codeSelect, exists, findRecommendedLineSeparator, generateInfos, getBufferFactory, getBufferManager, getOpenable, getPackageFragmentRoot, getResource, hasUnsavedChanges, ignoreErrorStatus, isOpen, isStructureKnown, open, resource, resourceExistsMethods inherited from class org.aspectj.org.eclipse.jdt.internal.core.JavaElement
appendEscapedDelimiter, escapeMementoName, findNode, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getClassFile, getElementInfo, getElementInfo, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getHandleMemento, getJavadocBaseLocation, getJavaModel, getJavaProject, getLibraryJavadocLocation, getOpenableParent, getParent, getPrimaryElement, getSchedulingRule, getSourceElementAt, getSourceMapper, getURLContents, hasChildren, hashCode, isAncestorOf, isReadOnly, newDoesNotExistStatus, newJavaModelException, newNotPresentException, openWhenClosed, readableName, resetHashCode, resolved, tabString, toDebugString, toString, toString, toStringAncestors, toStringChildren, toStringInfo, toStringWithAncestors, toStringWithAncestors, unresolved, validateAndCacheMethods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapterMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapterMethods inherited from interface org.aspectj.org.eclipse.jdt.core.ICompilationUnit
getOptionsMethods inherited from interface org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit
getDestinationPath, getExternalAnnotationPath, moduleMethods inherited from interface org.aspectj.org.eclipse.jdt.core.IJavaElement
exists, getAncestor, getAttachedJavadoc, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPrimaryElement, getResource, getSchedulingRule, isReadOnly, isStructureKnownMethods inherited from interface org.aspectj.org.eclipse.jdt.core.IOpenable
findRecommendedLineSeparator, hasUnsavedChanges, isOpen, openMethods inherited from interface org.aspectj.org.eclipse.jdt.core.IParent
getChildren, hasChildrenMethods inherited from interface org.aspectj.org.eclipse.jdt.core.ISourceReference
exists
-
Field Details
-
classFile
-
-
Constructor Details
-
ClassFileWorkingCopy
-
-
Method Details
-
commitWorkingCopy
public void commitWorkingCopy(boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Description copied from interface:ICompilationUnitCommits the contents of this working copy to its underlying resource.It is possible that the contents of the original resource have changed since this working copy was created, in which case there is an update conflict. The value of the
forceparameter affects the resolution of such a conflict:-
true- in this case the contents of this working copy are applied to the underlying resource even though this working copy was created before a subsequent change in the resource -
false- in this case aJavaModelExceptionis thrown
Since 2.1, a working copy can be created on a not-yet existing compilation unit. In particular, such a working copy can then be committed in order to create the corresponding compilation unit.
- Specified by:
commitWorkingCopyin interfaceICompilationUnit- Overrides:
commitWorkingCopyin classCompilationUnit- Parameters:
force- a flag to handle the cases when the contents of the original resource have changed since this working copy was createdmonitor- the given progress monitor- Throws:
JavaModelException- if this working copy could not commit. Reasons include:- A
CoreExceptionoccurred while updating an underlying resource - This element is not a working copy (INVALID_ELEMENT_TYPES)
- A update conflict (described above) (UPDATE_CONFLICT)
- A
- See Also:
-
-
getBuffer
Description copied from class:OpenableNote: a buffer with no unsaved changes can be closed by the Java Model since it has a finite number of buffers allowed open at one time. If this is the first time a request is being made for the buffer, an attempt is made to create and fill this element's buffer. If the buffer has been closed since it was first opened, the buffer is re-created.- Specified by:
getBufferin interfaceIOpenable- Overrides:
getBufferin classOpenable- Returns:
- the buffer opened for this element, or
nullif this element does not have a buffer - Throws:
JavaModelException- if this element does not exist or if an exception occurs while accessing its corresponding resource.- See Also:
-
getContents
public char[] getContents()Description copied from interface:ICompilationUnitAnswer the contents of the compilation unit. In normal use, the contents are requested twice. Once during the initial lite parsing step, then again for the more detailed parsing step. Implementors must never return null - return an empty char[] instead, CharOperation.NO_CHAR being the candidate of choice.- Specified by:
getContentsin interfaceICompilationUnit- Overrides:
getContentsin classCompilationUnit- See Also:
-
getPath
public org.eclipse.core.runtime.IPath getPath()Description copied from interface:IJavaElementReturns the path to the innermost resource enclosing this element. If this element is not included in an external library, the path returned is the full, absolute path to the underlying resource, relative to the workbench. If this element is included in an external library, the path returned is the absolute path to the archive or to the folder in the file system. This is a handle-only method.- Specified by:
getPathin interfaceIJavaElement- Overrides:
getPathin classCompilationUnit- Returns:
- the path to the innermost resource enclosing this element
- See Also:
-
getPrimaryElement
- Overrides:
getPrimaryElementin classCompilationUnit
-
resource
- Overrides:
resourcein classCompilationUnit
-
openBuffer
protected IBuffer openBuffer(org.eclipse.core.runtime.IProgressMonitor pm, IElementInfo info) throws JavaModelException Description copied from class:OpenableOpens a buffer on the contents of this element, and returns the buffer, or returnsnullif opening fails. By default, do nothing - subclasses that have buffers must override as required.- Overrides:
openBufferin classCompilationUnit- Throws:
JavaModelException
-
toStringName
Description copied from class:JavaElementDebugging purposes- Overrides:
toStringNamein classJavaElement
-