Class ClassUtils


  • public class ClassUtils
    extends java.lang.Object
    Operates on classes without using reflection.

    This class handles invalid null inputs as best it can. Each method documents its behavior in more detail.

    The notion of a canonical name includes the human readable name for the type, for example int[]. The non-canonical method variants work with the JVM names, such as [I.

    This class and the functions contained within are from the Apache commons-lang project.

    • Constructor Summary

      Constructors 
      Constructor Description
      ClassUtils()
      ClassUtils instances should NOT be constructed in standard programming.
    • 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.
      • Methods inherited from class java.lang.Object

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

      • ClassUtils

        public ClassUtils()
        ClassUtils instances should NOT be constructed in standard programming. Instead, the class should be used as ClassUtils.getShortClassName(cls).

        This constructor is public to permit tools that require a JavaBean instance to operate.

    • Method Detail

      • 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