NodeReplacer class

An object that will replace one child node in an AST node with another node.

Implemented types

Constructors

NodeReplacer(AstNode _oldNode, AstNode _newNode)
Initialize a newly created node locator to replace the _oldNode with the _newNode.

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

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
visitAdjacentStrings(AdjacentStrings node) bool
override
visitAnnotatedNode(AnnotatedNode node) bool
visitAnnotation(Annotation node) bool
override
visitArgumentList(ArgumentList node) bool
override
visitAsExpression(AsExpression node) bool
override
visitAssertInitializer(AssertInitializer node) bool
override
visitAssertStatement(AssertStatement node) bool
override
visitAssignmentExpression(AssignmentExpression node) bool
override
visitAwaitExpression(AwaitExpression node) bool
override
visitBinaryExpression(BinaryExpression node) bool
override
visitBlock(Block node) bool
override
visitBlockFunctionBody(BlockFunctionBody node) bool
override
visitBooleanLiteral(BooleanLiteral node) bool
override
visitBreakStatement(BreakStatement node) bool
override
visitCascadeExpression(CascadeExpression node) bool
override
visitCatchClause(CatchClause node) bool
override
visitClassDeclaration(ClassDeclaration node) bool
override
visitClassTypeAlias(ClassTypeAlias node) bool
override
visitComment(Comment node) bool
override
visitCommentReference(CommentReference node) bool
override
visitCompilationUnit(CompilationUnit node) bool
override
visitConditionalExpression(ConditionalExpression node) bool
override
visitConfiguration(Configuration node) bool
override
visitConstructorDeclaration(ConstructorDeclaration node) bool
override
visitConstructorFieldInitializer(ConstructorFieldInitializer node) bool
override
visitConstructorName(ConstructorName node) bool
override
visitContinueStatement(ContinueStatement node) bool
override
visitDeclaredIdentifier(DeclaredIdentifier node) bool
override
visitDefaultFormalParameter(DefaultFormalParameter node) bool
override
visitDoStatement(DoStatement node) bool
override
visitDottedName(DottedName node) bool
override
visitDoubleLiteral(DoubleLiteral node) bool
override
visitEmptyFunctionBody(EmptyFunctionBody node) bool
override
visitEmptyStatement(EmptyStatement node) bool
override
visitEnumConstantDeclaration(EnumConstantDeclaration node) bool
override
visitEnumDeclaration(EnumDeclaration node) bool
override
visitExportDirective(ExportDirective node) bool
override
visitExpressionFunctionBody(ExpressionFunctionBody node) bool
override
visitExpressionStatement(ExpressionStatement node) bool
override
visitExtendsClause(ExtendsClause node) bool
override
visitExtensionDeclaration(ExtensionDeclaration node) bool
override
visitExtensionOverride(ExtensionOverride node) bool
override
visitFieldDeclaration(FieldDeclaration node) bool
override
visitFieldFormalParameter(FieldFormalParameter node) bool
override
visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) bool
override
visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) bool
override
visitForElement(ForElement node) bool
override
visitFormalParameterList(FormalParameterList node) bool
override
visitForPartsWithDeclarations(ForPartsWithDeclarations node) bool
override
visitForPartsWithExpression(ForPartsWithExpression node) bool
override
visitForStatement(ForStatement node) bool
override
visitFunctionDeclaration(FunctionDeclaration node) bool
override
visitFunctionDeclarationStatement(FunctionDeclarationStatement node) bool
override
visitFunctionExpression(FunctionExpression node) bool
override
visitFunctionExpressionInvocation(FunctionExpressionInvocation node) bool
override
visitFunctionTypeAlias(FunctionTypeAlias node) bool
override
visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) bool
override
visitGenericFunctionType(GenericFunctionType node) bool
override
visitGenericTypeAlias(GenericTypeAlias node) bool
override
visitHideCombinator(HideCombinator node) bool
override
visitIfElement(IfElement node) bool
override
visitIfStatement(IfStatement node) bool
override
visitImplementsClause(ImplementsClause node) bool
override
visitImportDirective(ImportDirective node) bool
override
visitIndexExpression(IndexExpression node) bool
override
visitInstanceCreationExpression(InstanceCreationExpression node) bool
override
visitIntegerLiteral(IntegerLiteral node) bool
override
visitInterpolationExpression(InterpolationExpression node) bool
override
visitInterpolationString(InterpolationString node) bool
override
visitIsExpression(IsExpression node) bool
override
visitLabel(Label node) bool
override
visitLabeledStatement(LabeledStatement node) bool
override
visitLibraryDirective(LibraryDirective node) bool
override
visitLibraryIdentifier(LibraryIdentifier node) bool
override
visitListLiteral(ListLiteral node) bool
override
visitMapLiteralEntry(MapLiteralEntry node) bool
override
visitMethodDeclaration(MethodDeclaration node) bool
override
visitMethodInvocation(MethodInvocation node) bool
override
visitMixinDeclaration(MixinDeclaration node) bool
override
visitNamedExpression(NamedExpression node) bool
override
visitNamespaceDirective(NamespaceDirective node) bool
visitNativeClause(NativeClause node) bool
override
visitNativeFunctionBody(NativeFunctionBody node) bool
override
visitNode(AstNode node) bool
visitNormalFormalParameter(NormalFormalParameter node) bool
visitNullLiteral(NullLiteral node) bool
override
visitOnClause(OnClause node) bool
override
visitParenthesizedExpression(ParenthesizedExpression node) bool
override
visitPartDirective(PartDirective node) bool
override
visitPartOfDirective(PartOfDirective node) bool
override
visitPostfixExpression(PostfixExpression node) bool
override
visitPrefixedIdentifier(PrefixedIdentifier node) bool
override
visitPrefixExpression(PrefixExpression node) bool
override
visitPropertyAccess(PropertyAccess node) bool
override
visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) bool
override
visitRethrowExpression(RethrowExpression node) bool
override
visitReturnStatement(ReturnStatement node) bool
override
visitScriptTag(ScriptTag scriptTag) bool
override
visitSetOrMapLiteral(SetOrMapLiteral node) bool
override
visitShowCombinator(ShowCombinator node) bool
override
visitSimpleFormalParameter(SimpleFormalParameter node) bool
override
visitSimpleIdentifier(SimpleIdentifier node) bool
override
visitSimpleStringLiteral(SimpleStringLiteral node) bool
override
visitSpreadElement(SpreadElement node) bool
override
visitStringInterpolation(StringInterpolation node) bool
override
visitSuperConstructorInvocation(SuperConstructorInvocation node) bool
override
visitSuperExpression(SuperExpression node) bool
override
visitSwitchCase(SwitchCase node) bool
override
visitSwitchDefault(SwitchDefault node) bool
override
visitSwitchMember(SwitchMember node) bool
visitSwitchStatement(SwitchStatement node) bool
override
visitSymbolLiteral(SymbolLiteral node) bool
override
visitThisExpression(ThisExpression node) bool
override
visitThrowExpression(ThrowExpression node) bool
override
visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) bool
override
visitTryStatement(TryStatement node) bool
override
visitTypeArgumentList(TypeArgumentList node) bool
override
visitTypedLiteral(TypedLiteral node) bool
visitTypeName(TypeName node) bool
override
visitTypeParameter(TypeParameter node) bool
override
visitTypeParameterList(TypeParameterList node) bool
override
visitUriBasedDirective(UriBasedDirective node) bool
visitVariableDeclaration(VariableDeclaration node) bool
override
visitVariableDeclarationList(VariableDeclarationList node) bool
override
visitVariableDeclarationStatement(VariableDeclarationStatement node) bool
override
visitWhileStatement(WhileStatement node) bool
override
visitWithClause(WithClause node) bool
override
visitYieldStatement(YieldStatement node) bool
override

Operators

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

Static Methods

replace(AstNode oldNode, AstNode newNode) bool
Replace the oldNode with the newNode in the AST structure containing the old node. Return true if the replacement was successful. [...]