-
Notifications
You must be signed in to change notification settings - Fork 78
/
BeanInfo.java
59 lines (40 loc) · 1.76 KB
/
BeanInfo.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package jakarta.enterprise.inject.build.compatible.spi;
import jakarta.enterprise.lang.model.AnnotationInfo;
import jakarta.enterprise.lang.model.declarations.ClassInfo;
import jakarta.enterprise.lang.model.declarations.FieldInfo;
import jakarta.enterprise.lang.model.declarations.MethodInfo;
import jakarta.enterprise.lang.model.types.Type;
import java.util.Collection;
/**
* @param <T> type of the inspected bean (that is, not the declaring class, but one of the types the bean has)
*/
public interface BeanInfo<T> {
// TODO remove the type parameter?
ScopeInfo scope();
Collection<Type> types();
// TODO method(s) for getting AnnotationInfo for given qualifier class?
Collection<AnnotationInfo> qualifiers();
/**
* Returns the class that declares the bean.
* In case of a bean defined by a class, that is the bean class directly.
* In case of a producer method or field, that is the class that declares the producer method or field.
* TODO null for synthetic beans, or return Optional?
*
* @return {@link ClassInfo} for the class that declares the bean
*/
ClassInfo<?> declaringClass();
boolean isClassBean();
boolean isProducerMethod();
boolean isProducerField();
boolean isSynthetic();
MethodInfo<?> producerMethod(); // TODO null if not producer method, or return Optional?
FieldInfo<?> producerField(); // TODO null if not producer field, or return Optional?
boolean isAlternative();
int priority();
// EL name (from @Named), IIUC
String getName();
DisposerInfo disposer(); // TODO null if not producer method/field, or return Optional?
Collection<StereotypeInfo> stereotypes();
// TODO interceptors?
Collection<InjectionPointInfo> injectionPoints();
}