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
,LocalRecordDeclarationStmt
,ReturnStmt
,SwitchStmt
,SynchronizedStmt
,ThrowStmt
,TryStmt
,UnparsableStmt
,WhileStmt
,YieldStmt
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, LINE_SEPARATOR_KEY, NODE_BY_BEGIN_POSITION, PHANTOM_KEY, prettyPrinterNoCommentsConfiguration, PRINTER_KEY, SYMBOL_RESOLVER_KEY
-
Constructor Summary
ConstructorsConstructorDescriptionStatement(TokenRange tokenRange)
This constructor is used by the parser and is considered private. -
Method Summary
Modifier and TypeMethodDescriptionasDoStmt()
asIfStmt()
clone()
void
ifAssertStmt(Consumer<AssertStmt> action)
void
ifBlockStmt(Consumer<BlockStmt> action)
void
ifBreakStmt(Consumer<BreakStmt> action)
void
ifContinueStmt(Consumer<ContinueStmt> action)
void
void
ifEmptyStmt(Consumer<EmptyStmt> action)
void
void
ifExpressionStmt(Consumer<ExpressionStmt> action)
void
ifForEachStmt(Consumer<ForEachStmt> action)
void
void
void
ifLabeledStmt(Consumer<LabeledStmt> action)
void
void
void
ifReturnStmt(Consumer<ReturnStmt> action)
void
ifSwitchStmt(Consumer<SwitchStmt> action)
void
ifSynchronizedStmt(Consumer<SynchronizedStmt> action)
void
ifThrowStmt(Consumer<ThrowStmt> action)
void
void
ifUnparsableStmt(Consumer<UnparsableStmt> action)
void
ifWhileStmt(Consumer<WhileStmt> action)
void
ifYieldStmt(Consumer<YieldStmt> action)
boolean
boolean
boolean
boolean
boolean
isDoStmt()
boolean
boolean
boolean
boolean
boolean
boolean
isIfStmt()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
toDoStmt()
toIfStmt()
Methods inherited from class com.github.javaparser.ast.Node
addOrphanComment, containsData, createDefaultPrinter, createDefaultPrinter, customInitialization, equals, findAll, findAll, findAll, findCompilationUnit, findFirst, findFirst, findFirst, findRootNode, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getDataKeys, getDefaultPrinterConfiguration, getLineEndingStyle, getLineEndingStyleOrDefault, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getPrinter, getPrinter, getRange, getSymbolResolver, getTokenRange, hashCode, hasScope, isAncestorOf, isPhantom, isRegistered, notifyPropertyChange, register, register, registerForSubtree, remove, remove, removeComment, removeData, removeForced, removeOrphanComment, replace, 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, hasParentNode, isDescendantOf
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithRange
containsWithin, containsWithinRange, getBegin, getEnd, hasRange
-
Constructor Details
-
Statement
public Statement() -
Statement
This constructor is used by the parser and is considered private.
-
-
Method Details
-
clone
-
getMetaModel
- Overrides:
getMetaModel
in classNode
- Returns:
- get JavaParser specific node introspection information.
-
isAssertStmt
public boolean isAssertStmt() -
asAssertStmt
-
isBlockStmt
public boolean isBlockStmt() -
asBlockStmt
-
isBreakStmt
public boolean isBreakStmt() -
asBreakStmt
-
isContinueStmt
public boolean isContinueStmt() -
asContinueStmt
-
isDoStmt
public boolean isDoStmt() -
asDoStmt
-
isEmptyStmt
public boolean isEmptyStmt() -
asEmptyStmt
-
isExplicitConstructorInvocationStmt
public boolean isExplicitConstructorInvocationStmt() -
asExplicitConstructorInvocationStmt
-
isExpressionStmt
public boolean isExpressionStmt() -
asExpressionStmt
-
isForStmt
public boolean isForStmt() -
asForStmt
-
isIfStmt
public boolean isIfStmt() -
asIfStmt
-
isLabeledStmt
public boolean isLabeledStmt() -
asLabeledStmt
-
isLocalClassDeclarationStmt
public boolean isLocalClassDeclarationStmt() -
isLocalRecordDeclarationStmt
public boolean isLocalRecordDeclarationStmt() -
asLocalClassDeclarationStmt
-
asLocalRecordDeclarationStmt
-
isReturnStmt
public boolean isReturnStmt() -
asReturnStmt
-
isSwitchStmt
public boolean isSwitchStmt() -
asSwitchStmt
-
isSynchronizedStmt
public boolean isSynchronizedStmt() -
asSynchronizedStmt
-
isThrowStmt
public boolean isThrowStmt() -
asThrowStmt
-
isTryStmt
public boolean isTryStmt() -
asTryStmt
-
isUnparsableStmt
public boolean isUnparsableStmt() -
asUnparsableStmt
-
isWhileStmt
public boolean isWhileStmt() -
asWhileStmt
-
ifAssertStmt
-
ifBlockStmt
-
ifBreakStmt
-
ifContinueStmt
-
ifDoStmt
-
ifEmptyStmt
-
ifExplicitConstructorInvocationStmt
public void ifExplicitConstructorInvocationStmt(Consumer<ExplicitConstructorInvocationStmt> action) -
ifExpressionStmt
-
ifForStmt
-
ifIfStmt
-
ifLabeledStmt
-
ifLocalClassDeclarationStmt
-
ifLocalRecordDeclarationStmt
-
ifReturnStmt
-
ifSwitchStmt
-
ifSynchronizedStmt
-
ifThrowStmt
-
ifTryStmt
-
ifUnparsableStmt
-
ifWhileStmt
-
toAssertStmt
-
toBlockStmt
-
toBreakStmt
-
toContinueStmt
-
toDoStmt
-
toEmptyStmt
-
toExplicitConstructorInvocationStmt
-
toExpressionStmt
-
toForStmt
-
toIfStmt
-
toLabeledStmt
-
toLocalClassDeclarationStmt
-
toLocalRecordDeclarationStmt
-
toReturnStmt
-
toSwitchStmt
-
toSynchronizedStmt
-
toThrowStmt
-
toTryStmt
-
toUnparsableStmt
-
toWhileStmt
-
isForEachStmt
public boolean isForEachStmt() -
asForEachStmt
-
toForEachStmt
-
ifForEachStmt
-
isYieldStmt
public boolean isYieldStmt() -
asYieldStmt
-
toYieldStmt
-
ifYieldStmt
-