Package com.complexible.common.util
Class ServiceLoaders
java.lang.Object
com.complexible.common.util.ServiceLoaders
Wrapper around the Java ServiceLoader class which returns collections of instances of an interface as opposed to iterators over instances that the normal ServiceLoader returns.
- Since:
- 0.4.5
- Version:
- 4.0.3
- Author:
- Michael Grove
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Collection<Class<? extends T>> Return the class objects for all classes which extend from the specified classstatic <T> Collection<T> instancesOf(Class<T> theClass) Return instances of all the classes which extend from the specified class
-
Method Details
-
instancesOf
Return instances of all the classes which extend from the specified class- Type Parameters:
T- the type- Parameters:
theClass- the parent interface/abstract class- Returns:
- a collection of new instances (created using the default constructor)
-
classesOf
Return the class objects for all classes which extend from the specified class- Type Parameters:
T- the type- Parameters:
theClass- the parent interface/abstract class- Returns:
- a collection of class objects for concrete implementations of the provided class.
-