public abstract class AbstractContainerMethodSupport extends Object
Container instances from method which annotated by ContainerMethod.ContainerMethodAnnotationProcessor| 限定符和类型 | 字段和说明 |
|---|---|
protected List<MethodContainerFactory> |
methodContainerFactories
method container factories
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractContainerMethodSupport(Collection<MethodContainerFactory> methodContainerFactories)
Create a
AbstractContainerMethodSupport instance. |
| 限定符和类型 | 方法和说明 |
|---|---|
protected Collection<Container<Object>> |
createMethodContainer(@Nullable Object bean,
Method method,
Collection<ContainerMethod> annotations)
Create container instance with given bean and method by specific
MethodContainerFactory. |
protected @Nullable Method |
findMatchedMethodForAnnotation(List<Method> methods,
ContainerMethod annotation)
Find the most matched method by given annotation in the method group,
the method with the most matched parameter types will be returned.
|
protected @Nullable Method |
findMostMatchMethod(@NonNull List<Method> candidates,
@NonNull Class<?>[] expectedTypes)
Find the most matched method by given method name and param types,
the method with the most matched parameter types will be returned.
|
void |
registerMethodContainerFactory(@NonNull MethodContainerFactory methodContainerFactory)
Register
MethodContainerFactory instance. |
protected final List<MethodContainerFactory> methodContainerFactories
protected AbstractContainerMethodSupport(Collection<MethodContainerFactory> methodContainerFactories)
AbstractContainerMethodSupport instance.methodContainerFactories - method container factoriespublic void registerMethodContainerFactory(@NonNull MethodContainerFactory methodContainerFactory)
MethodContainerFactory instance.methodContainerFactory - method container factoryprotected Collection<Container<Object>> createMethodContainer(@Nullable Object bean, Method method, Collection<ContainerMethod> annotations)
MethodContainerFactory.bean - beanmethod - methodannotations - annotationsprotected @Nullable Method findMatchedMethodForAnnotation(List<Method> methods, ContainerMethod annotation)
Find the most matched method by given annotation in the method group,
the method with the most matched parameter types will be returned.
methods - methodsannotation - annotationprotected @Nullable Method findMostMatchMethod(@NonNull List<Method> candidates, @NonNull Class<?>[] expectedTypes)
Find the most matched method by given method name and param types,
the method with the most matched parameter types will be returned.
If there are multiple methods with the same number of matched parameter types or no matched method,
the first one will be returned.
candidates - methods which have the same name, list size must be greater than 0expectedTypes - param typesCopyright © 2024. All rights reserved.