Klasse AbstractClassFile
- Alle implementierten Schnittstellen:
IBufferChangedListener
,IClassFile
,ICodeAssist
,IJavaElement
,IOpenable
,IParent
,ISourceReference
,ITypeRoot
,SuffixConstants
,org.eclipse.core.runtime.IAdaptable
- Bekannte direkte Unterklassen:
ClassFile
,ModularClassFile
-
Feldübersicht
Von Klasse geerbte Felder 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_STRINGS
Von Schnittstelle geerbte Felder 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_PARAMETER
Von Schnittstelle geerbte Felder 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
-
Konstruktorübersicht
ModifiziererKonstruktorBeschreibungprotected
AbstractClassFile
(PackageFragment parent, String nameWithoutExtension) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbecomeWorkingCopy
(IProblemRequestor problemRequestor, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) Changes this class file handle into a working copy.void
codeComplete
(int offset, CompletionRequestor requestor) Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor.void
codeComplete
(int offset, CompletionRequestor requestor, WorkingCopyOwner owner) Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor.abstract void
codeComplete
(int offset, CompletionRequestor requestor, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor.void
codeComplete
(int offset, CompletionRequestor requestor, org.eclipse.core.runtime.IProgressMonitor monitor) Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor.void
codeComplete
(int offset, ICodeCompletionRequestor requestor) Veraltet.- should use codeComplete(int, ICompletionRequestor) insteadvoid
codeComplete
(int offset, ICompletionRequestor requestor) Veraltet.void
codeComplete
(int offset, ICompletionRequestor requestor, WorkingCopyOwner owner) Veraltet.codeSelect
(int offset, int length) Returns the Java elements corresponding to the given selected text in this compilation unit.abstract IJavaElement[]
codeSelect
(int offset, int length, WorkingCopyOwner owner) Returns the Java elements corresponding to the given selected text in this compilation unit.protected Object
Returns a new element info for this element.boolean
Returns true if this handle represents the same Java element as the given handle.protected IJavaElement
findElement
(IJavaElement elt, int position, SourceMapper mapper) Finds the deepestIJavaElement
in the hierarchy ofelt's children (including
elt
itself) which has a source range that enclosesposition
according tomapper
.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.byte[]
getBytes()
Returns the bytes contained in this class file.protected byte[]
getClassFileContent
(JarPackageFragmentRoot root, String className) org.eclipse.core.resources.IResource
A class file has a corresponding resource unless it is contained in a jar.getElementAtConsideringSibling
(int position) Returns the name of this element.int
Returns this element's kind encoded as an integer.Returns the name range associated with this element.org.eclipse.core.runtime.IPath
getPath()
Returns the path to the innermost resource enclosing this element.Provide a way for clients (like debugger) to determine if two non-equalAbstractClassFile
objects point to the same physical storage.Returns the source code associated with this element.Returns the source range associated with this element.getWorkingCopy
(org.eclipse.core.runtime.IProgressMonitor monitor, IBufferFactory factory) Veraltet.protected boolean
Returns true if this element may have an associated source buffer, otherwise false.int
hashCode()
Returns the hash code for this Java element.boolean
Returns true - class files are always read only.org.eclipse.core.resources.IResource
resource
(PackageFragmentRoot root) protected org.eclipse.core.runtime.IStatus
validateExistence
(org.eclipse.core.resources.IResource underlyingResource) Von Klasse geerbte Methoden org.aspectj.org.eclipse.jdt.internal.core.Openable
bufferChanged, buildStructure, canBeRemovedFromCache, canBufferBeRemovedFromCache, closeBuffer, closing, codeComplete, codeSelect, exists, findRecommendedLineSeparator, generateInfos, getBufferFactory, getBufferManager, getOpenable, getPackageFragmentRoot, getResource, getUnderlyingResource, hasUnsavedChanges, ignoreErrorStatus, isConsistent, isOpen, isSourceElement, isStructureKnown, makeConsistent, open, openAncestors, openBuffer, resource, resourceExists, save
Von Klasse geerbte Methoden org.aspectj.org.eclipse.jdt.internal.core.JavaElement
appendEscapedDelimiter, close, escapeMementoName, findNode, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getClassFile, getCompilationUnit, getElementInfo, getElementInfo, getHandleFromMemento, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getHandleMemento, getHandleMementoDelimiter, getJavadocBaseLocation, getJavaModel, getJavaProject, getLibraryJavadocLocation, getOpenableParent, getParent, getPrimaryElement, getPrimaryElement, getSchedulingRule, getSourceElementAt, getSourceMapper, getURLContents, hasChildren, isAncestorOf, newDoesNotExistStatus, newJavaModelException, newNotPresentException, openWhenClosed, readableName, resolved, setParent, tabString, toDebugString, toString, toString, toStringAncestors, toStringChildren, toStringInfo, toStringInfo, toStringName, toStringWithAncestors, toStringWithAncestors, unresolved, validateAndCache
Von Klasse geerbte Methoden org.eclipse.core.runtime.PlatformObject
getAdapter
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden org.eclipse.core.runtime.IAdaptable
getAdapter
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.IClassFile
getType, isClass, isInterface
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.IJavaElement
exists, getAncestor, getAttachedJavadoc, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResource, isStructureKnown
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.IOpenable
close, findRecommendedLineSeparator, hasUnsavedChanges, isConsistent, isOpen, makeConsistent, open, save
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.IParent
getChildren, hasChildren
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.ISourceReference
exists
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.ITypeRoot
findPrimaryType, getElementAt, getModule, getWorkingCopy
-
Felddetails
-
name
-
-
Konstruktordetails
-
AbstractClassFile
-
-
Methodendetails
-
becomeWorkingCopy
public ICompilationUnit becomeWorkingCopy(IProblemRequestor problemRequestor, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Beschreibung aus Schnittstelle kopiert:IClassFile
Changes this class file handle into a working copy. A newIBuffer
is created using the given owner. Uses the primary owner ifnull
is specified.When switching to working copy mode, problems are reported to the given
IProblemRequestor
. Note that once in working copy mode, the givenIProblemRequestor
is ignored. Only the originalIProblemRequestor
is used to report subsequent problems.Once in working copy mode, changes to this working copy or its children are done in memory. Only the new buffer is affected.
Using
ICompilationUnit.commitWorkingCopy(boolean, IProgressMonitor)
on the working copy will throw aJavaModelException
as a class file is implicetly read-only.If this class file was already in working copy mode, an internal counter is incremented and no other action is taken on this working copy. To bring this working copy back into the original mode (where it reflects the underlying resource),
ICompilationUnit.discardWorkingCopy()
must be call as many times asIClassFile.becomeWorkingCopy(IProblemRequestor, WorkingCopyOwner, IProgressMonitor)
.The primary compilation unit of a class file's working copy does not exist if the class file is not in working copy mode (
classFileWorkingCopy.getPrimary().exists() == false
).The resource of a class file's working copy is
null
if the class file is in an external jar file.- Angegeben von:
becomeWorkingCopy
in SchnittstelleIClassFile
- Parameter:
problemRequestor
- a requestor which will get notified of problems detected during reconciling as they are discovered. The requestor can be set tonull
indicating that the client is not interested in problems.owner
- the givenWorkingCopyOwner
, ornull
for the primary ownermonitor
- a progress monitor used to report progress while opening this compilation unit ornull
if no progress should be reported- Gibt zurück:
- a working copy for this class file
- Löst aus:
JavaModelException
- if this compilation unit could not become a working copy.- Siehe auch:
-
codeComplete
@Deprecated public void codeComplete(int offset, ICompletionRequestor requestor) throws JavaModelException Veraltet.Beschreibung aus Schnittstelle kopiert:ICodeAssist
Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit.- Angegeben von:
codeComplete
in SchnittstelleICodeAssist
- Parameter:
offset
- the given offset positionrequestor
- the given completion requestor- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
- Siehe auch:
-
codeComplete
@Deprecated public void codeComplete(int offset, ICompletionRequestor requestor, WorkingCopyOwner owner) throws JavaModelException Veraltet.Beschreibung aus Schnittstelle kopiert:ICodeAssist
Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit. It considers types in the working copies with the given owner first. In other words, the owner's working copies will take precedence over their original compilation units in the workspace.Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
- Angegeben von:
codeComplete
in SchnittstelleICodeAssist
- Parameter:
offset
- the given offset positionrequestor
- the given completion requestorowner
- the owner of working copies that take precedence over their original compilation units- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
- Siehe auch:
-
codeComplete
Beschreibung aus Schnittstelle kopiert:ICodeAssist
Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit.- Angegeben von:
codeComplete
in SchnittstelleICodeAssist
- Parameter:
offset
- the given offset positionrequestor
- the given completion requestor- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
-
codeComplete
public void codeComplete(int offset, CompletionRequestor requestor, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Beschreibung aus Schnittstelle kopiert:ICodeAssist
Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit.If
IProgressMonitor
is notnull
then some proposals which can be very long to compute are proposed. To avoid that the code assist operation take too much time aIProgressMonitor
which automatically cancel the code assist operation when a specified amount of time is reached could be used.new IProgressMonitor() { private final static int TIMEOUT = 500; //ms private long endTime; public void beginTask(String name, int totalWork) { fEndTime= System.currentTimeMillis() + TIMEOUT; } public boolean isCanceled() { return endTime Ungültige Eingabe: "<"= System.currentTimeMillis(); } ... };
- Angegeben von:
codeComplete
in SchnittstelleICodeAssist
- Parameter:
offset
- the given offset positionrequestor
- the given completion requestormonitor
- the progress monitor used to report progress- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
-
codeComplete
public void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner) throws JavaModelException Beschreibung aus Schnittstelle kopiert:ICodeAssist
Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit. It considers types in the working copies with the given owner first. In other words, the owner's working copies will take precedence over their original compilation units in the workspace.Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
- Angegeben von:
codeComplete
in SchnittstelleICodeAssist
- Parameter:
offset
- the given offset positionrequestor
- the given completion requestorowner
- the owner of working copies that take precedence over their original compilation units- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
-
codeComplete
public abstract void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Beschreibung aus Schnittstelle kopiert:ICodeAssist
Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit. It considers types in the working copies with the given owner first. In other words, the owner's working copies will take precedence over their original compilation units in the workspace.Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
If
IProgressMonitor
is notnull
then some proposals which can be very long to compute are proposed. To avoid that the code assist operation take too much time aIProgressMonitor
which automatically cancel the code assist operation when a specified amount of time is reached could be used.new IProgressMonitor() { private final static int TIMEOUT = 500; //ms private long endTime; public void beginTask(String name, int totalWork) { fEndTime= System.currentTimeMillis() + TIMEOUT; } public boolean isCanceled() { return endTime Ungültige Eingabe: "<"= System.currentTimeMillis(); } ... };
- Angegeben von:
codeComplete
in SchnittstelleICodeAssist
- Parameter:
offset
- the given offset positionrequestor
- the given completion requestorowner
- the owner of working copies that take precedence over their original compilation unitsmonitor
- the progress monitor used to report progress- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
-
codeSelect
Beschreibung aus Schnittstelle kopiert:ICodeAssist
Returns the Java elements corresponding to the given selected text in this compilation unit. Theoffset
is the 0-based index of the first selected character. Thelength
is the number of selected characters.Note that if the
length
is 0 and theoffset
is inside an identifier or the index just after an identifier then this identifier is considered as the selection.- Angegeben von:
codeSelect
in SchnittstelleICodeAssist
- Parameter:
offset
- the given offset positionlength
- the number of selected characters- Gibt zurück:
- the Java elements corresponding to the given selected text
- Löst aus:
JavaModelException
- if code resolve could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The range specified is not within this element's source range (INDEX_OUT_OF_BOUNDS)
- Siehe auch:
-
codeSelect
public abstract IJavaElement[] codeSelect(int offset, int length, WorkingCopyOwner owner) throws JavaModelException Beschreibung aus Schnittstelle kopiert:ICodeAssist
Returns the Java elements corresponding to the given selected text in this compilation unit. Theoffset
is the 0-based index of the first selected character. Thelength
is the number of selected characters. It considers types in the working copies with the given owner first. In other words, the owner's working copies will take precedence over their original compilation units in the workspace.Note that if the
length
is 0 and theoffset
is inside an identifier or the index just after an identifier then this identifier is considered as the selection.Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
- Angegeben von:
codeSelect
in SchnittstelleICodeAssist
- Parameter:
offset
- the given offset positionlength
- the number of selected charactersowner
- the owner of working copies that take precedence over their original compilation units- Gibt zurück:
- the Java elements corresponding to the given selected text
- Löst aus:
JavaModelException
- if code resolve could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The range specified is not within this element's source range (INDEX_OUT_OF_BOUNDS)
-
createElementInfo
Returns a new element info for this element.- Setzt außer Kraft:
createElementInfo
in KlasseOpenable
-
equals
Beschreibung aus Klasse kopiert:JavaElement
Returns true if this handle represents the same Java element as the given handle. By default, two handles represent the same element if they are identical or if they represent the same type of element, have equal names, parents, and occurrence counts.If a subclass has other requirements for equality, this method must be overridden.
- Setzt außer Kraft:
equals
in KlasseJavaElement
- Siehe auch:
-
findElement
Finds the deepestIJavaElement
in the hierarchy ofelt's children (including
elt
itself) which has a source range that enclosesposition
according tomapper
. -
getPathIdentifier
Provide a way for clients (like debugger) to determine if two non-equalAbstractClassFile
objects point to the same physical storage. The return value is constructed form the container path (if there is any) and the path of the class file itself (that could be either absolute or relative if it is inside container).- Gibt zurück:
- some kind of unique class file identifier based on path information only. The return value may look like a path in a file system, but is not guaranteed to be a valid path that could be resolved via NIO API.
-
getBytes
Beschreibung aus Schnittstelle kopiert:IClassFile
Returns the bytes contained in this class file.- Angegeben von:
getBytes
in SchnittstelleIClassFile
- Gibt zurück:
- the bytes contained in this class file
- Löst aus:
JavaModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource
-
getClassFileContent
protected byte[] getClassFileContent(JarPackageFragmentRoot root, String className) throws org.eclipse.core.runtime.CoreException, IOException - Löst aus:
org.eclipse.core.runtime.CoreException
IOException
-
getBuffer
Beschreibung aus Klasse kopiert:Openable
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. 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.- Angegeben von:
getBuffer
in SchnittstelleIOpenable
- Setzt außer Kraft:
getBuffer
in KlasseOpenable
- Gibt zurück:
- the buffer opened for this element, or
null
if this element does not have a buffer - Löst aus:
JavaModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource.- Siehe auch:
-
getTypeRoot
- Siehe auch:
-
getCorrespondingResource
A class file has a corresponding resource unless it is contained in a jar.- Angegeben von:
getCorrespondingResource
in SchnittstelleIJavaElement
- Setzt außer Kraft:
getCorrespondingResource
in KlasseOpenable
- Gibt zurück:
- the corresponding resource, or
null
if none - Löst aus:
JavaModelException
- if this element does not exist or if an exception occurs while accessing its corresponding resource- Siehe auch:
-
getElementAtConsideringSibling
- Löst aus:
JavaModelException
-
getElementName
Beschreibung aus Schnittstelle kopiert:IJavaElement
Returns the name of this element. This is a handle-only method.- Angegeben von:
getElementName
in SchnittstelleIJavaElement
- Setzt außer Kraft:
getElementName
in KlasseJavaElement
- Gibt zurück:
- the element name
- Siehe auch:
-
getElementType
public int getElementType()Beschreibung aus Schnittstelle kopiert:IJavaElement
Returns this element's kind encoded as an integer. This is a handle-only method.- Angegeben von:
getElementType
in SchnittstelleIJavaElement
- Gibt zurück:
- the kind of element; one of the constants declared in
IJavaElement
- Siehe auch:
-
getPath
public org.eclipse.core.runtime.IPath getPath()Beschreibung aus Schnittstelle kopiert:IJavaElement
Returns 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.- Angegeben von:
getPath
in SchnittstelleIJavaElement
- Gibt zurück:
- the path to the innermost resource enclosing this element
-
resource
-
getSource
Beschreibung aus Schnittstelle kopiert:ISourceReference
Returns the source code associated with this element. This extracts the substring from the source buffer containing this source element. This corresponds to the source range that would be returned bygetSourceRange
.For class files, this returns the source of the entire compilation unit associated with the class file (if there is one).
- Angegeben von:
getSource
in SchnittstelleISourceReference
- Gibt zurück:
- the source code, or
null
if this element has no associated source code - Löst aus:
JavaModelException
- if an exception occurs while accessing its corresponding resource- Siehe auch:
-
getSourceRange
Beschreibung aus Schnittstelle kopiert:ISourceReference
Returns the source range associated with this element.For class files, this returns the range of the entire compilation unit associated with the class file (if there is one).
If this element has no associated source code, either
null
is returned, or a source range with a -1 offset and a 0 length.SourceRange.isAvailable(ISourceRange)
can be used to detect that case.- Angegeben von:
getSourceRange
in SchnittstelleISourceReference
- Gibt zurück:
- the source range, or either
null
or [-1, 0] if this element has no associated source code - Löst aus:
JavaModelException
- if an exception occurs while accessing its corresponding resource- Siehe auch:
-
getWorkingCopy
@Deprecated public IJavaElement getWorkingCopy(org.eclipse.core.runtime.IProgressMonitor monitor, IBufferFactory factory) throws JavaModelException Veraltet.Beschreibung aus Schnittstelle kopiert:IClassFile
Returns a working copy on the source associated with this class file using the given factory to create the buffer, ornull
if there is no source associated with the class file.The buffer will be automatically initialized with the source of the class file upon creation.
The only valid operations on this working copy are
getBuffer()
orgetOriginalElement
.- Angegeben von:
getWorkingCopy
in SchnittstelleIClassFile
- Parameter:
monitor
- a progress monitor used to report progress while opening this compilation unit ornull
if no progress should be reportedfactory
- the factory that creates a buffer that is used to get the content of the working copy ornull
if the internal factory should be used- Gibt zurück:
- a a working copy on the source associated with this class file
- Löst aus:
JavaModelException
- if the source of this class file can not be determined. Reasons include:- This class file does not exist (ELEMENT_DOES_NOT_EXIST)
- Siehe auch:
-
hasBuffer
protected boolean hasBuffer()Beschreibung aus Klasse kopiert:Openable
Returns true if this element may have an associated source buffer, otherwise false. Subclasses must override as required. -
hashCode
public int hashCode()Beschreibung aus Klasse kopiert:JavaElement
Returns the hash code for this Java element. By default, the hash code for an element is a combination of its name and parent's hash code. Elements with other requirements must override this method.- Setzt außer Kraft:
hashCode
in KlasseJavaElement
-
isReadOnly
public boolean isReadOnly()Returns true - class files are always read only.- Angegeben von:
isReadOnly
in SchnittstelleIJavaElement
- Setzt außer Kraft:
isReadOnly
in KlasseJavaElement
- Gibt zurück:
true
if this element is read-only- Siehe auch:
-
codeComplete
@Deprecated public void codeComplete(int offset, ICodeCompletionRequestor requestor) throws JavaModelException Veraltet.- should use codeComplete(int, ICompletionRequestor) insteadBeschreibung aus Schnittstelle kopiert:ICodeAssist
Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit.- Angegeben von:
codeComplete
in SchnittstelleICodeAssist
- Parameter:
offset
- the given offset positionrequestor
- the given completion requestor- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
- Siehe auch:
-
validateExistence
protected org.eclipse.core.runtime.IStatus validateExistence(org.eclipse.core.resources.IResource underlyingResource) - Angegeben von:
validateExistence
in KlasseOpenable
-
getNameRange
Beschreibung aus Schnittstelle kopiert:ISourceReference
Returns the name range associated with this element.If the element is an
IMember
, it returns the source range of this member's simple name, ornull
if this member does not have a name (for example, an initializer), or if this member does not have associated source code (for example, a binary type).If this element is an
IImportDeclaration
, the source range of this import declaration's name, ornull
if this import declaration does not have associated source code (for example, a binary type).
The source range for the name includes the trailing '*' if the call toIImportDeclaration.isOnDemand()
returns true.If this element is an
IPackageDeclaration
, the source range of this package declaration's name, ornull
if this package declaration does not have associated source code (for example, a binary type).If this element is an
IAnnotation
, the source range of this annotation's name, ornull
if this annotation does not have associated source code (for example, in a binary type).If this element is an
ITypeParameter
, the source range of this type parameter's name, ornull
if this type parameter does not have associated source code (for example, in a binary type).If this element is an
ITypeRoot
orIImportContainer
, it returns null.- Angegeben von:
getNameRange
in SchnittstelleISourceReference
- Gibt zurück:
- the name range associated with this element, or
null
if not available
-