Class MethodUtil


  • public abstract class MethodUtil
    extends Object
    • Constructor Detail

      • MethodUtil

        public MethodUtil()
    • Method Detail

      • getMethod

        public static Method getMethod​(Class<?> _class,
                                       String _method,
                                       Class<?>... _classes)
        Get public method of current class
        Parameters:
        _class - ,_params
        Returns:
        Method
      • getAllMethod

        public static Collection<Method> getAllMethod​(Class<?> _class,
                                                      Class<?>... _params)
        Get all public methods current class
        Parameters:
        _class - ,_params
        Returns:
        list
      • getMethod

        public static Method getMethod​(Class<?> _class,
                                       String _method,
                                       Object... _param)
        Get method current class
        Parameters:
        _class - ,_method,_params
        Returns:
        Method
      • getMethod

        public static Method getMethod​(Class<?> _class,
                                       String _method,
                                       ReflectionAccess _accessLevel,
                                       Class<?>... _classes)
        Get field current class with following condition :
        PRIVATE can access all protected , public , private , default field
        PROTECTED can access only protected , public
        PUBLIC can access only public
        DEFAULT can access only protected , public ,default
        Parameters:
        _class - ,_method,_accessLevel,_param
        Returns:
        Field
      • getMethod

        public static Method getMethod​(Class<?> _class,
                                       String _method,
                                       ReflectionAccess _accessLevel,
                                       Object... _param)
        Get field current class with following condition :
        PRIVATE can access all protected , public , private , default field
        PROTECTED can access only protected , public
        PUBLIC can access only public
        DEFAULT can access only protected , public ,default
        Parameters:
        _class - ,_method,_accessLevel,_param
        Returns:
        Field
      • getAllMethod

        public static Collection<Method> getAllMethod​(Class<?> _class)
        Get all public methods current class
        Parameters:
        _class -
        Returns:
        List
      • getAllMethod

        public static Collection<Method> getAllMethod​(Class<?> _class,
                                                      ReflectionAccess _accessLevel)
        Get methods of current class with following condition :
        PRIVATE can access all protected , public , private , default field
        PROTECTED can access only protected , public
        PUBLIC can access only public
        DEFAULT can access only protected , public ,default
        Parameters:
        _class - ,_method,_accessLevel,_classes
        Returns:
        List
      • getAllOverloadMethod

        public static List<Method> getAllOverloadMethod​(Class<?> _class,
                                                        String _method,
                                                        ReflectionAccess _accessLevel)
        Get all overloaded method of current class with following condition :
        PRIVATE can access all protected , public , private , default field
        PROTECTED can access only protected , public
        PUBLIC can access only public
        DEFAULT can access only protected , public ,default
        Parameters:
        _class - ,_method,_accessLevel,_classes
        Returns:
        List
      • getAllOverrideMethod

        public static List<Method> getAllOverrideMethod​(Class<?> _class,
                                                        String _method,
                                                        ReflectionAccess _accessLevel,
                                                        Object... _param)
        Get all overloaded method of current class with following condition :
        PRIVATE can access all protected , public , private , default field
        PROTECTED can access only protected , public
        PUBLIC can access only public
        DEFAULT can access only protected , public ,default
        Parameters:
        _class - ,_method,_accessLevel,_classes
        Returns:
        List
      • hasSetter

        public static Boolean hasSetter​(Class<?> _class)
      • hasGetter

        public static Boolean hasGetter​(Class<?> _class)
      • getFieldName

        public static String getFieldName​(Method _method)
      • isGetter

        public static boolean isGetter​(Method _method)
      • isSetter

        public static boolean isSetter​(Method _method)
      • isMethodExists

        public static Boolean isMethodExists​(Object _object,
                                             String _methodName)
      • matchInterface

        public static boolean matchInterface​(Class<?> cls,
                                             Class<?> cld)
      • matchSuperClass

        public static boolean matchSuperClass​(Class<?> cls,
                                              Class<?> cld)