Class MethodUtils

java.lang.Object
org.apache.commons.lang3.reflect.MethodUtils

public class MethodUtils extends Object
Utility reflection methods focused on Methods, originally from Commons BeanUtils. Differences from the BeanUtils version may be noted, especially where similar functionality already existed within Lang.

Known Limitations

Accessing Public Methods In A Default Access Superclass

There is an issue when invoking public methods contained in a default access superclass on JREs prior to 1.4. Reflection locates these methods fine and correctly assigns them as public. However, an IllegalAccessException is thrown if the method is invoked.

MethodUtils contains a workaround for this situation. It will attempt to call AccessibleObject.setAccessible(boolean) on this method. If this call succeeds, then the method can be invoked as normal. This call will only succeed when the application has sufficient security privileges. If this call fails then the method may fail.

Since:
2.5