S - The type for the scope class for this context.public interface IocContext<S extends Scope>
An implementation of this interface can be obtained via the Ioc interface or
by injecting Inject it in any component
you want.
| Modifier and Type | Method and Description |
|---|---|
<T extends Scope> |
createChild(T scope)
Create a child IocContext of this context.
|
boolean |
exists(Type service)
This method finds if a service is provided by a least one component in
the context.
|
boolean |
existsComponent(Class component)
This method finds if the given class is a component of the context.
|
<T> T |
find(Class<T> service)
This method finds the highest priority component that provides the given
service.
|
<T> T[] |
findAll(Class<T> service)
This method finds all the components that provides the given service.
|
Object |
findGeneric(Type service)
This method finds the highest priority component that provides the given
generic service.
|
<T> T |
findNext(Class<T> service,
int priority)
This method finds the component that provides the given service with less
priority than the priority parameter.
|
Object |
findNextGeneric(Type service,
int priority)
This method finds the component that provides the given generic service
with less priority than the priority parameter.
|
ClassRepository |
getClassRepository()
Obtains the class repository associated with this context. that allows to
find classes, fields and methods of the components in this context.
|
IocContext<?> |
getParent()
The parent of this context.
|
S |
getScope()
Gets the scope of the current context.
|
Class<S> |
getScopeClass()
Gets the scope of the current context.
|
void |
printPriorities(Class<?> service,
PrintWriter writer)
Prints all the implementations of the services with its priorities.
|
S getScope()
Class<S> getScopeClass()
<T> T find(Class<T> service)
T - The generic type of the class of the service that this method
should find.service - The class that represents the service that this method
must find.
<T> T findNext(Class<T> service, int priority)
T - The generic type of the class of the service that this method
should find.service - The class that represents the service that this method
must find.
priority - The given component must have a priority value greater
than this parameter.
<T> T[] findAll(Class<T> service)
T - The generic type of the class of the service that this method
should find.service - The class that represents the service that this method
must find.
Object findGeneric(Type service)
service - The Type that represents the
service that this method must find.
Object findNextGeneric(Type service, int priority)
service - The Type that represents the
service that this method must find.
priority - The given component must have a priority value greater
than this parameter.
boolean exists(Type service)
service - The type of the service to look for.
boolean existsComponent(Class component)
component - The class of the component to look for.
IocContext<?> getParent()
<T extends Scope> IocContext<T> createChild(T scope)
T - The type of the scope.scope - The scope of the new context.ClassRepository getClassRepository()
void printPriorities(Class<?> service, PrintWriter writer)
service - The service to lookup.writer - The writer to print the result.Copyright © 2015–2019 Bridje Framework. All rights reserved.