Interface ISourceElementInfo

All Known Implementing Classes:
SourceElementBody

public interface ISourceElementInfo
Holds cached structure and properties for an ISourceElement. Those structure and properties correlate with a source snapshot.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    get(Property<T> property)
    Returns the cached value for the given property, or null if no value is set.
    Returns the cached immediate children of the source element.
    Returns the text range of the whole element, or null if none.
    Returns the text range of the element's identifier, or null if none.
    Returns the source snapshot on which this object is based, or null if the element has no associated source code or if the snapshot is unknown.
  • Method Details

    • getSnapshot

      ISnapshot getSnapshot()
      Returns the source snapshot on which this object is based, or null if the element has no associated source code or if the snapshot is unknown.
      Returns:
      the source snapshot on which this object is based, or null if the element has no associated source code or if the snapshot is unknown
    • get

      <T> T get(Property<T> property)
      Returns the cached value for the given property, or null if no value is set.

      To find the value to which the given property object is mapped, implementations of this method may use an identity-based lookup, name-based lookup, or anything in-between. Clients need to use unique property instances with unique names for unambiguous identification of a mapping.

      Note that the result correlates to a source snapshot (if there is one) and may be inconsistent with the current source contents.

      Parameters:
      property - a source element's property (not null)
      Returns:
      the cached value for the given property, or null if no value is set. Clients must not modify the returned value even if mutation is technically possible (e.g., for a non-empty array).
    • getChildren

      ISourceConstruct[] getChildren()
      Returns the cached immediate children of the source element. The children appear in declaration order.

      Note that the result correlates to a source snapshot (if there is one) and may be inconsistent with the current source contents.

      Returns:
      the cached immediate children of the source element (never null). Clients must not modify the returned array.
    • getFullRange

      TextRange getFullRange()
      Returns the text range of the whole element, or null if none.

      Note that the result correlates to a source snapshot (if there is one) and may be inconsistent with the current source contents.

      Returns:
      the text range associated with the whole element, or null if none
    • getIdentifyingRange

      TextRange getIdentifyingRange()
      Returns the text range of the element's identifier, or null if none.

      Note that the result correlates to a source snapshot (if there is one) and may be inconsistent with the current source contents.

      Returns:
      the text range associated with the element's identifier, or null if none