Package com.github.javaparser.ast.expr
Class MatchAllPatternExpr
- java.lang.Object
-
- com.github.javaparser.ast.Node
-
- com.github.javaparser.ast.expr.Expression
-
- com.github.javaparser.ast.expr.ComponentPatternExpr
-
- com.github.javaparser.ast.expr.MatchAllPatternExpr
-
- All Implemented Interfaces:
NodeWithFinalModifier<MatchAllPatternExpr>,NodeWithModifiers<MatchAllPatternExpr>,NodeWithRange<Node>,NodeWithTokenRange<Node>,Observable,Visitable,HasParentNode<Node>,Cloneable
public class MatchAllPatternExpr extends ComponentPatternExpr implements NodeWithFinalModifier<MatchAllPatternExpr>
MatchAllPatternExpressions were added in JEP456. They are untyped pattern expressions that cannot be used as top-level patterns. MatchAllPatternExpr (`_`) should not be confused with an unnamed TypePatternExpr (`String _`) which does have a type, but does not introduce any variables to scope.
-
-
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 Modifier and Type Field Description static StringUNNAMED_PLACEHOLDER-
Fields inherited from class com.github.javaparser.ast.expr.Expression
EXCLUDE_ENCLOSED_EXPR, IS_NOT_ENCLOSED_EXPR
-
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
Constructors Constructor Description MatchAllPatternExpr(NodeList<Modifier> modifiers)MatchAllPatternExpr(TokenRange tokenRange, NodeList<Modifier> modifiers)This constructor is used by the parser and is considered private.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,A>
Raccept(GenericVisitor<R,A> v, A arg)Accept method for visitor support.<A> voidaccept(VoidVisitor<A> v, A arg)Accept method for visitor support.MatchAllPatternExprasMatchAllPatternExpr()MatchAllPatternExprclone()MatchAllPatternExprMetaModelgetMetaModel()NodeList<Modifier>getModifiers()Return the modifiers of this variable declaration.voidifMatchAllPatternExpr(Consumer<MatchAllPatternExpr> action)booleanisFinal()booleanisMatchAllPatternExpr()booleanremove(Node node)booleanreplace(Node node, Node replacementNode)MatchAllPatternExprsetModifiers(NodeList<Modifier> modifiers)Optional<MatchAllPatternExpr>toMatchAllPatternExpr()-
Methods inherited from class com.github.javaparser.ast.expr.ComponentPatternExpr
asComponentPatternExpr, ifComponentPatternExpr, isComponentPatternExpr, toComponentPatternExpr
-
Methods inherited from class com.github.javaparser.ast.expr.Expression
appearsInAssignmentContext, appearsInInvocationContext, asAnnotationExpr, asArrayAccessExpr, asArrayCreationExpr, asArrayInitializerExpr, asAssignExpr, asBinaryExpr, asBooleanLiteralExpr, asCastExpr, asCharLiteralExpr, asClassExpr, asConditionalExpr, asDoubleLiteralExpr, asEnclosedExpr, asFieldAccessExpr, asInstanceOfExpr, asIntegerLiteralExpr, asLambdaExpr, asLiteralExpr, asLiteralStringValueExpr, asLongLiteralExpr, asMarkerAnnotationExpr, asMethodCallExpr, asMethodReferenceExpr, asNameExpr, asNormalAnnotationExpr, asNullLiteralExpr, asObjectCreationExpr, asPatternExpr, asRecordPatternExpr, asSingleMemberAnnotationExpr, asStringLiteralExpr, asSuperExpr, asSwitchExpr, asTextBlockLiteralExpr, asThisExpr, asTypeExpr, asTypePatternExpr, asUnaryExpr, asVariableDeclarationExpr, calculateResolvedType, elidesTypeArguments, ifAnnotationExpr, ifArrayAccessExpr, ifArrayCreationExpr, ifArrayInitializerExpr, ifAssignExpr, ifBinaryExpr, ifBooleanLiteralExpr, ifCastExpr, ifCharLiteralExpr, ifClassExpr, ifConditionalExpr, ifDoubleLiteralExpr, ifEnclosedExpr, ifFieldAccessExpr, ifInstanceOfExpr, ifIntegerLiteralExpr, ifLambdaExpr, ifLiteralExpr, ifLiteralStringValueExpr, ifLongLiteralExpr, ifMarkerAnnotationExpr, ifMethodCallExpr, ifMethodReferenceExpr, ifNameExpr, ifNormalAnnotationExpr, ifNullLiteralExpr, ifObjectCreationExpr, ifPatternExpr, ifRecordPatternExpr, ifSingleMemberAnnotationExpr, ifStringLiteralExpr, ifSuperExpr, ifSwitchExpr, ifTextBlockLiteralExpr, ifThisExpr, ifTypeExpr, ifTypePatternExpr, ifUnaryExpr, ifVariableDeclarationExpr, isAnnotationExpr, isArrayAccessExpr, isArrayCreationExpr, isArrayInitializerExpr, isAssignExpr, isAssignmentContext, isBinaryExpr, isBooleanLiteralExpr, isCastExpr, isCharLiteralExpr, isClassExpr, isConditionalExpr, isDoubleLiteralExpr, isEnclosedExpr, isFieldAccessExpr, isInstanceOfExpr, isIntegerLiteralExpr, isInvocationContext, isLambdaExpr, isLiteralExpr, isLiteralStringValueExpr, isLongLiteralExpr, isMarkerAnnotationExpr, isMethodCallExpr, isMethodReferenceExpr, isNameExpr, isNormalAnnotationExpr, isNullLiteralExpr, isObjectCreationExpr, isPatternExpr, isPolyExpression, isQualified, isRecordPatternExpr, isSingleMemberAnnotationExpr, isStandaloneExpression, isStringLiteralExpr, isSuperExpr, isSwitchExpr, isTextBlockLiteralExpr, isThisExpr, isTypeExpr, isTypePatternExpr, isUnaryExpr, isVariableDeclarationExpr, toAnnotationExpr, toArrayAccessExpr, toArrayCreationExpr, toArrayInitializerExpr, toAssignExpr, toBinaryExpr, toBooleanLiteralExpr, toCastExpr, toCharLiteralExpr, toClassExpr, toConditionalExpr, toDoubleLiteralExpr, toEnclosedExpr, toFieldAccessExpr, toInstanceOfExpr, toIntegerLiteralExpr, toLambdaExpr, toLiteralExpr, toLiteralStringValueExpr, toLongLiteralExpr, toMarkerAnnotationExpr, toMethodCallExpr, toMethodReferenceExpr, toNameExpr, toNormalAnnotationExpr, toNullLiteralExpr, toObjectCreationExpr, toPatternExpr, toRecordPatternExpr, toSingleMemberAnnotationExpr, toStringLiteralExpr, toSuperExpr, toSwitchExpr, toTextBlockLiteralExpr, toThisExpr, toTypeExpr, toTypePatternExpr, toUnaryExpr, toVariableDeclarationExpr
-
Methods inherited from class com.github.javaparser.ast.Node
addOrphanComment, containsData, createDefaultPrinter, createDefaultPrinter, customInitialization, equals, findAll, findAll, findAll, findByRange, findCompilationUnit, findData, 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, 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, findAncestor, hasParentNode, isDescendantOf
-
Methods inherited from interface com.github.javaparser.ast.nodeTypes.modifiers.NodeWithFinalModifier
setFinal
-
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithModifiers
addModifier, getAccessSpecifier, hasModifier, removeModifier, setModifier, setModifiers
-
Methods inherited from interface com.github.javaparser.ast.nodeTypes.NodeWithRange
containsWithin, containsWithinRange, getBegin, getEnd, hasRange
-
-
-
-
Field Detail
-
UNNAMED_PLACEHOLDER
public static final String UNNAMED_PLACEHOLDER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MatchAllPatternExpr
public MatchAllPatternExpr(TokenRange tokenRange, NodeList<Modifier> modifiers)
This constructor is used by the parser and is considered private.
-
-
Method Detail
-
isFinal
public boolean isFinal()
- Specified by:
isFinalin interfaceNodeWithFinalModifier<MatchAllPatternExpr>- Returns:
- true, if the modifier
finalis explicitly added to this node. If the node is implicitly final without an explicit modifier (e.g. records, and components of a record), this method should be overridden.
-
getModifiers
public NodeList<Modifier> getModifiers()
Description copied from interface:NodeWithModifiersReturn the modifiers of this variable declaration. Warning: modifying the returned set will not trigger observers, you have to use setModifiers for that.- Specified by:
getModifiersin interfaceNodeWithModifiers<MatchAllPatternExpr>- Returns:
- modifiers
- See Also:
Modifier
-
setModifiers
public MatchAllPatternExpr setModifiers(NodeList<Modifier> modifiers)
- Specified by:
setModifiersin interfaceNodeWithModifiers<MatchAllPatternExpr>
-
accept
public <R,A> R accept(GenericVisitor<R,A> v, A arg)
Description copied from interface:VisitableAccept method for visitor support.- Specified by:
acceptin interfaceVisitable- Type Parameters:
R- the type of the return value of the visitorA- the type the user argument passed to the visitor- Parameters:
v- the visitor implementationarg- the argument passed to the visitor (of type A)- Returns:
- the result of the visit (of type R)
-
accept
public <A> void accept(VoidVisitor<A> v, A arg)
Description copied from interface:VisitableAccept method for visitor support.
-
isMatchAllPatternExpr
public boolean isMatchAllPatternExpr()
- Overrides:
isMatchAllPatternExprin classExpression
-
asMatchAllPatternExpr
public MatchAllPatternExpr asMatchAllPatternExpr()
- Overrides:
asMatchAllPatternExprin classExpression
-
toMatchAllPatternExpr
public Optional<MatchAllPatternExpr> toMatchAllPatternExpr()
- Overrides:
toMatchAllPatternExprin classExpression
-
ifMatchAllPatternExpr
public void ifMatchAllPatternExpr(Consumer<MatchAllPatternExpr> action)
- Overrides:
ifMatchAllPatternExprin classExpression
-
clone
public MatchAllPatternExpr clone()
- Overrides:
clonein classComponentPatternExpr
-
getMetaModel
public MatchAllPatternExprMetaModel getMetaModel()
- Overrides:
getMetaModelin classComponentPatternExpr- Returns:
- get JavaParser specific node introspection information.
-
-