| Constructor and Description |
|---|
InjectorBuilder()
Creates a new builder.
|
| Modifier and Type | Method and Description |
|---|---|
InjectorBuilder |
addDefaultHandlers(String rootPackage)
Convenience method for adding all default handlers to the injector configuration.
|
InjectorBuilder |
addHandlers(Collection<? extends Handler> handlers)
Add handlers to the config.
|
InjectorBuilder |
addHandlers(Handler... handlers)
Add handlers to the config.
|
Injector |
create()
Creates an injector with the configurations set to the builder.
|
static List<Handler> |
createDefaultHandlers(String rootPackage)
Returns all handlers that are added to the injector by default.
|
static List<Handler> |
createInstantiationProviders(String rootPackage)
Creates all default handlers implementing
Handler.resolve(ch.jalu.injector.context.ResolutionContext). |
public static List<Handler> createDefaultHandlers(String rootPackage)
rootPackage - the root package of the project (to limit injection and scanning to)addDefaultHandlers(String)public static List<Handler> createInstantiationProviders(String rootPackage)
Handler.resolve(ch.jalu.injector.context.ResolutionContext). Useful if you want to create your own
preconstruct (etc.) handlers but want to use the default instantiation providers.
Use createDefaultHandlers(String) or addDefaultHandlers(String) otherwise.
rootPackage - the root package of the projectpublic InjectorBuilder addDefaultHandlers(String rootPackage)
Injector injector = new InjectorBuilder().addDefaultHandlers("your.package.here").create();
rootPackage - the root package of the projectpublic InjectorBuilder addHandlers(Handler... handlers)
handlers - the handlers to add to the injectorpublic InjectorBuilder addHandlers(Collection<? extends Handler> handlers)
handlers - the handlers to add to the injectorpublic Injector create()
Copyright © 2017. All rights reserved.