Package nl.pim16aap2.util.reflection
Class ReflectionBuilder
java.lang.Object
nl.pim16aap2.util.reflection.ReflectionBuilder
Contains several static methods to easily perform several types of complicated reflection lookups.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassFinderstatic ClassFinderCreates a newClassFinderand configures it with a set of class names.static ConstructorFinderCreates a newConstructorFinder.findConstructor(Class<?> source) Creates a newConstructorFinderand specifies the class theConstructorshould exist in.static EnumValuesFinderfindEnumValues(Class<?> source) Creates a newEnumValuesFinderand configures the enum class they should exist in.static FieldFinderCreates a newFieldFinder.Creates a newFieldFinder.FieldFinderInSourceand configures the class theFieldshould exist in.static MethodFinderfindMethod(Class<?> source) Creates a newMethodFinder.MethodFinderInSourceand configures the class theMethodshould exist in.static ParameterGroup.Builder
-
Method Details
-
findClass
- Returns:
- A new
ClassFinder.
-
findClass
Creates a newClassFinderand configures it with a set of class names.- Parameters:
names- A list of class names to search for. There should be at least one.- Returns:
- A new
ClassFinder.
-
findConstructor
Creates a newConstructorFinder.- Returns:
- A new
ConstructorFinder.
-
findConstructor
@CheckReturnValue @Contract(pure=true) public static ConstructorFinder.ConstructorFinderInSource findConstructor(Class<?> source) Creates a newConstructorFinderand specifies the class theConstructorshould exist in.- Parameters:
source- The class in which the finder will look for theConstructor.- Returns:
- A new
ConstructorFinder.
-
findField
Creates a newFieldFinder.- Returns:
- A new
FieldFinder.
-
findField
@CheckReturnValue @Contract(pure=true) public static FieldFinder.FieldFinderInSource findField(Class<?> source) Creates a newFieldFinder.FieldFinderInSourceand configures the class theFieldshould exist in.- Parameters:
source- The class in which the finder will look for theField.- Returns:
- A new
FieldFinder.FieldFinderInSource.
-
findMethod
- Returns:
- A new
MethodFinder.
-
findMethod
@CheckReturnValue @Contract(pure=true) public static MethodFinder.MethodFinderInSource findMethod(Class<?> source) Creates a newMethodFinder.MethodFinderInSourceand configures the class theMethodshould exist in.- Parameters:
source- The class in which the finder will look for theMethod.- Returns:
- A new
MethodFinder.MethodFinderInSource.
-
findEnumValues
@CheckReturnValue @Contract(pure=true) public static EnumValuesFinder.EnumFieldFinderFactory findEnumValues()- Returns:
- A new
EnumValuesFinder.
-
findEnumValues
@CheckReturnValue @Contract(pure=true) public static EnumValuesFinder findEnumValues(Class<?> source) Creates a newEnumValuesFinderand configures the enum class they should exist in.- Parameters:
source- The class in which the finder will look for the enum values.- Returns:
- A new
EnumValuesFinder.
-
parameterBuilder
- Returns:
- A new
ParameterGroup.Builder.
-