Source class abstract

The interface Source defines the behavior of objects representing source code that can be analyzed by the analysis engine.

Implementations of this interface need to be aware of some assumptions made by the analysis engine concerning sources:

  • Sources are not required to be unique. That is, there can be multiple instances representing the same source.
  • Sources are long lived. That is, the engine is allowed to hold on to a source for an extended period of time and that source must continue to report accurate and up-to-date information.

Because of these assumptions, most implementations will not maintain any state but will delegate to an authoritative system of record in order to implement this API. For example, a source that represents files on disk would typically query the file system to determine the state of the file.

If the instances that implement this API are the system of record, then they will typically be unique. In that case, sources that are created that represent nonexistent files must also be retained so that if those files are created at a later date the long-lived sources representing those files will know that they now exist.

Implementers

Constructors

Source()

Properties

contents → TimestampedData<String>
Get the contents and timestamp of this source.
no setter
fullName String
Return the full (long) version of the name that can be displayed to the user to denote this source. For example, for a source representing a file this would typically be the absolute path of the file.
no setter
hashCode int
Return a hash code for this source.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shortName String
Return a short version of the name that can be displayed to the user to denote this source. For example, for a source representing a file this would typically be the name of the file.
no setter
uri Uri
Return the URI from which this source was originally derived.
no setter

Methods

exists() bool
Return true if this source exists.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
Return true if the given object is a source that represents the same source code as this source.
override