@Documented @Retention(value=CLASS) @Target(value={METHOD,FIELD,PARAMETER,LOCAL_VARIABLE,ANNOTATION_TYPE}) public @interface Pattern
This annotation also could be used as a meta-annotation, to define other annotations for convenience. E.g. the following annotation could be defined to annotate the strings that represent UUIDs:
@Pattern("[\\dA-Fa-f]{8}-[\\dA-Fa-f]{4}-[\\dA-Fa-f]{4}-[\\dA-Fa-f]{4}-[\\dA-Fa-f]{12}") @interface UUID {}
Note that using the derived annotation as meta-annotation is not supported. Meta-annotation works only one level deep.
RegExp
Modifier and Type | Required Element and Description |
---|---|
@NonNls String |
value
A regular expression that matches all the valid string literals that assigned to the annotated variables,
passed as arguments to the annotated parameters, or returned from the annotated methods.
|
Copyright © 2024. All rights reserved.