Class Reflections
java.lang.Object
studio.mevera.imperat.util.reflection.Reflections
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanFinds anyClassof the provided pathsstatic booleanstatic Class<?>A nullableClass.forName(String)instead of throwing exceptionsstatic Constructor<?>getConstructor(@NotNull Class<?> clazz, Class<?>... classes) A nullableClass.getDeclaredConstructor(Class[])instead of throwing exceptionsstatic <T> FieldAccessor<T>Retrieve a field accessor for a specific field valueType and name.static <T> FieldAccessor<T>Retrieve a field accessor for a specific field valueType and name.static <T> FieldAccessor<T>Retrieve a field accessor for a specific field valueType and name.static <T> FieldAccessor<T>Retrieve a field accessor for a specific field valueType and name.static <T> FieldAccessor<T>Retrieve a field accessor for a specific field valueType and name.
-
Constructor Details
-
Reflections
public Reflections()
-
-
Method Details
-
getField
Retrieve a field accessor for a specific field valueType and name.- Parameters:
target- - the targetToLoad valueType.name- - the name of the field, or NULL to ignore.fieldType- - a compatible field valueType.- Returns:
- The field accessor.
-
getField
Retrieve a field accessor for a specific field valueType and name.- Parameters:
className- - lookup name of the class, seegetClass(String).name- - the name of the field, or NULL to ignore.fieldType- - a compatible field valueType.- Returns:
- The field accessor.
-
getField
Retrieve a field accessor for a specific field valueType and name.- Parameters:
target- - the targetToLoad valueType.fieldType- - a compatible field valueType.- Returns:
- The field accessor.
-
getField
Retrieve a field accessor for a specific field valueType and name.- Parameters:
target- - the targetToLoad valueType.fieldType- - a compatible field valueType.index- - the number of compatible fields to skip.- Returns:
- The field accessor.
-
getField
Retrieve a field accessor for a specific field valueType and name.- Parameters:
className- - lookup name of the class, seegetClass(String).fieldType- - a compatible field valueType.index- - the number of compatible fields to skip.- Returns:
- The field accessor.
-
findClass
- Returns:
- false if the
Classwas NOT found
-
findClass
Finds anyClassof the provided paths- Parameters:
paths- all possible class paths- Returns:
- false if the
Classwas NOT found
-
getClass
A nullableClass.forName(String)instead of throwing exceptions- Returns:
- null if the
Classwas NOT found
-
getConstructor
A nullableClass.getDeclaredConstructor(Class[])instead of throwing exceptions- Returns:
- null if the
Constructorwas NOT found
-