Interface ISourceElementImplSupport
-
- All Superinterfaces:
IElement,IElementImpl,IElementImplExtension,IElementImplSupport,IModelManager.Provider,ISourceElement,ISourceElementImpl
- All Known Subinterfaces:
ISourceConstructImplSupport,ISourceFileImplSupport
- All Known Implementing Classes:
BaseSourceFile,FsSourceFile,SourceConstruct,SourceFile,WorkspaceSourceFile
public interface ISourceElementImplSupport extends IElementImplSupport, ISourceElementImpl
A "trait-like" interface providing a skeletal implementation ofISourceElementImplto minimize the effort required to implement that interface.In general, the members first defined in this interface are not intended to be referenced outside the subtype hierarchy.
- Restriction:
- This interface is not intended to be extended by clients.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.handly.model.impl.IElementImplExtension
IElementImplExtension.CloseHint
-
-
Field Summary
-
Fields inherited from interface org.eclipse.handly.model.impl.IElementImplExtension
CLOSE_HINT, FORCE_OPEN
-
Fields inherited from interface org.eclipse.handly.model.impl.support.IElementImplSupport
NEW_ELEMENTS, NO_BODY
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static booleancheckInRange(int position, ISourceElementInfo info, IContext context)Checks whether the given position is within the element's range in the source snapshot as recorded by the given element info.default ISourceElementgetSourceElementAt_(int position, IContext context, org.eclipse.core.runtime.IProgressMonitor monitor)Returns the smallest element within this element that includes the given source position, ornullif the given position is not within the source range of this element.default ISourceElementgetSourceElementAt_(int position, ISourceElementInfo info, IContext context, org.eclipse.core.runtime.IProgressMonitor monitor)Returns the smallest element within this element that includes the given source position, which is known to be within the source range of this element as recorded by the given element info.default ISourceElementInfogetSourceElementInfo_(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_, fetchChildren_, fetchChildrenOfType_, getChildrenOfType_, getHandleMemento_, getLocationUri_, getName_, getParent_, getResource_, getRoot_, toDisplayString_
-
Methods inherited from interface org.eclipse.handly.model.impl.IElementImplExtension
close_, getBody_, getBody_, getChildren_
-
Methods inherited from interface org.eclipse.handly.model.impl.support.IElementImplSupport
buildStructure_, canEqual_, close_, defaultEquals_, defaultHashCode_, exists_, findBody_, getChildrenFromBody_, getElementManager_, getModel_, isOpenable_, newDoesNotExistException_, open_, openParent_, peekAtBody_, remove_, removing_, toString_, toStringAncestors_, toStringBody_, toStringChildren_, toStringName_, validateExistence_
-
Methods inherited from interface org.eclipse.handly.model.impl.support.IModelManager.Provider
getModelManager_
-
-
-
-
Method Detail
-
getSourceElementInfo_
default 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.This implementation delegates to
IElementImplExtension.getBody_(IContext, IProgressMonitor); it is assumed that the body implementsISourceElementInfo.- Specified by:
getSourceElementInfo_in interfaceISourceElementImpl- Parameters:
context- the operation context (notnull)monitor- a progress monitor, ornullif progress reporting is not desired. The caller must not rely onIProgressMonitor.done()having been called by the receiver- Returns:
- an
ISourceElementInfofor 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
-
getSourceElementAt_
default 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, ornullif 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, ornullif the snapshot is unknown or does not matter.
This implementation obtains the source element info for this element and delegates to
getSourceElementAt_(int, ISourceElementInfo, IContext, IProgressMonitor)if the given position is within the source range of this element as reported bycheckInRange(int, ISourceElementInfo, IContext); otherwise,nullis returned.- Specified by:
getSourceElementAt_in interfaceISourceElementImpl- Parameters:
position- a source position (0-based)context- the operation context (notnull)monitor- a progress monitor, ornullif 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
nullif 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
-
-
getSourceElementAt_
default ISourceElement getSourceElementAt_(int position, ISourceElementInfo info, 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, which is known to be within the source range of this element as recorded by the given element info. 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, ornullif the snapshot is unknown or does not matter.
- Parameters:
position- a source position (0-based)info- anISourceElementInfofor this element (notnull)context- the operation context (notnull)monitor- a progress monitor (notnull). The caller must not rely onIProgressMonitor.done()having been called by the receiver- Returns:
- the innermost element enclosing the given source position
(never
null) - Throws:
org.eclipse.core.runtime.CoreException- if an exception occurs while accessing the element's corresponding resourceStaleSnapshotException- if snapshot inconsistency is detectedorg.eclipse.core.runtime.OperationCanceledException- if this method is canceled
-
-
checkInRange
static boolean checkInRange(int position, ISourceElementInfo info, IContext context)Checks whether the given position is within the element's range in the source snapshot as recorded by the given element info.Supports the following standard options, which may be specified in the given context:
-
BASE_SNAPSHOT- A snapshot on which the given position is based, ornullif the snapshot is unknown or does not matter.
- Parameters:
position- a source position (0-based)info- anISourceElementInfo(notnull)context- the operation context (notnull)- Returns:
trueif the given position is within the element's source range, andfalseotherwise- Throws:
StaleSnapshotException- if snapshot inconsistency is detected
-
-
-