All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.pmd.lang.java.ast.ASTGuard Maven / Gradle / Ivy

The newest version!
/*
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
 */

package net.sourceforge.pmd.lang.java.ast;

/**
 * A guard for refining a switch case in {@link ASTSwitchLabel}s.
 * This is a Java 21 language feature.
 *
 * 
 *
 * SwitchLabel := "case" {@linkplain ASTPattern Pattern} Guard?
 * Guard ::= "when" {@linkplain ASTExpression Expression}
 *
 * 
* * @see JEP 441: Pattern Matching for switch */ public final class ASTGuard extends AbstractJavaNode { ASTGuard(int id) { super(id); } @Override protected R acceptVisitor(JavaVisitor visitor, P data) { return visitor.visit(this, data); } public ASTExpression getGuard() { return (ASTExpression) getChild(0); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy