Package com.vaadin.flow.di
Class LookupInitializer.LookupImpl
java.lang.Object
com.vaadin.flow.di.LookupInitializer.LookupImpl
- All Implemented Interfaces:
Lookup
- Enclosing class:
- LookupInitializer
Default implementation of
Lookup
.- Since:
- Author:
- Vaadin Ltd
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
LookupImpl
(Map<Class<?>, Collection<Class<?>>> initialServices, BiFunction<Class<?>, Class<?>, Object> factory) Creates a new instance ofLookup
with services found in the application classpath. -
Method Summary
Modifier and TypeMethodDescription<T> T
Lookup for a service of the given type.<T> Collection<T>
Lookup for all services by the providedserviceClass
.
-
Field Details
-
serviceMap
-
-
Constructor Details
-
LookupImpl
protected LookupImpl(Map<Class<?>, Collection<Class<?>>> initialServices, BiFunction<Class<?>, Class<?>, Object> factory) Creates a new instance ofLookup
with services found in the application classpath.- Parameters:
initialServices
- map of initial services with their implementationsfactory
- a factory to create a service object instance
-
-
Method Details
-
lookup
Description copied from interface:Lookup
Lookup for a service of the given type.The
serviceClass
is usually an interface (though it doesn't have to be) and the returned value is some implementation of this interface. -
lookupAll
Description copied from interface:Lookup
Lookup for all services by the providedserviceClass
.The
serviceClass
is usually an interface class (though it doesn't have to be) and the returned value is all implementations of this interface.
-