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

org.checkerframework.framework.qual.QualifierForLiterals 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-eisop4
Show newest version
package org.checkerframework.framework.qual;

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

/**
 * A meta-annotation that indicates what qualifier should be given to literals.
 * {@code @QualifierForLiterals} (without any annotation elements) is equivalent to
 * {@code @QualifierForLiterals(LiteralKind.ALL)}
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface QualifierForLiterals {
    /**
     * The kinds of literals whose types have this qualifier. For example, if {@code @MyAnno} is
     * meta-annotated with {@code @QualifierForLiterals(LiteralKind.STRING)}, then a literal {@code
     * String} constant such as {@code "hello world"} has type {@code @MyAnno String}, but
     * occurrences of {@code String} in the source code are not affected.
     *
     * 

For String literals, also see the {@link #stringPatterns} annotation element/field. */ LiteralKind[] value() default {}; /** * A string literal that matches any of these patterns has this qualifier. * *

If patterns for multiple qualifiers match, then the string literal is given the greatest * lower bound of all the matches. */ String[] stringPatterns() default {}; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy