Schnittstelle ITypeRoot
- Alle Superschnittstellen:
org.eclipse.core.runtime.IAdaptable
,ICodeAssist
,IJavaElement
,IOpenable
,IParent
,ISourceReference
- Alle bekannten Unterschnittstellen:
IClassFile
,ICompilationUnit
,IModularClassFile
,IOrdinaryClassFile
- Alle bekannten Implementierungsklassen:
AbstractClassFile
,AssistCompilationUnit
,ClassFile
,ClassFileWorkingCopy
,CompilationUnit
,ModularClassFile
ICompilationUnit
or an IClassFile
).- Seit:
- 3.3
- Siehe auch:
-
Feldübersicht
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
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungFinds the primary type of this Java type root (that is, the type with the same name as the compilation unit, or the type of a class file), ornull
if no such a type exists.getElementAt
(int position) Returns the smallest element within this Java type root that includes the given source position (that is, a method, field, etc.), ornull
if there is no element other than the Java type root itself at the given position, or if the given position is not within the source range of the source of this Java type root.default IModuleDescription
Returns the module description contained in this type root or null if there is no module in this type root.getWorkingCopy
(WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) Returns a shared working copy on this compilation unit or class file using the given working copy owner to create the buffer.Von Schnittstelle geerbte Methoden org.eclipse.core.runtime.IAdaptable
getAdapter
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.ICodeAssist
codeComplete, codeComplete, codeComplete, codeComplete, codeComplete, codeComplete, codeComplete, codeSelect, codeSelect
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.IJavaElement
exists, getAncestor, getAttachedJavadoc, getCorrespondingResource, getElementName, getElementType, getHandleIdentifier, getJavaModel, getJavaProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResource, isReadOnly, isStructureKnown
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.core.IOpenable
close, findRecommendedLineSeparator, getBuffer, 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, getNameRange, getSource, getSourceRange
-
Methodendetails
-
findPrimaryType
IType findPrimaryType()Finds the primary type of this Java type root (that is, the type with the same name as the compilation unit, or the type of a class file), ornull
if no such a type exists.- Gibt zurück:
- the found primary type of this Java type root, or
null
if no such a type exists
-
getModule
Returns the module description contained in this type root or null if there is no module in this type root.Only subtype
IModularClassFile
promises to return non-null.- Gibt zurück:
- the module description contained in the type root or null.
- Löst aus:
JavaModelException
- Seit:
- 3.14
-
getElementAt
Returns the smallest element within this Java type root that includes the given source position (that is, a method, field, etc.), ornull
if there is no element other than the Java type root itself at the given position, or if the given position is not within the source range of the source of this Java type root.- Parameter:
position
- a source position inside the Java type root- Gibt zurück:
- the innermost Java element enclosing a given source position or
null
if none (excluding the Java type root). - Löst aus:
JavaModelException
- if the Java type root does not exist or if an exception occurs while accessing its corresponding resource
-
getWorkingCopy
ICompilationUnit getWorkingCopy(WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Returns a shared working copy on this compilation unit or class file using the given working copy owner to create the buffer. If this is already a working copy of the given owner, the element itself is returned. This API can only answer an already existing working copy if it is based on the same original Java type root AND was using the same working copy owner (that is, as defined byObject.equals(java.lang.Object)
).The life time of a shared working copy is as follows:
- The first call to
getWorkingCopy(WorkingCopyOwner, IProgressMonitor)
creates a new working copy for this element - Subsequent calls increment an internal counter.
- A call to
ICompilationUnit.discardWorkingCopy()
decrements the internal counter. - When this counter is 0, the working copy is discarded.
Note that the working copy owner will be used for the life time of the shared working copy, that is if the working copy is closed then reopened, this owner will be used. The buffer will be automatically initialized with the original's Java type root content upon creation.
When the shared working copy instance is created, an ADDED IJavaElementDelta is reported on this working copy.
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.
Note that possible problems of this working copy are reported using this method only if the given working copy owner returns a problem requestor for this working copy (see
WorkingCopyOwner.getProblemRequestor(ICompilationUnit)
).- Parameter:
owner
- the working copy owner that creates a buffer that is used to get the content of the working copymonitor
- a progress monitor used to report progress while opening this compilation unit ornull
if no progress should be reported- Gibt zurück:
- a new working copy of this Java type root using the given owner to create the buffer, or this Java type root if it is already a working copy
- Löst aus:
JavaModelException
- if the contents of this element can not be determined.
- The first call to
-