# registerAnnotationConfigProcessors method

1. @protected

Future<void> registerAnnotationConfigProcessors([

1. Object? source

])

Registers the internal annotation configuration processors.

This method ensures that all necessary annotation processors are registered with the pod factory. These processors handle various annotations during the pod factory's post-processing phase.

Processors registered:

- `ConfigurationClassPostProcessor` - Handles `@Configuration` classes
- `CommonAnnotationPodProcessor` - Handles common annotations
- `AutowiredAnnotationPodProcessor` - Handles `@Autowired` injection
- `EventListenerMethodProcessor` - Handles `@EventListener` methods
- `ApplicationModuleProcessor` - Handles application modules

All processors are registered with DesignRole.INFRASTRUCTURE to indicate they are framework infrastructure components.

`source` optional source object for the processor definitions

Example:

    await context.registerAnnotationConfigProcessors();

See also:

- CONFIGURATION_ANNOTATION_PROCESSOR_POD_NAME
- AUTOWIRED_ANNOTATION_PROCESSOR_POD_NAME
- COMMON_ANNOTATION_PROCESSOR_POD_NAME
- EVENT_LISTENER_METHOD_PROCESSOR_POD_NAME
- APPLICATION_MODULE_PROCESSOR_POD_NAME

## Implementation

    @protected
    Future<void> registerAnnotationConfigProcessors([Object? source]) async {
      if (!containsDefinition(CONFIGURATION_ANNOTATION_PROCESSOR_POD_NAME)) {
        RootPodDefinition def = RootPodDefinition(type: Class<ConfigurationClassPostProcessor>(null, PackageNames.CORE));
        def.instance = source;
        def.design.role = DesignRole.INFRASTRUCTURE;
        await registerDefinition(CONFIGURATION_ANNOTATION_PROCESSOR_POD_NAME, def);
      }

      if (!containsDefinition(COMMON_ANNOTATION_PROCESSOR_POD_NAME)) {
        RootPodDefinition def = RootPodDefinition(type: Class<CommonAnnotationPodProcessor>(null, PackageNames.CORE));
        def.instance = source;
        def.design.role = DesignRole.INFRASTRUCTURE;
        await registerDefinition(COMMON_ANNOTATION_PROCESSOR_POD_NAME, def);
      }

      if (!containsDefinition(AUTOWIRED_ANNOTATION_PROCESSOR_POD_NAME)) {
        RootPodDefinition def = RootPodDefinition(type: Class<AutowiredAnnotationPodProcessor>(null, PackageNames.CORE));
        def.instance = source;
        def.design.role = DesignRole.INFRASTRUCTURE;
        await registerDefinition(AUTOWIRED_ANNOTATION_PROCESSOR_POD_NAME, def);
      }

      if (!containsDefinition(EVENT_LISTENER_METHOD_PROCESSOR_POD_NAME)) {
        RootPodDefinition def = RootPodDefinition(type: Class<EventListenerMethodProcessor>(null, PackageNames.CORE));
        def.instance = source;
        def.design.role = DesignRole.INFRASTRUCTURE;
        await registerDefinition(EVENT_LISTENER_METHOD_PROCESSOR_POD_NAME, def);
      }

      if (!containsDefinition(APPLICATION_MODULE_PROCESSOR_POD_NAME)) {
        RootPodDefinition def = RootPodDefinition(type: Class<ApplicationModuleProcessor>(null, PackageNames.CORE));
        def.instance = source;
        def.design.role = DesignRole.INFRASTRUCTURE;
        await registerDefinition(APPLICATION_MODULE_PROCESSOR_POD_NAME, def);
      }

      return Future.value();
    }