Your method is private but getMethod()
only returns public method.
You need to use getDeclaredMethod()
.
More Related Contents:
- Only one annotation is showing
- What is reflection and why is it useful?
- How do I invoke a Java method when given the method name as a string?
- Getting the name of the currently executing method
- Get type of a generic parameter in Java with reflection
- Any way to Invoke a private method?
- Can a Java class add a method to itself at runtime?
- Can I get information about the local variables using Java reflection?
- Retrieving the inherited attribute names/values using Java Reflection
- How to limit setAccessible to only “legitimate” uses?
- Get declared fields of java.lang.reflect.Fields in jdk12
- Java Reflection: How can I get the all getter methods of a java class and invoke them
- How do I find out what type each object is in a ArrayList?
- How to use URLClassLoader to load a *.class file?
- Is there something like instanceOf(Class c) in Java?
- How to get annotations of a member variable?
- Java reflection: how to get field value from an object, not knowing its class
- Set field value with reflection
- How to get the parameter names of an object’s constructors (reflection)? [duplicate]
- Java dynamic function calling
- Proguard and reflection in Android
- Java reflection – impact of setAccessible(true)
- Determine if a Class implements a interface in Java
- How do I iterate over class members?
- How to get all imports defined in a class using java reflection?
- How do I print the method body reflectively?
- Is it possible in java to create ‘blank’ instance of class without no-arg constructor using reflection?
- Java casting “.class”-operator used on a generic type, e.g. List, to “Class
- Best way of invoking getter by reflection
- How to use reflection to call a private method from outside a java class without getting IllegalAccessException?