Class Reflection
- java.lang.Object
-
- de.fraunhofer.iosb.ilt.configurable.Reflection
-
public class Reflection extends Object
Utility methods for Reflections.- Author:
- Hylke van der Schaaf
-
-
Constructor Summary
Constructors Constructor Description Reflection()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.reflections.ReflectionsgetReflections()static Set<Class<?>>getSubtypesOf(Class parent)Returns all subtypes of the given class or interface.static List<Class<?>>getSubtypesOf(Class parent, boolean interfaces)Returns all subtypes of the given class or interface, excluding the given class itself.static List<Class<?>>getSubtypesOf(Class parent, boolean interfaces, boolean includeParent)Returns all subtypes of the given class or interface, optionally including the given class itself.
-
-
-
Method Detail
-
getReflections
public static org.reflections.Reflections getReflections()
-
getSubtypesOf
public static Set<Class<?>> getSubtypesOf(Class parent)
Returns all subtypes of the given class or interface.- Parameters:
parent- The class or interface to get subtypes of.- Returns:
- The list of classes.
-
getSubtypesOf
public static List<Class<?>> getSubtypesOf(Class parent, boolean interfaces)
Returns all subtypes of the given class or interface, excluding the given class itself. Optionally filtering out all interfaces.- Parameters:
parent- The class or interface to find subclasses of.interfaces- Should interfaces and abstract classes be included.- Returns:
- The list of classes.
-
getSubtypesOf
public static List<Class<?>> getSubtypesOf(Class parent, boolean interfaces, boolean includeParent)
Returns all subtypes of the given class or interface, optionally including the given class itself. Optionally filtering out all interfaces.- Parameters:
parent- The class or interface to find subclasses of.interfaces- Should interfaces and abstract classes be included.includeParent- Should the given parent class itself be returned.- Returns:
- The list of classes.
-
-