Class AstNode
java.lang.Object
com.strobel.core.Freezable
com.strobel.decompiler.languages.java.ast.AstNode
- All Implemented Interfaces:
UserDataStore,IFreezable,INode,Cloneable
- Direct Known Subclasses:
ArraySpecifier,AstType,CaseLabel,CatchClause,Comment,CompilationUnit,EntityDeclaration,Expression,Identifier,ImportDeclaration,JavaTokenNode,NewLineNode,PackageDeclaration,Statement,SwitchExpressionArm,SwitchSection,TextNode,TypeParameterDeclaration,VariableInitializer
-
Field Summary
FieldsFields inherited from interface com.strobel.decompiler.patterns.INode
CHILD_ITERATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract <T,R> R acceptVisitor(IAstVisitor<? super T, ? extends R> visitor, T data) final <T extends AstNode>
voidclone()final booleancontains(int line, int column) final booleancontains(TextLocation location) voidcopyUserDataFrom(AstNode source) static AstNodeforPattern(Pattern pattern) protected voidgetAncestors(Class<T> type) final <T extends AstNode>
TgetChildByRole(Role<? extends T> role) final <T extends AstNode>
AstNodeCollection<T> getChildrenByRole(Role<? extends T> role) final AstNodefinal AstNodefinal AstNodefinal AstNodefinal <T extends AstNode>
TgetNextSibling(Role<? extends T> role) abstract NodeTypefinal AstNodefinal <T extends AstNode>
Tfinal AstNodefinal AstNodefinal <T extends AstNode>
TgetPreviousSibling(Role<? extends T> role) getRole()getText()getText(JavaFormattingOptions options) final <T> TgetUserData(Key<T> key) final booleanfinal <T extends AstNode>
voidinsertChildAfter(AstNode previousSibling, T child, Role<? extends T> role) final <T extends AstNode>
voidinsertChildBefore(AstNode nextSibling, T child, Role<? extends T> role) final <T extends AstNode>
voidinsertChildrenAfter(AstNode nextSibling, Role<? extends T> role, T... children) final <T extends AstNode>
voidinsertChildrenBefore(AstNode nextSibling, Role<? extends T> role, T... children) final booleanisAncestorOf(AstNode node) final booleanisAncestorOf(AstNode node, AstNode stopAt) final booleanisDescendantOf(AstNode node) final booleanisInside(int line, int column) final booleanisInside(TextLocation location) static booleanbooleanisNull()booleanstatic booleanisUnconditionalBranch(AstNode statement) final Matchfinal booleanabstract booleanbooleanmatchesCollection(Role<?> role, INode position, Match match, BacktrackingInfo backtrackingInfo) protected static booleanmatchString(String pattern, String text) final <T> voidputUserData(Key<T> key, T value) final <T> TputUserDataIfAbsent(Key<T> key, T value) final voidremove()final <T> booleanfinal voidreplaceWith(AstNode newNode) final <T extends AstNode>
TreplaceWith(Function<? super AstNode, ? extends T> replaceFunction) protected final <T extends AstNode>
voidsetChildByRole(Role<? extends T> role, T newChild) final voidtoString()Methods inherited from class com.strobel.core.Freezable
canFreeze, freeze, freezeIfUnfrozen, isFrozen, tryFreeze, verifyFrozen, verifyNotFrozen
-
Field Details
-
AST_NODE_USED_FLAGS
protected static final int AST_NODE_USED_FLAGS- See Also:
-
flags
protected int flags -
NULL
-
-
Constructor Details
-
AstNode
protected AstNode()
-
-
Method Details
-
matchString
-
isLoop
-
isUnconditionalBranch
-
acceptVisitor
-
clone
-
copyUserDataFrom
-
getParent
-
getPreviousSibling
-
getLastChild
-
getFirstChild
- Specified by:
getFirstChildin interfaceINode
-
getNextSibling
- Specified by:
getNextSiblingin interfaceINode
-
getPreviousSibling
-
getNextSibling
-
hasChildren
public final boolean hasChildren() -
getNextNode
-
getPreviousNode
-
getChildren
-
isAncestorOf
-
isAncestorOf
-
isDescendantOf
-
getAncestors
-
getAncestors
-
getAncestorsAndSelf
-
getDescendants
-
getDescendantsAndSelf
-
getChildByRole
-
getChildrenByRole
@NotNull public final <T extends AstNode> AstNodeCollection<T> getChildrenByRole(Role<? extends T> role) -
setChildByRole
-
getParent
-
addChild
-
insertChildrenBefore
@SafeVarargs public final <T extends AstNode> void insertChildrenBefore(AstNode nextSibling, Role<? extends T> role, T... children) -
insertChildBefore
-
insertChildrenAfter
@SafeVarargs public final <T extends AstNode> void insertChildrenAfter(AstNode nextSibling, Role<? extends T> role, T... children) -
insertChildAfter
-
remove
public final void remove() -
replaceWith
-
replaceWith
-
freezeCore
protected void freezeCore()- Overrides:
freezeCorein classFreezable
-
getNodeType
-
isReference
public boolean isReference() -
isNull
public boolean isNull() -
getRole
-
setRole
-
matches
-
matchesCollection
public boolean matchesCollection(Role<?> role, INode position, Match match, BacktrackingInfo backtrackingInfo) - Specified by:
matchesCollectionin interfaceINode
-
match
-
matches
-
forPattern
-
withName
-
makeOptional
-
getStartLocation
-
getEndLocation
-
getRegion
-
contains
public final boolean contains(int line, int column) -
contains
-
isInside
public final boolean isInside(int line, int column) -
isInside
-
getText
-
getText
-
toString
-
getUserData
- Specified by:
getUserDatain interfaceUserDataStore
-
putUserData
- Specified by:
putUserDatain interfaceUserDataStore
-
putUserDataIfAbsent
- Specified by:
putUserDataIfAbsentin interfaceUserDataStore
-
replace
- Specified by:
replacein interfaceUserDataStore
-