@Target(value=TYPE)
@Inherited
@Retention(value=RUNTIME)
public @interface FieldInvariant
The @FieldInvariant
annotation does not currently accommodate type qualifiers with
attributes, such as @MinLen(1)
. In this case, the type system should implement its own
field invariant annotation and override AnnotatedTypeFactory.getFieldInvariantDeclarationAnnotations()
and AnnotatedTypeFactory.getFieldInvariants(javax.lang.model.element.TypeElement)
.
See MinLenFieldInvariant
for example.
Modifier and Type | Required Element and Description |
---|---|
java.lang.String[] |
field
The field that has a more precise type, in the class on which the
FieldInvariant
annotation is written. |
java.lang.Class<? extends java.lang.annotation.Annotation>[] |
qualifier
The qualifier on the field.
|