A- annotation containing AdviceMode attribute
public abstract class AdviceModeImportSelector<A extends Annotation> extends Object implements ImportSelector
ImportSelectorimplementations that select imports based on an
AdviceModevalue from an annotation (such as the
|Modifier and Type||Field and Description|
The default advice mode attribute name.
|Constructor and Description|
|Modifier and Type||Method and Description|
The name of the
Determine which classes should be imported based on the given
This implementation resolves the type of annotation from generic metadata and validates that (a) the annotation is in fact present on the importing
public static final String DEFAULT_ADVICE_MODE_ATTRIBUTE_NAME
protected String getAdviceModeAttributeName()
AdviceModeattribute for the annotation specified by the generic type
A. The default is "mode", but subclasses may override in order to customize.
public final String selectImports(AnnotationMetadata importingClassMetadata)
@Configurationclass and (b) that the given annotation has an advice mode attribute of type
selectImports(AdviceMode) method is then invoked, allowing the
concrete implementation to choose imports in a safe and convenient fashion.
IllegalArgumentException- if expected annotation
Ais not present on the importing
@Configurationclass or if
@Nullable protected abstract String selectImports(AdviceMode adviceMode)
null from this method indicates that the
could not be handled or was unknown and that an
should be thrown.
adviceMode- the value of the advice mode attribute for the annotation specified via generics.
nullif the given