LibraryElement class

A library.

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

Implemented types

Constructors

LibraryElement()

Properties

definingCompilationUnit CompilationUnitElement
Return the compilation unit that defines this library.
read-only
entryPoint FunctionElement
Return the entry point for this library, or null if this library does not have an entry point. The entry point is defined to be a zero argument top-level function whose name is main.
read-only
exportedLibraries → List<LibraryElement>
Return a list containing all of the libraries that are exported from this library.
read-only
exportNamespace → Namespace
The export Namespace of this library, null if it has not been computed yet.
read-only
exports → List<ExportElement>
Return a list containing all of the exports defined in this library.
read-only
hasExtUri → bool
Return true if the defining compilation unit of this library contains at least one import directive whose URI uses the "dart-ext" scheme.
read-only
hasLoadLibraryFunction → bool
Return true if this library defines a top-level function named loadLibrary.
read-only
identifier → String
Return an identifier that uniquely identifies this element among the children of this element's parent.
read-only
importedLibraries → List<LibraryElement>
Return a list containing all of the libraries that are imported into this library. This includes all of the libraries that are imported using a prefix (also available through the prefixes returned by getPrefixes) and those that are imported without a prefix.
read-only
imports → List<ImportElement>
Return a list containing all of the imports defined in this library.
read-only
isBrowserApplication → bool
Return true if this library is an application that can be run in the browser.
read-only
isDartAsync → bool
Return true if this library is the dart:async library.
read-only
isDartCore → bool
Return true if this library is the dart:core library.
read-only
isInSdk → bool
Return true if this library is part of the SDK.
read-only
isNonNullableByDefault → bool
read-only
libraryCycle → List<LibraryElement>
Return a list containing the strongly connected component in the import/export graph in which the current library resides.
read-only
loadLibraryFunction FunctionElement
Return the element representing the synthetic function loadLibrary that is implicitly defined for this library if the library is imported using a deferred import.
read-only
parts → List<CompilationUnitElement>
Return a list containing all of the compilation units that are included in this library using a part directive. This does not include the defining compilation unit that contains the part directives.
read-only
prefixes → List<PrefixElement>
Return a list containing elements for each of the prefixes used to import libraries into this library. Each prefix can be used in more than one import directive.
read-only
publicNamespace → Namespace
The public Namespace of this library, null if it has not been computed yet.
read-only
topLevelElements → Iterable<Element>
Return the top-level elements defined in each of the compilation units that are included in this library. This includes both public and private elements, but does not include imports, exports, or synthetic elements.
read-only
units → List<CompilationUnitElement>
Return a list containing all of the compilation units this library consists of. This includes the defining compilation unit and units included using the part directive.
read-only
context → AnalysisContext
Return the analysis context in which this element is defined.
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
enclosingElement Element
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, 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
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
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
isAlwaysThrows → bool
Return true if this element has an annotation of the form '@alwaysThrows'.
read-only, inherited
isDeprecated → bool
Return true if this element has an annotation of the form '@deprecated' or '@Deprecated('..')'.
read-only, inherited
isFactory → bool
Return true if this element has an annotation of the form '@factory'.
read-only, inherited
isJS → bool
Return true if this element has an annotation of the form '@JS(..)'.
read-only, inherited
isOverride → bool
Return true if this element has an annotation of the form '@override'.
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
isProtected → bool
Return true if this element has an annotation of the form '@protected'.
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
isRequired → bool
Return true if this element has an annotation of the form '@required'.
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
isVisibleForTesting → bool
Return true if this element has an annotation of the form '@visibleForTesting'.
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
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
unit CompilationUnit
Return the resolved CompilationUnit that declares this element, or null if this element is synthetic. [...]
read-only, inherited

Methods

getImportsWithPrefix(PrefixElement prefix) → List<ImportElement>
Return a list containing all of the imports that share the given prefix, or an empty array if there are no such imports.
getType(String className) ClassElement
Return the class defined in this library that has the given name, or null if this library does not define a class with the given name.
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
computeDocumentationComment() → String
Return the documentation comment for this element as it appears in the original source (complete with the beginning and ending delimiters), or null if this element does not have a documentation comment associated with it. This can be a long-running operation if the information needed to access the comment is not cached. [...]
inherited
computeNode() AstNode
Return the resolved AstNode node that declares this element, or null if this element is synthetic or isn't contained in a compilation unit, such as a LibraryElement. [...]
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.
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
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