spring-framework / org.springframework.context.annotation / AdviceModeImportSelector

AdviceModeImportSelector

abstract class AdviceModeImportSelector<A : Annotation> : ImportSelector

Convenient base class for ImportSelector implementations that select imports based on an AdviceMode value from an annotation (such as the @Enable* annotations).

Parameters

- annotation containing AdviceMode attribute

Author
Chris Beams

Since
3.1

Constructors

<init>

AdviceModeImportSelector()

Convenient base class for ImportSelector implementations that select imports based on an AdviceMode value from an annotation (such as the @Enable* annotations).

Properties

DEFAULT_ADVICE_MODE_ATTRIBUTE_NAME

static val DEFAULT_ADVICE_MODE_ATTRIBUTE_NAME: String

Functions

selectImports

fun selectImports(importingClassMetadata: AnnotationMetadata): Array<String>

This implementation resolves the type of annotation from generic metadata and validates that (a) the annotation is in fact present on the importing @Configuration class and (b) that the given annotation has an advice mode attribute of type AdviceMode.

The #selectImports(AdviceMode) method is then invoked, allowing the concrete implementation to choose imports in a safe and convenient fashion.

Inheritors

CachingConfigurationSelector

open class CachingConfigurationSelector : AdviceModeImportSelector<EnableCaching>

Selects which implementation of AbstractCachingConfiguration should be used based on the value of EnableCaching#mode on the importing @Configuration class.

Detects the presence of JSR-107 and enables JCache support accordingly.