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

      public interface ISourceElementImpl
      extends IElementImpl, ISourceElement

  All `ISourceElement`s must implement this interface.
  Restriction:
    This interface is not intended to be extended by clients.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ISourceElement` | `getSourceElementAt_(int position, IContext context, org.eclipse.core.runtime.IProgressMonitor monitor)` Returns the smallest element within this element that includes the given source position, or `null` if the given position is not within the source range of this element.
    `ISourceElementInfo` | `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_, getChildren_, getChildrenOfType_, getHandleMemento_, getLocationUri_, getModel_, getName_, getParent_, getResource_, getRoot_, toDisplayString_, toString_`

    - ### Methods inherited from interface org.eclipse.handly.model.IElement

      `equals, hashCode`

- - ### Method Detail

    - #### 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, or `null` 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, or `null` if the snapshot is unknown or does not matter.
      Parameters:
        `position` - a source position (0-based)
        `context` - the operation context (not `null`)
        `monitor` - a progress monitor, or `null` if progress reporting is not desired. The caller must not rely on `IProgressMonitor.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 resource
        `StaleSnapshotException` - if snapshot inconsistency is detected, i.e., this element's current structure and properties are based on a different snapshot
        `org.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 (not `null`)
        `monitor` - a progress monitor, or `null` if progress reporting is not desired. The caller must not rely on `IProgressMonitor.done()` having been called by the receiver
      Returns:
        an `ISourceElementInfo` for this element (never `null`)
      Throws:
        `org.eclipse.core.runtime.CoreException` - if this element does not exist or if an exception occurs while accessing its corresponding resource
        `org.eclipse.core.runtime.OperationCanceledException` - if this method is canceled

Copyright (c) 2014, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0