scan abstract method

Future<void> scan(
  1. List<String> basePackages
)

Scans the given base packages for annotated components

Parameters

  • basePackages: List of package names to scan. Only classes in these packages will be considered for registration.

Behavior

  • Recursively inspects subpackages of each base package.
  • Filters classes according to annotations recognized by the application context (e.g., @Component, @Service).
  • Does not automatically register the classes; scanning is for discovery.

Example

registry.scan(['com.example.service', 'com.example.repository']);

Notes

  • Implementations may cache scan results for performance.
  • Can be called multiple times to scan additional packages.

Implementation

Future<void> scan(List<String> basePackages);