klyn.di.DIContext.DIContext
constructor
public DIContext(packages as IList<String>):
Description

Creates a dependency injection context restricted to selected packages.

Components outside the configured packages are ignored by scanAnnotations().

Parameters
ParameterDescription
packagesPackage roots scanned for @Component and @Service annotations.
Throws
  • ValueException if a package name is null or empty.
Example
import klyn.di

context = DIContext(packages=["application.services"])
context.scanAnnotations()