1 /*
2  * Jakarta Bean Validation API
3  *
4  * License: Apache License, Version 2.0
5  * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
6  */

7 package javax.validation;
8
9 /**
10  * Defines the constraint target.
11  *
12  * @author Emmanuel Bernard
13  * @since 1.1
14  */

15 public enum ConstraintTarget {
16
17     /**
18      * Discover the type when no ambiguity is present
19      * <ul>
20      *     <li>if neither on a method nor a constructor, it implies the annotated element
21      *     (type, field etc),</li>
22      *     <li>if on a method or constructor with no parameter, it implies
23      *     {@code RETURN_VALUE},</li>
24      *     <li>if on a method with no return value ({@code void}), it implies
25      *     {@code PARAMETERS}.</li>
26      * </ul>
27      * Otherwise, {@code IMPLICIT} is not accepted and either {@code RETURN_VALUE} or
28      * {@code PARAMETERS} is required. This is the case for constructors with parameters
29      * and methods with parameters and return value.
30      */

31     IMPLICIT,
32
33     /**
34      * Constraint applies to the return value of a method or a constructor.
35      */

36     RETURN_VALUE,
37
38     /**
39      * Constraint applies to the parameters of a method or a constructor
40      */

41     PARAMETERS
42 }
43