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, AstNode.NullAstNode, AstNode.PatternPlaceholder, AstType, CaseLabel, CatchClause, Comment, CompilationUnit, EntityDeclaration, Expression, Identifier, ImportDeclaration, JavaTokenNode, NewLineNode, PackageDeclaration, Statement, SwitchExpressionArm, SwitchSection, TextNode, TypeParameterDeclaration, VariableInitializer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final UserDataStoreprivate AstNodeprivate AstNodeprivate AstNodeprivate AstNodeprivate AstNodeprotected static final intprotected int(package private) static final intstatic final AstNode(package private) static final intFields inherited from interface 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>
void(package private) final voidaddChildUnsafe(AstNode child, Role<?> role) clone()final booleancontains(int line, int column) final booleancontains(TextLocation location) private static <T> voidvoidcopyUserDataFrom(AstNode source) (package private) Stringstatic 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) (package private) final voidinsertChildBeforeUnsafe(AstNode nextSibling, AstNode child, Role<?> 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 void(package private) final voidsetRoleUnsafe(Role<?> role) toString()Methods inherited from class Freezable
canFreeze, freeze, freezeIfUnfrozen, isFrozen, tryFreeze, verifyFrozen, verifyNotFrozen
-
Field Details
-
ROOT_ROLE
-
ROLE_INDEX_MASK
static final int ROLE_INDEX_MASK- See Also:
-
FROZEN_BIT
static final int FROZEN_BIT- See Also:
-
AST_NODE_USED_FLAGS
protected static final int AST_NODE_USED_FLAGS- See Also:
-
flags
protected int flags -
_parent
-
_previousSibling
-
_nextSibling
-
_firstChild
-
_lastChild
-
NULL
-
_dataStore
-
-
Constructor Details
-
AstNode
protected AstNode()
-
-
Method Details
-
matchString
-
isLoop
-
isUnconditionalBranch
-
setRoleUnsafe
-
acceptVisitor
-
clone
-
copyUserDataFrom
-
copyKey
-
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
-
addChildUnsafe
-
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
-
insertChildBeforeUnsafe
-
remove
public final void remove() -
replaceWith
-
replaceWith
-
freezeCore
protected void freezeCore()- Overrides:
freezeCorein classFreezable
-
getNodeType
-
isReference
public boolean isReference() -
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
-
debugToString
String debugToString() -
toString
-
getUserData
- Specified by:
getUserDatain interfaceUserDataStore
-
putUserData
- Specified by:
putUserDatain interfaceUserDataStore
-
putUserDataIfAbsent
- Specified by:
putUserDataIfAbsentin interfaceUserDataStore
-
replace
- Specified by:
replacein interfaceUserDataStore
-