Package org.eclipse.handly.model
Interface ISourceElementExtension
-
- All Superinterfaces:
IElement
,ISourceElement
public interface ISourceElementExtension extends ISourceElement
Model implementors may opt to extend this interface, which extendsISourceElement
with a number of default methods.This interface is not intended to be referenced for purposes other than extension.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default ISourceElement
getSourceElementAt(int position, ISnapshot base)
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.default ISourceElementInfo
getSourceElementInfo()
Returns an object holding cached structure and properties for this element.
-
-
-
Method Detail
-
getSourceElementAt
default ISourceElement getSourceElementAt(int position, ISnapshot base) 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.- Parameters:
position
- a source position (0-based)base
- a snapshot on which the given position is based, ornull
if the snapshot is unknown or does not matter- 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 snapshot
-
getSourceElementInfo
default ISourceElementInfo getSourceElementInfo() throws org.eclipse.core.runtime.CoreException
Returns an object holding cached structure and properties for this element.- 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 resource
-
-