类 AdviceModeImportSelector<A extends Annotation>
java.lang.Object
cn.taketoday.context.annotation.AdviceModeImportSelector<A>
- 类型参数:
A- annotation containing AdviceMode attribute
- 所有已实现的接口:
ImportSelector
public abstract class AdviceModeImportSelector<A extends Annotation>
extends Object
implements ImportSelector
Convenient base class for
ImportSelector implementations that select imports
based on an AdviceMode value from an annotation (such as the @Enable*
annotations).- 从以下版本开始:
- 4.0
- 作者:
- Chris Beams
-
字段概要
字段从接口继承的字段 cn.taketoday.context.loader.ImportSelector
NO_IMPORTS -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected StringThe name of theAdviceModeattribute for the annotation specified by the generic typeA.protected abstract String[]selectImports(AdviceMode adviceMode) Determine which classes should be imported based on the givenAdviceMode.final String[]selectImports(cn.taketoday.core.type.AnnotationMetadata importingClassMetadata) This implementation resolves the type of annotation from generic metadata and validates that (a) the annotation is in fact present on the importing@Configurationclass and (b) that the given annotation has an advice mode attribute of typeAdviceMode.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.context.loader.ImportSelector
getExclusionFilter
-
字段详细资料
-
DEFAULT_ADVICE_MODE_ATTRIBUTE_NAME
The default advice mode attribute name.- 另请参阅:
-
-
构造器详细资料
-
AdviceModeImportSelector
public AdviceModeImportSelector()
-
-
方法详细资料
-
getAdviceModeAttributeName
The name of theAdviceModeattribute for the annotation specified by the generic typeA. The default is "mode", but subclasses may override in order to customize. -
selectImports
public final String[] selectImports(cn.taketoday.core.type.AnnotationMetadata importingClassMetadata) This implementation resolves the type of annotation from generic metadata and validates that (a) the annotation is in fact present on the importing@Configurationclass and (b) that the given annotation has an advice mode attribute of typeAdviceMode.The
selectImports(AdviceMode)method is then invoked, allowing the concrete implementation to choose imports in a safe and convenient fashion.- 指定者:
selectImports在接口中ImportSelector- 返回:
- the class names, or an empty array if none
- 抛出:
IllegalArgumentException- if expected annotationAis not present on the importing@Configurationclass or ifselectImports(AdviceMode)returnsnull
-
selectImports
Determine which classes should be imported based on the givenAdviceMode.Returning
nullfrom this method indicates that theAdviceModecould not be handled or was unknown and that anIllegalArgumentExceptionshould be thrown.- 参数:
adviceMode- the value of the advice mode attribute for the annotation specified via generics.- 返回:
- array containing classes to import (empty array if none;
nullif the givenAdviceModeis unknown)
-