ImportDirectiveImpl class

An import directive.

importDirective ::= Annotation 'import' StringLiteral ('as' identifier)? | Annotation 'import' StringLiteral 'deferred' 'as' identifier

Inheritance
Implemented types
Available Extensions

Constructors

ImportDirectiveImpl({required CommentImpl? comment, required List<AnnotationImpl>? metadata, required Token importKeyword, required StringLiteralImpl uri, required List<ConfigurationImpl>? configurations, required Token? deferredKeyword, required Token? asKeyword, required SimpleIdentifierImpl? prefix, required List<CombinatorImpl>? combinators, required Token semicolon})
Initialize a newly created import directive. Either or both of the comment and metadata can be null if the function does not have the corresponding attribute. The deferredKeyword can be null if the import is not deferred. The asKeyword and prefix can be null if the import does not specify a prefix. The list of combinators can be null if there are no combinators.

Properties

asKeyword → Token?
The token representing the 'as' keyword, or null if the imported names are not prefixed.
final
beginToken → Token
Return the first token included in this node's source range.
no setterinherited
childEntities Iterable<SyntacticEntity>
Return an iterator that can be used to iterate through all the entities (either AST nodes or tokens) that make up the contents of this node, including doc comments but excluding other comments.
no setterinherited
combinators NodeListImpl<CombinatorImpl>
Return the combinators used to control how names are imported or exported.
no setterinherited
configurations NodeListImpl<ConfigurationImpl>
Return the configurations used to control which library will actually be loaded at run-time.
no setterinherited
deferredKeyword → Token?
The token representing the 'deferred' keyword, or null if the imported is not deferred.
final
documentationComment CommentImpl?
Return the documentation comment associated with this node, or null if this node does not have a documentation comment associated with it.
getter/setter pairinherited
element ↔ LibraryImportElement?
Return the element associated with this directive, or null if the AST structure has not been resolved.
getter/setter pairinherited-setteroverride-getter
element2 → LibraryImportElement?
Return the element associated with this directive, or null if the AST structure has not been resolved.
no setteroverride
end int
Return the offset of the character immediately following the last character of this node's source range.
no setterinherited
endToken → Token
Return the last token included in this node's source range.
no setterinherited
firstTokenAfterCommentAndMetadata → Token
Return the first token following the comment and metadata.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
importKeyword → Token
The token representing the 'import' keyword.
final
isSynthetic bool
Return true if this node is a synthetic node.
no setterinherited
length int
Return the number of characters in the syntactic entity's source range.
no setterinherited
metadata NodeListImpl<AnnotationImpl>
Return the annotations associated with this node.
no setterinherited
namedChildEntities Iterable<ChildEntity>
Return properties (tokens and nodes) of this node, with names, in the order in which these entities should normally appear, not necessary in the order they really are (because of recovery).
no setterinherited
offset int
Return the offset from the beginning of the file to the first character in the syntactic entity.
no setterinherited
parent AstNode?
Return this node's parent node, or null if this node is the root of an AST structure.
no setterinherited
prefix SimpleIdentifierImpl?
Return the prefix to be used with the imported names, or null if the imported names are not prefixed.
getter/setter pairoverride-getter
root AstNode
Return the node at the root of this node's AST structure.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semicolon → Token
The semicolon terminating the directive.
finalinherited
sortedCommentAndAnnotations List<AstNode>
Return a list containing the comment and annotations associated with this node, sorted in lexical order.
no setterinherited
uri StringLiteralImpl
Return the URI referenced by this directive.
getter/setter pairinherited

Methods

accept<E>(AstVisitor<E> visitor) → E?
Use the given visitor to visit this node.
override
detachFromParent() → void
inherited
findPrevious(Token target) → Token?
Return the token before target or null if it cannot be found.
inherited
getProperty<E>(String name) → E?
Return the value of the property with the given name, or null if this node does not have a property with the given name.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setProperty(String name, Object? value) → void
Set the value of the property with the given name to the given value. If the value is null, the property will effectively be removed.
inherited
thisOrAncestorMatching<E extends AstNode>(bool predicate(AstNode)) → E?
Return either this node or the most immediate ancestor of this node for which the predicate returns true, or null if there is no such node.
inherited
thisOrAncestorOfType<E extends AstNode>() → E?
Return either this node or the most immediate ancestor of this node that has the given type, or null if there is no such node.
inherited
toSource() String
Return a textual description of this node in a form approximating valid source.
inherited
toString() String
A string representation of this object.
inherited
visitChildren(AstVisitor visitor) → void
Use the given visitor to visit all of the children of this node.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

areSyntacticallyIdenticalExceptUri(NamespaceDirective node1, NamespaceDirective node2) bool
Return true if the non-URI components of the two directives are syntactically identical. URIs are checked outside to see if they resolve to the same absolute URI, so to the same library, regardless of the used syntax (absolute, relative, not normalized).