public class Injector extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Injector.Key
Key class for caches
|
| Constructor and Description |
|---|
Injector()
Default constructor
|
Injector(Injector i) |
| Modifier and Type | Method and Description |
|---|---|
Injector |
bind(Class<?> t,
Class<?> c,
Annotation... annotations)
Associate a key made of interface type and optional annotations with an implementation type
|
<T> Injector |
bindOneMore(Supplier<T> t,
Class<T> c,
Annotation... annotations)
Associate a key made of interface type and optional annotations with a supplier of instances,
adding to existing associations
|
<T> Injector |
bindOneMore(T t,
Class<T> c,
Annotation... annotations)
Associate a key made of interface type and optional annotations with an instance, adding to
existing associations
|
Injector |
bindToOne(Object t,
Class<?> c,
Annotation... annotations)
Associate a key made of interface type and optional annotations with an instance, replacing
existing associations
|
Injector |
bindToOne(Supplier<?> t,
Class<?> c,
Annotation... annotations)
Associate a key made of interface type and optional annotations with a supplier of instances,
replacing existing associations
|
<T> T |
getImplementation(Class<T> c,
Annotation... qualifiers) |
<T> T |
getImplementation(Class<T> c,
Map<Object,List<Supplier<?>>> overrides,
Annotation... qualifiers) |
<T> T |
getImplementation(Class<T> c,
OntologyConfigurator v,
Annotation... qualifiers) |
<T> T |
inject(T t) |
public Injector()
public Injector(Injector i)
i - injector to copypublic Injector bind(Class<?> t, Class<?> c, Annotation... annotations)
t - implementation typec - interface typeannotations - annotationspublic Injector bindToOne(Object t, Class<?> c, Annotation... annotations)
t - instancec - interface typeannotations - annotationspublic Injector bindToOne(Supplier<?> t, Class<?> c, Annotation... annotations)
t - supplierc - interface typeannotations - annotationspublic <T> Injector bindOneMore(T t, Class<T> c, Annotation... annotations)
T - typet - instancec - interface typeannotations - annotationspublic <T> Injector bindOneMore(Supplier<T> t, Class<T> c, Annotation... annotations)
T - typet - supplierc - interface typeannotations - annotationspublic <T> T inject(T t)
T - typet - object to injectpublic <T> T getImplementation(Class<T> c, Annotation... qualifiers)
T - typec - classqualifiers - optional annotationspublic <T> T getImplementation(Class<T> c, OntologyConfigurator v, Annotation... qualifiers)
T - typec - classv - configuration optionsqualifiers - optional annotationsCopyright © 2020 The University of Manchester. All rights reserved.