Package com.github.javaparser.ast.stmt
Class Statement
- java.lang.Object
-
- com.github.javaparser.ast.Node
-
- com.github.javaparser.ast.stmt.Statement
-
- All Implemented Interfaces:
NodeWithRange<Node>
,NodeWithTokenRange<Node>
,Observable
,Visitable
,HasParentNode<Node>
,Cloneable
- Direct Known Subclasses:
AssertStmt
,BlockStmt
,BreakStmt
,ContinueStmt
,DoStmt
,EmptyStmt
,ExplicitConstructorInvocationStmt
,ExpressionStmt
,ForEachStmt
,ForStmt
,IfStmt
,LabeledStmt
,LocalClassDeclarationStmt
,ReturnStmt
,SwitchEntryStmt
,SwitchStmt
,SynchronizedStmt
,ThrowStmt
,TryStmt
,UnparsableStmt
,WhileStmt
public abstract class Statement extends Node
A base class for all statements.- Author:
- Julio Vilmar Gesser
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.github.javaparser.ast.Node
Node.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversal
-
-
Field Summary
-
Fields inherited from class com.github.javaparser.ast.Node
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration, SYMBOL_RESOLVER_KEY
-
-
Constructor Summary
Constructors Constructor Description Statement()
Statement(TokenRange tokenRange)
This constructor is used by the parser and is considered private.
-
Method Summary
-
Methods inherited from class com.github.javaparser.ast.Node
addOrphanComment, containsData, customInitialization, equals, findAll, findAll, findCompilationUnit, findFirst, findFirst, findFirst, findRootNode, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getRange, getSymbolResolver, getTokenRange, hasComment, hashCode, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, removeComment, removeData, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walk
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.javaparser.HasParentNode
findAncestor, findAncestor, findParent, getAncestorOfType
-
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithRange
containsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBefore
-
-
-
-
Constructor Detail
-
Statement
public Statement()
-
Statement
public Statement(TokenRange tokenRange)
This constructor is used by the parser and is considered private.
-
-
Method Detail
-
getMetaModel
public StatementMetaModel getMetaModel()
- Overrides:
getMetaModel
in classNode
- Returns:
- get JavaParser specific node introspection information.
-
isAssertStmt
public boolean isAssertStmt()
-
asAssertStmt
public AssertStmt asAssertStmt()
-
isBlockStmt
public boolean isBlockStmt()
-
asBlockStmt
public BlockStmt asBlockStmt()
-
isBreakStmt
public boolean isBreakStmt()
-
asBreakStmt
public BreakStmt asBreakStmt()
-
isContinueStmt
public boolean isContinueStmt()
-
asContinueStmt
public ContinueStmt asContinueStmt()
-
isDoStmt
public boolean isDoStmt()
-
asDoStmt
public DoStmt asDoStmt()
-
isEmptyStmt
public boolean isEmptyStmt()
-
asEmptyStmt
public EmptyStmt asEmptyStmt()
-
isExplicitConstructorInvocationStmt
public boolean isExplicitConstructorInvocationStmt()
-
asExplicitConstructorInvocationStmt
public ExplicitConstructorInvocationStmt asExplicitConstructorInvocationStmt()
-
isExpressionStmt
public boolean isExpressionStmt()
-
asExpressionStmt
public ExpressionStmt asExpressionStmt()
-
isForStmt
public boolean isForStmt()
-
asForStmt
public ForStmt asForStmt()
-
isForeachStmt
public boolean isForeachStmt()
-
asForeachStmt
public ForEachStmt asForeachStmt()
-
isIfStmt
public boolean isIfStmt()
-
asIfStmt
public IfStmt asIfStmt()
-
isLabeledStmt
public boolean isLabeledStmt()
-
asLabeledStmt
public LabeledStmt asLabeledStmt()
-
isLocalClassDeclarationStmt
public boolean isLocalClassDeclarationStmt()
-
asLocalClassDeclarationStmt
public LocalClassDeclarationStmt asLocalClassDeclarationStmt()
-
isReturnStmt
public boolean isReturnStmt()
-
asReturnStmt
public ReturnStmt asReturnStmt()
-
isSwitchEntryStmt
public boolean isSwitchEntryStmt()
-
asSwitchEntryStmt
public SwitchEntryStmt asSwitchEntryStmt()
-
isSwitchStmt
public boolean isSwitchStmt()
-
asSwitchStmt
public SwitchStmt asSwitchStmt()
-
isSynchronizedStmt
public boolean isSynchronizedStmt()
-
asSynchronizedStmt
public SynchronizedStmt asSynchronizedStmt()
-
isThrowStmt
public boolean isThrowStmt()
-
asThrowStmt
public ThrowStmt asThrowStmt()
-
isTryStmt
public boolean isTryStmt()
-
asTryStmt
public TryStmt asTryStmt()
-
isUnparsableStmt
public boolean isUnparsableStmt()
-
asUnparsableStmt
public UnparsableStmt asUnparsableStmt()
-
isWhileStmt
public boolean isWhileStmt()
-
asWhileStmt
public WhileStmt asWhileStmt()
-
ifAssertStmt
public void ifAssertStmt(Consumer<AssertStmt> action)
-
ifContinueStmt
public void ifContinueStmt(Consumer<ContinueStmt> action)
-
ifExplicitConstructorInvocationStmt
public void ifExplicitConstructorInvocationStmt(Consumer<ExplicitConstructorInvocationStmt> action)
-
ifExpressionStmt
public void ifExpressionStmt(Consumer<ExpressionStmt> action)
-
ifForeachStmt
public void ifForeachStmt(Consumer<ForEachStmt> action)
-
ifLabeledStmt
public void ifLabeledStmt(Consumer<LabeledStmt> action)
-
ifLocalClassDeclarationStmt
public void ifLocalClassDeclarationStmt(Consumer<LocalClassDeclarationStmt> action)
-
ifReturnStmt
public void ifReturnStmt(Consumer<ReturnStmt> action)
-
ifSwitchEntryStmt
public void ifSwitchEntryStmt(Consumer<SwitchEntryStmt> action)
-
ifSwitchStmt
public void ifSwitchStmt(Consumer<SwitchStmt> action)
-
ifSynchronizedStmt
public void ifSynchronizedStmt(Consumer<SynchronizedStmt> action)
-
ifUnparsableStmt
public void ifUnparsableStmt(Consumer<UnparsableStmt> action)
-
toAssertStmt
public Optional<AssertStmt> toAssertStmt()
-
toContinueStmt
public Optional<ContinueStmt> toContinueStmt()
-
toExplicitConstructorInvocationStmt
public Optional<ExplicitConstructorInvocationStmt> toExplicitConstructorInvocationStmt()
-
toExpressionStmt
public Optional<ExpressionStmt> toExpressionStmt()
-
toForeachStmt
public Optional<ForEachStmt> toForeachStmt()
-
toLabeledStmt
public Optional<LabeledStmt> toLabeledStmt()
-
toLocalClassDeclarationStmt
public Optional<LocalClassDeclarationStmt> toLocalClassDeclarationStmt()
-
toReturnStmt
public Optional<ReturnStmt> toReturnStmt()
-
toSwitchEntryStmt
public Optional<SwitchEntryStmt> toSwitchEntryStmt()
-
toSwitchStmt
public Optional<SwitchStmt> toSwitchStmt()
-
toSynchronizedStmt
public Optional<SynchronizedStmt> toSynchronizedStmt()
-
toUnparsableStmt
public Optional<UnparsableStmt> toUnparsableStmt()
-
isForEachStmt
public boolean isForEachStmt()
-
asForEachStmt
public ForEachStmt asForEachStmt()
-
toForEachStmt
public Optional<ForEachStmt> toForEachStmt()
-
ifForEachStmt
public void ifForEachStmt(Consumer<ForEachStmt> action)
-
-