Package kos.core
Class ImplementationLoader.SPIImplementationLoader
- java.lang.Object
-
- kos.core.ImplementationLoader.SPIImplementationLoader
-
- All Implemented Interfaces:
ImplementationLoader
- Enclosing interface:
- ImplementationLoader
public static class ImplementationLoader.SPIImplementationLoader extends Object implements ImplementationLoader
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface kos.core.ImplementationLoader
ImplementationLoader.SPIImplementationLoader
-
-
Constructor Summary
Constructors Constructor Description SPIImplementationLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Lang.Result<T>instanceOf(Class<T> interfaceType)Load the instance of the giventype.<T> Iterable<T>instancesExposedAs(Class<T> interfaceType)Loads classes exposed by the giveninterfaceType.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface kos.core.ImplementationLoader
anyInstanceOf, instanceOfOrFail
-
-
-
-
Method Detail
-
instancesExposedAs
public <T> Iterable<T> instancesExposedAs(Class<T> interfaceType)
Description copied from interface:ImplementationLoaderLoads classes exposed by the giveninterfaceType.- Specified by:
instancesExposedAsin interfaceImplementationLoader- Type Parameters:
T- same type asinterfaceType- Parameters:
interfaceType- an abstract class or interface in which concrete implementations is expected to be loaded- Returns:
- found implementations or empty
Iterableif none was found.
-
instanceOf
public <T> Lang.Result<T> instanceOf(Class<T> interfaceType)
Description copied from interface:ImplementationLoaderLoad the instance of the giventype.- Specified by:
instanceOfin interfaceImplementationLoader- Type Parameters:
T- same type astype- Parameters:
interfaceType- expected class to be loaded.- Returns:
- an
Optionalinstance containing or not the found instance.
-
-