Package org.eclipse.handly.model.impl
Interface ISourceElementImpl
- All Superinterfaces:
IElement
,IElementImpl
,ISourceElement
- All Known Subinterfaces:
ISourceConstructImpl
,ISourceConstructImplExtension
,ISourceConstructImplSupport
,ISourceElementImplSupport
,ISourceFileImpl
,ISourceFileImplExtension
,ISourceFileImplSupport
- All Known Implementing Classes:
BaseSourceFile
,FsSourceFile
,SourceConstruct
,SourceFile
,WorkspaceSourceFile
All
ISourceElement
s must implement this interface.- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptiongetSourceElementAt_
(int position, IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Returns the smallest element within this element that includes the given source position, ornull
if the given position is not within the source range of this element.getSourceElementInfo_
(IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Returns an object holding cached structure and properties for this element.Methods inherited from interface org.eclipse.handly.model.impl.IElementImpl
equalsAndSameParentChain_, exists_, fetchChildren_, fetchChildrenOfType_, getChildren_, getChildrenOfType_, getHandleMemento_, getLocationUri_, getModel_, getName_, getParent_, getResource_, getRoot_, toDisplayString_, toString_
-
Method Details
-
getSourceElementAt_
ISourceElement getSourceElementAt_(int position, IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Returns the smallest element within this element that includes the given source position, ornull
if the given position is not within the source range of this element. If no finer grained element is found at the position, this element itself is returned.Implementations are encouraged to support the following standard options, which may be specified in the given context:
-
BASE_SNAPSHOT
- A snapshot on which the given position is based, ornull
if the snapshot is unknown or does not matter.
- Parameters:
position
- a source position (0-based)context
- the operation context (notnull
)monitor
- a progress monitor, ornull
if progress reporting is not desired. The caller must not rely onIProgressMonitor.done()
having been called by the receiver- Returns:
- the innermost element enclosing the given source position,
or
null
if none (including this element itself) - Throws:
org.eclipse.core.runtime.CoreException
- if this element does not exist or if an exception occurs while accessing its corresponding resourceStaleSnapshotException
- if snapshot inconsistency is detected, i.e., this element's current structure and properties are based on a different snapshotorg.eclipse.core.runtime.OperationCanceledException
- if this method is canceled
-
-
getSourceElementInfo_
ISourceElementInfo getSourceElementInfo_(IContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Returns an object holding cached structure and properties for this element.- Parameters:
context
- the operation context (notnull
)monitor
- a progress monitor, ornull
if progress reporting is not desired. The caller must not rely onIProgressMonitor.done()
having been called by the receiver- Returns:
- an
ISourceElementInfo
for this element (nevernull
) - Throws:
org.eclipse.core.runtime.CoreException
- if this element does not exist or if an exception occurs while accessing its corresponding resourceorg.eclipse.core.runtime.OperationCanceledException
- if this method is canceled
-