@Documented @Retention(value=RUNTIME) @Target(value=ANNOTATION_TYPE) public @interface QualifierForLiterals
@QualifierForLiterals
is equivalent to @QualfierForLiterals(LiteralKind.ALL)
Modifier and Type | Optional Element and Description |
---|---|
String[] |
stringPatterns
A string literal that matches any of these patterns has this qualifier.
|
LiteralKind[] |
value
The kinds of literals whose types have this qualifier.
|
public abstract LiteralKind[] value
@MyAnno
is
meta-annotated with @QualifierForLiterals(LiteralKind.STRING)
, then a literal String
constant such as "hello world"
has type @MyAnno String
, but occurrences
of String
in the source code are not affected.
For String literals, also see the stringPatterns()
annotation element/field.
public abstract String[] stringPatterns
If patterns for multiple qualifiers match, then the string literal is given the greatest lower bound of all the matches.