com.vaadin.flow.di.
Class LookupInitializer.LookupImpl
All Implemented Interfaces:
Enclosing class:
Default implementation of Lookup
.
Since:
Author:
Vaadin Ltd
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LookupImpl
(Map<Class<?>, Collection<Class<?>>> initialServices, BiFunction<Class<?>, Class<?>, Object> factory) Creates a new instance of
Lookup
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 provided
serviceClass
.
-
Field Details
-
serviceMap
-
-
Constructor Details
-
LookupImpl
protected LookupImpl(Map<Class<?>, Collection<Class<?>>> initialServices, BiFunction<Class<?>, Class<?>, Object> factory) Creates a new instance of
Lookup
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.Specified by:
Type Parameters:
T
- a service typeParameters:
serviceClass
- a service SPI classReturns:
a service which implements the
serviceClass
, may benull
if no services are registered for this SPISee Also:
-
lookupAll
Description copied from interface:
Lookup
Lookup for all services by the provided
serviceClass
.The
serviceClass
is usually an interface class (though it doesn't have to be) and the returned value is all implementations of this interface.
-