Package com.brightcove.player.util
Class ReflectionUtil
- java.lang.Object
-
- com.brightcove.player.util.ReflectionUtil
-
public class ReflectionUtil extends java.lang.ObjectProvides utility methods that can be used access and mutate objects using reflection.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertCallerAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.String message)Ensures if the caller of the method calling this method is annotated with the specified annotation.static booleansetField(java.lang.Object source, java.lang.String fieldName, java.lang.Object value)
-
-
-
Method Detail
-
setField
public static boolean setField(@NonNull java.lang.Object source, @NonNull java.lang.String fieldName, @Nullable java.lang.Object value)
-
assertCallerAnnotation
public static void assertCallerAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.String message)Ensures if the caller of the method calling this method is annotated with the specified annotation.- Parameters:
annotationClass- the expected annotation classmessage- the message that will included the exception if the check fails.- Throws:
java.lang.UnsupportedOperationException- if the caller if the caller is not annotated as expected.
-
-