Class 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 setAccessible 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
    Version:
    $Id: MethodUtils.java 911986 2010-02-19 21:19:05Z niallp $