public abstract class AbstractInternalProviderAssembleAnnotationHandler<A extends Annotation> extends AbstractStandardAssembleAnnotationHandler<A>
一个基于AbstractStandardAssembleAnnotationHandler的扩展实现,
用于支持在处理操作注解时,一并为其创建并注册对应的容器。
该注解处理器在内部维护了一个ContainerProvider实例,
当从操作注解中解析出容器的命名空间时,会尝试根据规则创建一个容器实例,并存储在内部的提供者中。
该内部提供者在处理器实例创建时会注册到全局容器管理器中。
通常情况下,该提供者可以在ContainerManager根据名称{处理器的简单类名}.InternalProvider进行访问,
但不建议在处理器外部操作它。
An implementation of AbstractStandardAssembleAnnotationHandler that
creates corresponding containers while processing operation annotations.
The annotation handler maintains a ContainerProvider instance internally,
and when the container's namespace is resolved from the operation annotation,
it will try to create a container instance for it
according to the rules and store it in the internal provider.
The internal provider registers with
the global container manager when the handler instance is created.
the provider is usually accessible by the name {simple class name of handler}.InternalProvider,
but it is not recommended to operate on it outside the handler.
ConfigurableContainerProviderAbstractStandardAssembleAnnotationHandler.StandardAssembleAnnotation<A extends Annotation>, AbstractStandardAssembleAnnotationHandler.StandardAssembleAnnotationAdapter<A extends Annotation>AbstractStandardOperationAnnotationHandler.StandardAnnotation<A>, AbstractStandardOperationAnnotationHandler.StandardAnnotationAdapter<A extends Annotation>| 限定符和类型 | 字段和说明 |
|---|---|
static String |
INTERNAL_PROVIDER_SUFFIX |
protected ConfigurableContainerProvider |
internalContainerProvider
Internal container provider.
|
globalConfigurationannotationFinder, annotationType, operationComparator| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractInternalProviderAssembleAnnotationHandler(Class<A> annotationType,
AnnotationFinder annotationFinder,
@NonNull Comparator<KeyTriggerOperation> operationComparator,
Crane4jGlobalConfiguration globalConfiguration,
PropertyMappingStrategyManager propertyMappingStrategyManager)
Create an
AbstractStandardAssembleAnnotationHandler instance. |
| 限定符和类型 | 方法和说明 |
|---|---|
protected abstract @NonNull Container<Object> |
createContainer(AbstractStandardAssembleAnnotationHandler.StandardAssembleAnnotation<A> standardAnnotation,
String namespace)
Create container by given annotation and namespace.
|
protected @NonNull ConfigurableContainerProvider |
createInternalContainerProvider()
Create internal container provider.
|
protected abstract String |
determineNamespace(AbstractStandardAssembleAnnotationHandler.StandardAssembleAnnotation<A> standardAnnotation)
Determine namespace by given annotation.
|
protected String |
getContainerNamespace(AbstractStandardAssembleAnnotationHandler.StandardAssembleAnnotation<A> standardAnnotation)
Get container from given
annotation. |
String |
getInternalContainerProviderName()
Get the name of internal container provider.
|
createOperation, determineKeyResolver, doResolve, getStandardAnnotation, parseAssembleOperationHandler, parseKeyType, parsePropertyMappings, parsePropToMapping, parserPropertyMappingStrategyparseAnnotationForClass, parseAnnotationForElement, parseAnnotationForFields, parseAnnotationForMethods, parseGroups, parseId, parseKey, parseSort, resolveprotected final ConfigurableContainerProvider internalContainerProvider
protected AbstractInternalProviderAssembleAnnotationHandler(Class<A> annotationType, AnnotationFinder annotationFinder, @NonNull Comparator<KeyTriggerOperation> operationComparator, Crane4jGlobalConfiguration globalConfiguration, PropertyMappingStrategyManager propertyMappingStrategyManager)
AbstractStandardAssembleAnnotationHandler instance.annotationType - annotation typeannotationFinder - annotation finderoperationComparator - operation comparatorglobalConfiguration - global configurationpropertyMappingStrategyManager - property mapping strategy managerprotected String getContainerNamespace(AbstractStandardAssembleAnnotationHandler.StandardAssembleAnnotation<A> standardAnnotation)
annotation.getContainerNamespace 在类中 AbstractStandardAssembleAnnotationHandler<A extends Annotation>standardAnnotation - standard annotationContainerContainerManager.canonicalNamespace(java.lang.String, java.lang.String)protected abstract @NonNull Container<Object> createContainer(AbstractStandardAssembleAnnotationHandler.StandardAssembleAnnotation<A> standardAnnotation, String namespace)
standardAnnotation - standard annotationnamespace - namespaceContainer instantprotected abstract String determineNamespace(AbstractStandardAssembleAnnotationHandler.StandardAssembleAnnotation<A> standardAnnotation)
standardAnnotation - standard annotationprotected @NonNull ConfigurableContainerProvider createInternalContainerProvider()
ContainerProvider instantpublic String getInternalContainerProviderName()
Copyright © 2024. All rights reserved.