Package org.cryptacular.util
Class ReflectUtil
java.lang.Object
org.cryptacular.util.ReflectUtil
Reflection utilities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionMethod cache. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
METHOD_CACHE
Method cache.
-
-
Constructor Details
-
ReflectUtil
private ReflectUtil()Private constructor of utility class.
-
-
Method Details
-
getMethod
Gets the method defined on the target class. The method is cached to speed up subsequent lookups.- Parameters:
target- Target class that contains method.name- Method name.parameters- Method parameters.- Returns:
- Method if found, otherwise null.
-
invoke
Invokes the method on the target object with the given parameters.- Parameters:
target- Target class that contains method.method- Method to invoke on target.parameters- Method parameters.- Returns:
- Method return value. A void method returns null.
-