class Graph
The object graph class that retrieves and instantiates dependencies registered in its component.
An instance is created by calling Component.createGraph, Graph.createSubgraph or Graph.openSubgraph.
val application: WinterApplication
The WinterApplication of this graph. |
|
val component: Component
The Component instance. |
|
val isClosed: Boolean
Indicates if the graph is closed. |
|
val parent: Graph?
The parent Graph instance or null if no parent exists. |
fun close(): Unit
Runs graph close plugins and marks this graph as closed. All resources get released and every retrieval method will throw an exception if called after closing. |
|
fun closeSubgraph(identifier: Any): Unit
Close a subgraph and remove it from the registry. |
|
fun closeSubgraphIfOpen(identifier: Any): Unit
Close a subgraph and remove it from the registry if it is open. |
|
fun createSubgraph(subcomponentQualifier: Any, block: ComponentBuilderBlock? = null): Graph
Initialize and return a subgraph by using the subcomponent with subcomponentQualifier and this graph as parent. |
|
fun <R : Any> evaluate(service: BoundService<R>): R
This is called from BoundService.instance when a new instance is created. Don't use this method except in custom BoundService implementations. |
|
fun getOrOpenSubgraph(subcomponentQualifier: Any, identifier: Any? = null, block: ComponentBuilderBlock? = null): Graph
Get a subgraph by identifier if present or open and return it. |
|
fun getSubgraph(identifier: Any): Graph
Get a subgraph by identifier. |
|
fun getSubgraphOrNull(identifier: Any): Graph?
Get an optional subgraph by identifier. |
|
fun <T : Any> inject(instance: T): T
Inject members of class T. |
|
fun <R : Any> instance(qualifier: Any? = null, generics: Boolean = false): R
Retrieve a non-optional instance of |
|
fun <R : Any> instanceByKey(key: TypeKey<R>): R
Retrieve a non-optional instance of |
|
fun <R : Any> instanceOrNull(qualifier: Any? = null, generics: Boolean = false): R?
Retrieve an optional instance of |
|
fun <R : Any> instanceOrNullByKey(key: TypeKey<R>): R?
Retrieve an optional instance of |
|
fun keys(): Set<TypeKey<*>>
Returns a set of all keys registered on the backing Component and all the ancestor components. |
|
fun openSubgraph(subcomponentQualifier: Any, identifier: Any? = null, block: ComponentBuilderBlock? = null): Graph
Initialize and return a subgraph by using the subcomponent with subcomponentQualifier and this graph as parent and register it under the subcomponentQualifier or when given under identifier. |
|
fun <R : Any> provider(qualifier: Any? = null, generics: Boolean = false): Provider<R>
Retrieves a non-optional provider function that returns |
|
fun <R : Any> providerByKey(key: TypeKey<R>): Provider<R>
Retrieves a non-optional provider function by key that returns |
|
fun <R : Any> providerOrNull(qualifier: Any? = null, generics: Boolean = false): Provider<R>?
Retrieve an optional provider function that returns |
|
fun <R : Any> providerOrNullByKey(key: TypeKey<R>): Provider<R>?
Retrieve an optional provider function by key that returns |