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

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

There is a newer version: 7.5.0
Show newest version
/**
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
 */

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

import net.sourceforge.pmd.annotation.InternalApi;

/**
 * Represents a type bound on a wildcard {@linkplain ASTTypeArgument type argument}.
 *
 * 
 *
 * WildcardBounds ::=  ( "extends" | "super" ) ( {@linkplain ASTAnnotation Annotation} )* {@linkplain ASTReferenceType ReferenceType}
 *
 * 
*/ public class ASTWildcardBounds extends AbstractJavaTypeNode { @InternalApi @Deprecated public ASTWildcardBounds(int id) { super(id); } @InternalApi @Deprecated public ASTWildcardBounds(JavaParser p, int id) { super(p, id); } /** * Returns true if this is an upper type bound, e.g. * in {@code }. */ public boolean isUpperBound() { return "extends".equals(jjtGetFirstToken().toString()); } /** * Returns true if this is a lower type bound, e.g. * in {@code }. */ public boolean isLowerBound() { return !isUpperBound(); } /** * Returns the type node representing the bound, e.g. * the {@code Node} in {@code }. */ public ASTReferenceType getTypeBoundNode() { return getFirstChildOfType(ASTReferenceType.class); } @Override public Object jjtAccept(JavaParserVisitor visitor, Object data) { return visitor.visit(this, data); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy