Class ClassUtils


  • public class ClassUtils
    extends 
    Author:
    Rui Gu (https://github.com/jackygurui) Modified
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends >
      T
      <?> clazz, <T> annotationClass)  
      static <T extends >
      T
      <?> clazz,  fieldName, <T> annotationClass)  
      static <?> clazz,  fieldName)  
      static <T> T  obj,  fieldName)  
      static boolean <?> clazz, <? extends > annotation)  
      static <?> type,  name, <?>[] parms)
      Searches through all methods looking for one with the specified name that will take the specified paramaters even if the parameter types are more generic in the actual method implementation.
      static void  obj,  fieldName,  value)  
      • Methods inherited from class java.lang.

        , , , , , , , , , ,
    • Constructor Detail

      • ClassUtils

        public ClassUtils()
    • Method Detail

      • setField

        public static void setField​( obj,
                                     fieldName,
                                     value)
      • getAnnotation

        public static <T extends > T getAnnotation​(<?> clazz,
                                                              fieldName,
                                                             <T> annotationClass)
      • getAnnotation

        public static <T extends > T getAnnotation​(<?> clazz,
                                                             <T> annotationClass)
      • getField

        public static <T> T getField​( obj,
                                      fieldName)
      • getDeclaredField

        public static  getDeclaredField​(<?> clazz,
                                              fieldName)
                                      throws 
        Throws:
      • isAnnotationPresent

        public static boolean isAnnotationPresent​(<?> clazz,
                                                  <? extends > annotation)
      • searchForMethod

        public static  searchForMethod​(<?> type,
                                              name,
                                             <?>[] parms)
        Searches through all methods looking for one with the specified name that will take the specified paramaters even if the parameter types are more generic in the actual method implementation. This is similar to the findConstructor() method and has the similar limitations that it doesn't do a real widening scope search and simply processes the methods in order.
        Parameters:
        type - param
        name - of class
        parms - classes
        Returns:
        Method object