Constructor and Description |
---|
Builder()
Creates a new builder.
|
Builder(ClassLoader classLoader)
Creates a new builder using the specified ClassLoader for plugin loading.
|
Builder(Injector superInjector)
Creates a new builder with a parent injector.
|
Builder(Injector superInjector,
ClassLoader classLoader)
Creates a new builder with a parent injector and the specified ClassLoader for plugin loading.
|
Modifier and Type | Method and Description |
---|---|
<T> Injector.Builder |
bind(Class<T> type,
Class<? extends T> implementingClass)
Registers an implementing class for the given dependency type.
|
<T> Injector.Builder |
bind(Class<T> type,
T instance)
Registers an instance for the given dependency type.
|
<T> Injector.Builder |
bind(Injector.Key<T> key,
T instance)
Registers an instance for the given key.
|
<T> Injector.Builder |
bindDefault(Class<T> type,
Class<? extends T> defaultImplementingClass)
Registers a fallback implementing class for the given dependency type.
|
Injector |
build()
Builds an injector as previously configured.
|
public Builder()
Creates a new builder.
public Builder(ClassLoader classLoader)
Creates a new builder using the specified ClassLoader for plugin loading.
public Builder(Injector superInjector)
Creates a new builder with a parent injector.
public Builder(Injector superInjector, ClassLoader classLoader)
Creates a new builder with a parent injector and the specified ClassLoader for plugin loading.
public <T> Injector.Builder bind(@Nonnull Class<T> type, @Nonnull T instance)
Registers an instance for the given dependency type.
public <T> Injector.Builder bind(Injector.Key<T> key, @Nonnull T instance)
Registers an instance for the given key.
public <T> Injector.Builder bind(@Nonnull Class<T> type, @Nonnull Class<? extends T> implementingClass)
Registers an implementing class for the given dependency type.
public <T> Injector.Builder bindDefault(@Nonnull Class<T> type, @Nonnull Class<? extends T> defaultImplementingClass)
Registers a fallback implementing class for the given dependency type.
public Injector build()
Builds an injector as previously configured.