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

checker.src.org.checkerframework.checker.regex.qual.Regex Maven / Gradle / Ivy

Go to download

The Checker Framework enhances Java’s type system to make it more powerful and useful. This lets software developers detect and prevent errors in their Java programs. The Checker Framework includes compiler plug-ins ("checkers") that find bugs or verify their absence. It also permits you to write your own compiler plug-ins.

There is a newer version: 3.42.0
Show newest version
package org.checkerframework.checker.regex.qual;

import org.checkerframework.checker.regex.classic.qual.UnknownRegex;
import org.checkerframework.framework.qual.SubtypeOf;
import org.checkerframework.qualframework.poly.SimpleQualifierParameterAnnotationConverter;
import org.checkerframework.qualframework.poly.qual.Wildcard;

import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * If a type is annotated as {@code @Regex(n)}, then the run-time value is
 * a regular expression with n capturing groups.
 * 

* For example, if an expression's type is @Regex(2) String, then * at run time its value will be a legal regular expression with at least * two capturing groups. The type states that possible run-time values * include "(a*)(b*)", "a(b?)c(d?)e", and * "(.)(.)(.)", but not "hello" nor "(good)bye" * nor "(a*)(b*)(". */ //@ImplicitFor(trees = { Tree.Kind.NULL_LITERAL }) @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @Repeatable(MultiRegex.class) // Needed for classic checker @SubtypeOf(UnknownRegex.class) public @interface Regex { /** * The number of groups in the regular expression. * Defaults to 0. */ int value() default 0; /** * The name of the qualifier parameter to set. */ String param() default SimpleQualifierParameterAnnotationConverter.PRIMARY_TARGET; /** * Specify that this use is a wildcard with a bound. */ Wildcard wildcard() default Wildcard.NONE; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy