Interface ISourceElementInfo
- All Known Implementing Classes:
SourceElementBody
ISourceElement
.
Those structure and properties correlate with a source snapshot.-
Method Summary
Modifier and TypeMethodDescription<T> T
Returns the cached value for the given property, ornull
if no value is set.Returns the cached immediate children of the source element.Returns the text range of the whole element, ornull
if none.Returns the text range of the element's identifier, ornull
if none.Returns the source snapshot on which this object is based, ornull
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, ornull
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
Returns the cached value for the given property, ornull
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 (notnull
)- 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, ornull
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, ornull
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
-