Class ClassUtils


  • public class ClassUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.Class<?>> getAllInterfaces​(java.lang.Class<?> cls)
      Gets a List of all interfaces implemented by the given class and its superclasses.
      (package private) static void getAllInterfaces​(java.lang.Class<?> cls, java.util.HashSet<java.lang.Class<?>> interfacesFound)
      Get the interfaces for the specified class.
      static java.util.List<java.lang.Class<?>> getAllSuperclasses​(java.lang.Class<?> cls)
      Gets a List of superclasses for the given class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassUtils

        public ClassUtils()
    • Method Detail

      • getAllSuperclasses

        public static java.util.List<java.lang.Class<?>> getAllSuperclasses​(java.lang.Class<?> cls)

        Gets a List of superclasses for the given class.

        Parameters:
        cls - the class to look up, may be null
        Returns:
        the List of superclasses in order going up from this one null if null input
      • getAllInterfaces

        public static java.util.List<java.lang.Class<?>> getAllInterfaces​(java.lang.Class<?> cls)

        Gets a List of all interfaces implemented by the given class and its superclasses.

        The order is determined by looking through each interface in turn as declared in the source file and following its hierarchy up. Then each superclass is considered in the same way. Later duplicates are ignored, so the order is maintained.

        Parameters:
        cls - the class to look up, may be null
        Returns:
        the List of interfaces in order, null if null input
      • getAllInterfaces

        static void getAllInterfaces​(java.lang.Class<?> cls,
                                     java.util.HashSet<java.lang.Class<?>> interfacesFound)
        Get the interfaces for the specified class.
        Parameters:
        cls - the class to look up, may be null
        interfacesFound - the Set of interfaces for the class