public final class AssertStmt extends Statement
assert dead : "Wasn't expecting to be dead here"; the check is "dead" and the message is the string.Node.BreadthFirstIterator, Node.DirectChildrenIterator, Node.ObserverRegistrationMode, Node.ParentsVisitor, Node.Parsedness, Node.PostOrderIterator, Node.PreOrderIterator, Node.TreeTraversalABSOLUTE_BEGIN_LINE, ABSOLUTE_END_LINE, NODE_BY_BEGIN_POSITION, prettyPrinterNoCommentsConfiguration, SYMBOL_RESOLVER_KEY| Constructor and Description |
|---|
AssertStmt() |
AssertStmt(Expression check) |
AssertStmt(Expression check,
Expression message) |
AssertStmt(TokenRange tokenRange,
Expression check,
Expression message)
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.
|
AssertStmt |
asAssertStmt() |
AssertStmt |
clone() |
Expression |
getCheck() |
Optional<Expression> |
getMessage() |
AssertStmtMetaModel |
getMetaModel() |
void |
ifAssertStmt(Consumer<AssertStmt> action) |
boolean |
isAssertStmt() |
boolean |
remove(Node node) |
AssertStmt |
removeMessage() |
boolean |
replace(Node node,
Node replacementNode) |
AssertStmt |
setCheck(Expression check) |
AssertStmt |
setMessage(Expression message)
Sets the message
|
Optional<AssertStmt> |
toAssertStmt() |
asBlockStmt, asBreakStmt, asContinueStmt, asDoStmt, asEmptyStmt, asExplicitConstructorInvocationStmt, asExpressionStmt, asForEachStmt, asForStmt, asIfStmt, asLabeledStmt, asLocalClassDeclarationStmt, asReturnStmt, asSwitchStmt, asSynchronizedStmt, asThrowStmt, asTryStmt, asUnparsableStmt, asWhileStmt, ifBlockStmt, ifBreakStmt, ifContinueStmt, ifDoStmt, ifEmptyStmt, ifExplicitConstructorInvocationStmt, ifExpressionStmt, ifForEachStmt, ifForStmt, ifIfStmt, ifLabeledStmt, ifLocalClassDeclarationStmt, ifReturnStmt, ifSwitchStmt, ifSynchronizedStmt, ifThrowStmt, ifTryStmt, ifUnparsableStmt, ifWhileStmt, isBlockStmt, isBreakStmt, isContinueStmt, isDoStmt, isEmptyStmt, isExplicitConstructorInvocationStmt, isExpressionStmt, isForEachStmt, isForStmt, isIfStmt, isLabeledStmt, isLocalClassDeclarationStmt, isReturnStmt, isSwitchStmt, isSynchronizedStmt, isThrowStmt, isTryStmt, isUnparsableStmt, isWhileStmt, toBlockStmt, toBreakStmt, toContinueStmt, toDoStmt, toEmptyStmt, toExplicitConstructorInvocationStmt, toExpressionStmt, toForEachStmt, toForStmt, toIfStmt, toLabeledStmt, toLocalClassDeclarationStmt, toReturnStmt, toSwitchStmt, toSynchronizedStmt, toThrowStmt, toTryStmt, toUnparsableStmt, toWhileStmtaddOrphanComment, containsData, customInitialization, equals, findAll, findAll, findCompilationUnit, findFirst, findFirst, findFirst, findRootNode, getAllContainedComments, getChildNodes, getChildNodesByType, getComment, getData, getNodesByType, getOrphanComments, getParentNode, getParentNodeForChildren, getParsed, getRange, getSymbolResolver, getTokenRange, 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, walkfinalize, getClass, notify, notifyAll, wait, wait, waitfindAncestor, findAncestorcontainsWithin, getBegin, getEndpublic AssertStmt()
public AssertStmt(Expression check)
public AssertStmt(Expression check, Expression message)
public AssertStmt(TokenRange tokenRange, Expression check, Expression message)
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
VisitableR - 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)
VisitableA - the type the argument passed for the visitorv - the visitor implementationarg - any value relevant for the visitor (of type A)public Expression getCheck()
public Optional<Expression> getMessage()
public AssertStmt setCheck(Expression check)
public AssertStmt setMessage(Expression message)
message - the message, can be nullpublic AssertStmt removeMessage()
public AssertStmt clone()
public AssertStmtMetaModel getMetaModel()
getMetaModel in class Statementpublic boolean isAssertStmt()
isAssertStmt in class Statementpublic AssertStmt asAssertStmt()
asAssertStmt in class Statementpublic void ifAssertStmt(Consumer<AssertStmt> action)
ifAssertStmt in class Statementpublic Optional<AssertStmt> toAssertStmt()
toAssertStmt in class StatementCopyright © 2007–2019. All rights reserved.