public abstract class AbstractConfigContext extends AbstractContext implements LenskitConfigContext
| Constructor and Description |
|---|
AbstractConfigContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
addComponent(Class<?> type)
Add a component type to the injector.
|
void |
addComponent(Object obj)
Add a component object to the injector.
|
<T> LenskitBinding<T> |
bind(Class<? extends Annotation> qual,
Class<T> type) |
<T> LenskitBinding<T> |
bindAny(Class<T> type) |
LenskitConfigContext |
in(Annotation qualifier,
Class<?> type)
Deprecated.
|
LenskitConfigContext |
in(Class<?> type)
Deprecated.
|
LenskitConfigContext |
in(Class<? extends Annotation> qualifier,
Class<?> type)
Deprecated.
|
Binding |
set(Class<? extends Annotation> param)
Start a binding that sets a parameter.
|
protected static LenskitConfigContext |
wrapContext(Context ctx)
Coerce a Grapht context to a LensKit context.
|
protected static LenskitConfigContext wrapContext(Context ctx)
ctx - The context.public <T> LenskitBinding<T> bind(Class<? extends Annotation> qual, Class<T> type)
bind in interface Contextbind in interface LenskitConfigContextbind in class AbstractContextpublic <T> LenskitBinding<T> bindAny(Class<T> type)
bindAny in interface ContextbindAny in interface LenskitConfigContextbindAny in class AbstractContextpublic Binding set(@Nonnull Class<? extends Annotation> param)
LenskitConfigContextParameter annotation.set in interface LenskitConfigContextparam - The parameter to set.public void addComponent(@Nonnull Object obj)
LenskitConfigContext
this.bind(obj.getClass()).to(obj);
It has the result of making obj available satisfy dependencies on its class or,
via supertype binding generation, any of its supertypes. Explicit bindings for those
supertypes will override this binding.
addComponent in interface LenskitConfigContextobj - The object to register.public void addComponent(@Nonnull Class<?> type)
LenskitConfigContext
this.bind(type).to(type);
It has the result of making type available satisfy dependencies on itself or,
via supertype binding generation, any of its supertypes. Explicit bindings for those
supertypes will override this binding.
addComponent in interface LenskitConfigContexttype - The type to register.@Deprecated public LenskitConfigContext in(Class<?> type)
in in interface Contextin in interface LenskitConfigContextin in class AbstractContext@Deprecated public LenskitConfigContext in(@Nullable Class<? extends Annotation> qualifier, Class<?> type)
in in interface Contextin in interface LenskitConfigContextin in class AbstractContext@Deprecated public LenskitConfigContext in(@Nullable Annotation qualifier, Class<?> type)
in in interface Contextin in interface LenskitConfigContextin in class AbstractContext