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.executable;
8
9 /**
10 * Defines the types of executables targeted by an operation.
11 *
12 * @author Emmanuel Bernard
13 * @since 1.1
14 */
15 public enum ExecutableType {
16
17 /**
18 * If the annotation using {@code ExecutableType} is on a type (class or interface),
19 * the behavior is equivalent to the annotation not being present.
20 * <p>
21 * If on a constructor, it is equivalent to {@link #CONSTRUCTORS}.
22 * <p>
23 * If on a non-getter method, it is equivalent to {@link #NON_GETTER_METHODS}.
24 * <p>
25 * If on a getter method, it is equivalent to {@link #GETTER_METHODS}.
26 */
27 IMPLICIT,
28
29 /**
30 * None of the executables.
31 * <p>
32 * Note that this option is equivalent to an empty list of executable types
33 * and is present to improve readability. If {@code NONE} and other types of executables
34 * are present in a list, {@code NONE} is ignored.
35 */
36 NONE,
37
38 /**
39 * All constructors.
40 */
41 CONSTRUCTORS,
42
43 /**
44 * All methods except the ones following the getter pattern. A getter according to the
45 * JavaBeans specification is a method whose:
46 * <ul>
47 * <li>name starts with get, has a return type but no parameter</li>
48 * <li>name starts with is, has a return type and is returning {@code boolean}.</li>
49 * </ul>
50 */
51 NON_GETTER_METHODS,
52
53 /**
54 * All methods following the getter pattern. A getter according to the
55 * JavaBeans specification is a method whose:
56 * <ul>
57 * <li>name starts with get, has a return type but no parameter</li>
58 * <li>name starts with is, has a return type and is returning {@code boolean}.</li>
59 * </ul>
60 */
61 GETTER_METHODS,
62
63 /**
64 * All executables (constructors and methods).
65 */
66 ALL
67 }
68