Debian Codegraph @

api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/Messages.java

raw
1 /*
2 * Copyright (c) 2021 Red Hat and others
3 *
4 * This program and the accompanying materials are made available under the
5 * Apache Software License 2.0 which is available at:
6 * https://www.apache.org/licenses/LICENSE-2.0.
7 *
8 * SPDX-License-Identifier: Apache-2.0
9 */
10
11 package jakarta.enterprise.inject.build.compatible.spi;
12
13 import jakarta.enterprise.lang.model.AnnotationTarget;
14
15 /**
16 * Allows logging and producing errors during {@linkplain BuildCompatibleExtension build compatible extension}
17 * execution. If an error is produced, using any of the {@code error} methods, the container treats it
18 * as a deployment problem.
19 *
20 * @since 4.0
21 */
22 public interface Messages {
23 /**
24 * Add a generic information message that is not related to any particular element, or that information is not known.
25 *
26 * @param message information message
27 */
28 void info(String message);
29
30 /**
31 * Add an information message which is related to given {@link AnnotationTarget} (which is most likely
32 * a {@link jakarta.enterprise.lang.model.declarations.DeclarationInfo DeclarationInfo}).
33 *
34 * @param message information message
35 * @param relatedTo annotation target to which the message is related
36 */
37 void info(String message, AnnotationTarget relatedTo);
38
39 /**
40 * Add an information message which is related to given {@link BeanInfo}.
41 *
42 * @param message information message
43 * @param relatedTo bean to which the message is related
44 */
45 void info(String message, BeanInfo relatedTo);
46
47 /**
48 * Add an information message which is related to given {@link ObserverInfo}.
49 *
50 * @param message information message
51 * @param relatedTo observer to which the message is related
52 */
53 void info(String message, ObserverInfo relatedTo);
54
55 /**
56 * Add a generic warning that is not related to any particular element, or that information is not known.
57 *
58 * @param message warning message
59 */
60 void warn(String message);
61
62 /**
63 * Add a warning which is related to given {@link AnnotationTarget} (which is most likely
64 * a {@link jakarta.enterprise.lang.model.declarations.DeclarationInfo DeclarationInfo}).
65 *
66 * @param message warning message
67 * @param relatedTo annotation target to which the message is related
68 */
69 void warn(String message, AnnotationTarget relatedTo);
70
71 /**
72 * Add a warning which is related to given {@link BeanInfo}.
73 *
74 * @param message warning message
75 * @param relatedTo bean to which the message is related
76 */
77 void warn(String message, BeanInfo relatedTo);
78
79 /**
80 * Add a warning which is related to given {@link ObserverInfo}.
81 *
82 * @param message warning message
83 * @param relatedTo observer to which the message is related
84 */
85 void warn(String message, ObserverInfo relatedTo);
86
87 /**
88 * Add a generic error that is not related to any particular element, or that information is not known.
89 *
90 * @param message error message
91 */
92 void error(String message);
93
94 /**
95 * Add an error which is related to given {@link AnnotationTarget} (which is most likely
96 * a {@link jakarta.enterprise.lang.model.declarations.DeclarationInfo DeclarationInfo}).
97 *
98 * @param message error message
99 * @param relatedTo annotation target to which the message is related
100 */
101 void error(String message, AnnotationTarget relatedTo);
102
103 /**
104 * Add an error which is related to given {@link BeanInfo}.
105 *
106 * @param message error message
107 * @param relatedTo bean to which the message is related
108 */
109 void error(String message, BeanInfo relatedTo);
110
111 /**
112 * Add an error which is related to given {@link ObserverInfo}.
113 *
114 * @param message error message
115 * @param relatedTo observer to which the message is related
116 */
117 void error(String message, ObserverInfo relatedTo);
118
119 /**
120 * Add a generic error that is represented by an exception.
121 *
122 * @param exception error, represented by an exception
123 */
124 void error(Exception exception);
125 }