public final class SwitchEntryStmt extends Statement implements NodeWithStatements<SwitchEntryStmt>
switch (i) { case 1: case 2: System.out.println(444); break; default: System.out.println(0); }This contains three SwitchEntryStmts.
SwitchStmt
Node.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversal
ABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration, SYMBOL_RESOLVER_KEY
Constructor and Description |
---|
SwitchEntryStmt() |
SwitchEntryStmt(Expression label,
NodeList<Statement> statements) |
SwitchEntryStmt(TokenRange tokenRange,
Expression label,
NodeList<Statement> statements)
This constructor is used by the parser and is considered private.
|
Modifier and Type | Method and Description |
---|---|
<R,A> R |
accept(GenericVisitor<R,A> v,
A arg)
Accept method for visitor support.
|
<A> void |
accept(VoidVisitor<A> v,
A arg)
Accept method for visitor support.
|
SwitchEntryStmt |
asSwitchEntryStmt() |
SwitchEntryStmt |
clone() |
Optional<Expression> |
getLabel() |
SwitchEntryStmtMetaModel |
getMetaModel() |
NodeList<Statement> |
getStatements() |
void |
ifSwitchEntryStmt(Consumer<SwitchEntryStmt> action) |
boolean |
isSwitchEntryStmt() |
boolean |
remove(Node node) |
SwitchEntryStmt |
removeLabel() |
boolean |
replace(Node node,
Node replacementNode) |
SwitchEntryStmt |
setLabel(Expression label)
Sets the label
|
SwitchEntryStmt |
setStatements(NodeList<Statement> statements) |
Optional<SwitchEntryStmt> |
toSwitchEntryStmt() |
asAssertStmt, asBlockStmt, asBreakStmt, asContinueStmt, asDoStmt, asEmptyStmt, asExplicitConstructorInvocationStmt, asExpressionStmt, asForeachStmt, asForStmt, asIfStmt, asLabeledStmt, asLocalClassDeclarationStmt, asReturnStmt, asSwitchStmt, asSynchronizedStmt, asThrowStmt, asTryStmt, asUnparsableStmt, asWhileStmt, ifAssertStmt, ifBlockStmt, ifBreakStmt, ifContinueStmt, ifDoStmt, ifEmptyStmt, ifExplicitConstructorInvocationStmt, ifExpressionStmt, ifForeachStmt, ifForStmt, ifIfStmt, ifLabeledStmt, ifLocalClassDeclarationStmt, ifReturnStmt, ifSwitchStmt, ifSynchronizedStmt, ifThrowStmt, ifTryStmt, ifUnparsableStmt, ifWhileStmt, isAssertStmt, isBlockStmt, isBreakStmt, isContinueStmt, isDoStmt, isEmptyStmt, isExplicitConstructorInvocationStmt, isExpressionStmt, isForeachStmt, isForStmt, isIfStmt, isLabeledStmt, isLocalClassDeclarationStmt, isReturnStmt, isSwitchStmt, isSynchronizedStmt, isThrowStmt, isTryStmt, isUnparsableStmt, isWhileStmt, toAssertStmt, toBlockStmt, toBreakStmt, toContinueStmt, toDoStmt, toEmptyStmt, toExplicitConstructorInvocationStmt, toExpressionStmt, toForeachStmt, toForStmt, toIfStmt, toLabeledStmt, toLocalClassDeclarationStmt, toReturnStmt, toSwitchStmt, toSynchronizedStmt, toThrowStmt, toTryStmt, toUnparsableStmt, toWhileStmt
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, removeForced, removeOrphanComment, replace, setAsParentNodeOf, setAsParentNodeOf, setBlockComment, setComment, setData, setLineComment, setParentNode, setParsed, setRange, setTokenRange, stream, stream, toString, toString, tryAddImportToParentCompilationUnit, unregister, walk, walk, walk
finalize, getClass, notify, notifyAll, wait, wait, wait
addAndGetStatement, addAndGetStatement, addAndGetStatement, addAndGetStatement, addStatement, addStatement, addStatement, addStatement, addStatement, copyStatements, copyStatements, getStatement, isEmpty, setStatement
findAncestor, findParent, getAncestorOfType
containsWithin, getBegin, getEnd, isPositionedAfter, isPositionedBefore
public SwitchEntryStmt()
public SwitchEntryStmt(Expression label, NodeList<Statement> statements)
public SwitchEntryStmt(TokenRange tokenRange, Expression label, NodeList<Statement> statements)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Visitable
accept
in interface Visitable
R
- the type of the return value of the visitorA
- the type the user argument passed to the visitorv
- the visitor implementationarg
- the argument passed to the visitor (of type A)public <A> void accept(VoidVisitor<A> v, A arg)
Visitable
public Optional<Expression> getLabel()
public NodeList<Statement> getStatements()
getStatements
in interface NodeWithStatements<SwitchEntryStmt>
public SwitchEntryStmt setLabel(Expression label)
label
- the label, can be nullpublic SwitchEntryStmt setStatements(NodeList<Statement> statements)
setStatements
in interface NodeWithStatements<SwitchEntryStmt>
public SwitchEntryStmt removeLabel()
public SwitchEntryStmt clone()
public SwitchEntryStmtMetaModel getMetaModel()
getMetaModel
in class Statement
public boolean isSwitchEntryStmt()
isSwitchEntryStmt
in class Statement
public SwitchEntryStmt asSwitchEntryStmt()
asSwitchEntryStmt
in class Statement
public void ifSwitchEntryStmt(Consumer<SwitchEntryStmt> action)
ifSwitchEntryStmt
in class Statement
public Optional<SwitchEntryStmt> toSwitchEntryStmt()
toSwitchEntryStmt
in class Statement
Copyright © 2007–2018. All rights reserved.