Class MethodUtil


  • public final class MethodUtil
    extends Object
    MethodUtils
    • Method Detail

      • getMethod

        public static <A> Method getMethod​(String strMethodPrefix,
                                           A instance,
                                           String strAttributeName,
                                           Class<?> clazz)
                                    throws NoSuchMethodException
        Gets the method.
        Type Parameters:
        A - the generic type of the instance
        Parameters:
        strMethodPrefix - the str method prefix
        instance - the instance
        strAttributeName - the str attribute name
        clazz - the clazz
        Returns:
        the method
        Throws:
        SecurityException - the security exception
        NoSuchMethodException - the no such method exception
      • getPrimitiveMethod

        public static <A> Method getPrimitiveMethod​(String strMethodName,
                                                    A instance,
                                                    Class<?> clazz)
                                             throws NoSuchMethodException
        Gets the primitive method.
        Type Parameters:
        A - the generic type of the instance
        Parameters:
        strMethodName - the str method name
        instance - the instance
        clazz - the clazz
        Returns:
        the primitive method
        Throws:
        SecurityException - the security exception
        NoSuchMethodException - the no such method exception
      • getSetter

        public static <A> Method getSetter​(A instance,
                                           String strAttributeName,
                                           Class<?> clazz)
                                    throws NoSuchMethodException
        Gets the setter.
        Type Parameters:
        A - the generic type
        Parameters:
        instance - the instance
        strAttributeName - the str attribute name
        clazz - the clazz
        Returns:
        the setter
        Throws:
        SecurityException - the security exception
        NoSuchMethodException - the no such method exception
      • getGetter

        public static <A> Method getGetter​(A instance,
                                           String strAttributeName,
                                           Class<?> clazz)
                                    throws NoSuchMethodException
        Gets the setter.
        Type Parameters:
        A - the generic type of the instance
        Parameters:
        instance - the instance
        strAttributeName - the str attribute name
        clazz - the clazz
        Returns:
        the setter
        Throws:
        SecurityException - the security exception
        NoSuchMethodException - the no such method exception