Annotation Interface ConditionalOnMissingBroadleafModule


@Target({TYPE,METHOD}) @Retention(RUNTIME) @Documented @Conditional(OnMissingBroadleafModuleCondition.class) public @interface ConditionalOnMissingBroadleafModule

Allows for conditional registration of beans depending only if a particular Broadleaf module is absent. By default, this checks for the absence of an implementation entry for a BroadleafModuleRegistration in spring.factories.

There are 2 options for checking these registrations:

  1. The type-safe value() which assumes that this class is kept up to date with different modules that are added
  2. The moduleName() which maps directly to the BroadleafModuleRegistration.getModuleName()

Generally you should use the value() attribute to give you a type-safe way to reference the registrations but it is possible that you need to reference a module that has not yet been added to this class. In that case, use the moduleName() parameter which allows for more dynamic checking of module names.

If the module has not registered itself via spring.factories then this will always return true.

This annotation can be used as a composed meta-annotation for module-specific annotations. Example:

 @Target({ ElementType.TYPE, ElementType.METHOD })
 @Retention(RetentionPolicy.RUNTIME)
 @Documented
 @ConditionalOnMissingBroadleafModule(BroadleafModuleEnum.ACCOUNT)
 public @interface ConditionalOnAccountModule {

 }
 
Since:
5.2
Author:
Brandon Hines