ElementAnnotation class

A single annotation associated with an element.

Clients may not extend, implement or mix-in this class.

Constructors

ElementAnnotation()

Properties

constantEvaluationErrors List<AnalysisError>
Return the errors that were produced while computing a value for this annotation, or null if no value has been computed. If a value has been produced but no errors were generated, then the list will be empty.
read-only
constantValue DartObject
Return a representation of the value of this annotation, or null if the value of this annotation has not been computed or if the value could not be computed because of errors.
read-only
context → AnalysisContext
Return the AnalysisContext which should be used to evaluate this constant.
read-only, inherited
element Element
Return the element representing the field, variable, or const constructor being used as an annotation.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
isAlwaysThrows bool
Return true if this annotation marks the associated function as always throwing.
read-only
isConstantEvaluated bool
Return whether this constant is evaluated.
read-only, inherited
isDeprecated bool
Return true if this annotation marks the associated element as being deprecated.
read-only
isFactory bool
Return true if this annotation marks the associated member as a factory.
read-only
isImmutable bool
Return true if this annotation marks the associated class and its subclasses as being immutable.
read-only
isIsTest bool
Return true if this annotation marks the associated member as running a single test.
read-only
isIsTestGroup bool
Return true if this annotation marks the associated member as running a test group.
read-only
isJS bool
Return true if this annotation marks the associated element with the JS annotation.
read-only
isLiteral bool
Return true if this annotation marks the associated constructor as being literal.
read-only
isMustCallSuper bool
Return true if this annotation marks the associated member as requiring overriding methods to call super.
read-only
isNonVirtual bool
Return true if this annotation marks the associated member as being non-virtual.
read-only
isOptionalTypeArgs bool
Return true if this annotation marks the associated type as having "optional" type arguments.
read-only
isOverride bool
Return true if this annotation marks the associated method as being expected to override an inherited method.
read-only
isProtected bool
Return true if this annotation marks the associated member as being protected.
read-only
isProxy bool
Return true if this annotation marks the associated class as implementing a proxy object.
read-only
isRequired bool
Return true if this annotation marks the associated member as being required.
read-only
isSealed bool
Return true if this annotation marks the associated class as being sealed.
read-only
isVisibleForTemplate bool
Return true if this annotation marks the associated member as being visible for template files.
read-only
isVisibleForTesting bool
Return true if this annotation marks the associated member as being visible for testing.
read-only
librarySource → Source
If this target is associated with a library, return the source of the library's defining compilation unit; otherwise return null.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
source → Source
Return the source associated with this target, or null if this target is not associated with a source.
read-only, inherited

Methods

computeConstantValue() DartObject
Return a representation of the value of this annotation, forcing the value to be computed if it had not previously been computed, or null if the value of this annotation could not be computed because of errors.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toSource() String
Return a textual description of this annotation in a form approximating valid source. The returned string will not be valid source primarily in the case where the annotation itself is not well-formed.
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited