Interface ISourceElementInfo
-
- All Known Implementing Classes:
SourceElementBody
public interface ISourceElementInfoHolds cached structure and properties for anISourceElement. Those structure and properties correlate with a source snapshot.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Tget(Property<T> property)Returns the cached value for the given property, ornullif no value is set.ISourceConstruct[]getChildren()Returns the cached immediate children of the source element.TextRangegetFullRange()Returns the text range of the whole element, ornullif none.TextRangegetIdentifyingRange()Returns the text range of the element's identifier, ornullif none.ISnapshotgetSnapshot()Returns the source snapshot on which this object is based, ornullif the element has no associated source code or if the snapshot is unknown.
-
-
-
Method Detail
-
getSnapshot
ISnapshot getSnapshot()
Returns the source snapshot on which this object is based, ornullif the element has no associated source code or if the snapshot is unknown.- Returns:
- the source snapshot on which this object is based,
or
nullif 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, ornullif 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 (notnull)- Returns:
- the cached value for the given property, or
nullif 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, ornullif 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
nullif none
-
getIdentifyingRange
TextRange getIdentifyingRange()
Returns the text range of the element's identifier, ornullif 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
nullif none
-
-