ConstructorElement class

An element representing a constructor or a factory method defined within a class.

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

Implemented types

Constructors

ConstructorElement()

Properties

declaration ConstructorElement
Return the declaration of this element. If the element is a view on an element, e.g. a method from an interface type, with substituted type parameters, return the corresponding element from the class, without any substitutions. If this element is already a declaration (or a synthetic element, e.g. a synthetic property accessor), return itself.
read-only, override
enclosingElement ClassElement
Return the element that either physically or logically encloses this element. This will be null if this element is a library because libraries are the top-level elements in the model.
read-only, override
isConst → bool
Return true if this constructor is a const constructor.
read-only
isDefaultConstructor → bool
Return true if this constructor can be used as a default constructor - unnamed and has no required parameters.
read-only
isFactory → bool
Return true if this constructor represents a factory constructor.
read-only
nameEnd → int
Return the offset of the character immediately following the last character of this constructor's name, or null if not named.
read-only
periodOffset → int
Return the offset of the . before this constructor name, or null if not named.
read-only
redirectedConstructor ConstructorElement
Return the constructor to which this constructor is redirecting, or null if this constructor does not redirect to another constructor or if the library containing this constructor has not yet been resolved.
read-only
context → AnalysisContext
Return the AnalysisContext which should be used to evaluate this constant.
read-only, inherited
displayName → String
Return the display name of this element, or null if this element does not have a name. [...]
read-only, inherited
documentationComment → String
Return the content of the documentation comment (including delimiters) for this element, or null if this element does not or cannot have documentation.
read-only, inherited
hasAlwaysThrows → bool
Return true if this element has an annotation of the form @alwaysThrows.
read-only, inherited
hasDeprecated → bool
Return true if this element has an annotation of the form @deprecated or @Deprecated('..').
read-only, inherited
hasFactory → bool
Return true if this element has an annotation of the form @factory.
read-only, inherited
hashCode → int
The hash code for this object.
read-only, inherited
hasImplicitReturnType → bool
Return true if this executable element did not have an explicit return type specified for it in the original source. Note that if there was no explicit return type, and if the element model is fully populated, then the returnType will not be null.
read-only, inherited
hasIsTest → bool
Return true if this element has an annotation of the form @isTest.
read-only, inherited
hasIsTestGroup → bool
Return true if this element has an annotation of the form @isTestGroup.
read-only, inherited
hasJS → bool
Return true if this element has an annotation of the form @JS(..).
read-only, inherited
hasLiteral → bool
Return true if this element has an annotation of the form @literal.
read-only, inherited
hasMustCallSuper → bool
Return true if this element has an annotation of the form @mustCallSuper.
read-only, inherited
hasNonVirtual → bool
Return true if this element has an annotation of the form @nonVirtual.
read-only, inherited
hasOptionalTypeArgs → bool
Return true if this element has an annotation of the form @optionalTypeArgs.
read-only, inherited
hasOverride → bool
Return true if this element has an annotation of the form @override.
read-only, inherited
hasProtected → bool
Return true if this element has an annotation of the form @protected.
read-only, inherited
hasRequired → bool
Return true if this element has an annotation of the form @required.
read-only, inherited
hasSealed → bool
Return true if this element has an annotation of the form @sealed.
read-only, inherited
hasVisibleForTemplate → bool
Return true if this element has an annotation of the form @visibleForTemplate.
read-only, inherited
hasVisibleForTesting → bool
Return true if this element has an annotation of the form @visibleForTesting.
read-only, inherited
id → int
The unique integer identifier of this element.
read-only, inherited
isAbstract → bool
Return true if this executable element is abstract. Executable elements are abstract if they are not external and have no body.
read-only, inherited
isAsynchronous → bool
Return true if this executable element has body marked as being asynchronous.
read-only, inherited
isConstantEvaluated → bool
Return whether this constant is evaluated.
read-only, inherited
isExternal → bool
Return true if this executable element is external. Executable elements are external if they are explicitly marked as such using the 'external' keyword.
read-only, inherited
isGenerator → bool
Return true if this executable element has a body marked as being a generator.
read-only, inherited
isOperator → bool
Return true if this executable element is an operator. The test may be based on the name of the executable element, in which case the result will be correct when the name is legal.
read-only, inherited
isPrivate → bool
Return true if this element is private. Private elements are visible only within the library in which they are declared.
read-only, inherited
isPublic → bool
Return true if this element is public. Public elements are visible within any library that imports the library in which they are declared.
read-only, inherited
isSimplyBounded → bool
If the element defines a type, indicates whether the type may safely appear without explicit type parameters as the bounds of a type parameter declaration. [...]
read-only, inherited
isStatic → bool
Return true if this element is a static element. A static element is an element that is not associated with a particular instance, but rather with an entire library or class.
read-only, inherited
isSynchronous → bool
Return true if this executable element has a body marked as being synchronous.
read-only, inherited
isSynthetic → bool
Return true if this element is synthetic. A synthetic element is an element that is not represented in the source code explicitly, but is implied by the source code, such as the default constructor for a class that does not explicitly define any constructors.
read-only, inherited
kind ElementKind
Return the kind of element that this is.
read-only, inherited
library LibraryElement
Return the library that contains this element. This will be the element itself if it is a library element. This will be null if this element is an HTML file because HTML files are not contained in libraries.
read-only, inherited
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
location ElementLocation
Return an object representing the location of this element in the element model. The object can be used to locate this element at a later time.
read-only, inherited
metadata → List<ElementAnnotation>
Return a list containing all of the metadata associated with this element. The array will be empty if the element does not have any metadata or if the library containing this element has not yet been resolved.
read-only, inherited
name → String
Return the name of this element, or null if this element does not have a name.
read-only, inherited
nameLength → int
Return the length of the name of this element in the file that contains the declaration of this element, or 0 if this element does not have a name.
read-only, inherited
nameOffset → int
Return the offset of the name of this element in the file that contains the declaration of this element, or -1 if this element is synthetic, does not have a name, or otherwise does not have an offset.
read-only, inherited
parameters → List<ParameterElement>
Return a list containing all of the parameters defined by this executable element.
read-only, inherited
returnType DartType
Return the return type defined by this element. If the element model is fully populated, then the returnType will not be null, even if no return type was explicitly specified.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
session AnalysisSession
Return the analysis session in which this element is defined.
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
type FunctionType
Return the type defined by this element.
read-only, inherited
typeParameters → List<TypeParameterElement>
Return a list containing all of the type parameters declared by this element directly. This does not include type parameters that are declared by any enclosing elements.
read-only, inherited

Methods

accept<T>(ElementVisitor<T> visitor) → T
Use the given visitor to visit this element. Return the value returned by the visitor as a result of visiting this element.
inherited
getAncestor<E extends Element>(Predicate<Element> predicate) → E
Return the most immediate ancestor of this element for which the predicate returns true, or null if there is no such ancestor. Note that this element will never be returned.
@Deprecated('Use either thisOrAncestorMatching or thisOrAncestorOfType'), inherited
getDisplayString({bool withNullability}) → String
Return the presentation of this element as it should appear when presented to users. [...]
inherited
getExtendedDisplayName(String shortName) → String
Return a display name for the given element that includes the path to the compilation unit in which the type is defined. If shortName is null then displayName will be used as the name of this element. Otherwise the provided name will be used.
inherited
isAccessibleIn(LibraryElement library) → bool
Return true if this element, assuming that it is within scope, is accessible to code in the given library. This is defined by the Dart Language Specification in section 3.2: [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
thisOrAncestorMatching<E extends Element>(Predicate<Element> predicate) → E
Return either this element or the most immediate ancestor of this element for which the predicate returns true, or null if there is no such element.
inherited
thisOrAncestorOfType<E extends Element>() → E
Return either this element or the most immediate ancestor of this element that has the given type, or null if there is no such element.
inherited
toString() → String
Returns a string representation of this object.
inherited
visitChildren(ElementVisitor visitor) → void
Use the given visitor to visit all of the children of this element. There is no guarantee of the order in which the children will be visited.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited