类 ClassUtils


  • public final class ClassUtils
    extends java.lang.Object
    从以下版本开始:
    3.5.0
    作者:
    nieqiurong 2020/11/9.
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static java.lang.ClassLoader getDefaultClassLoader()
      Return the default ClassLoader to use: typically the thread context ClassLoader, if available; the ClassLoader that loaded the ClassUtils class will be used as fallback.
      static java.lang.String getSimpleName​(java.lang.String className)
      获取类名
      static java.lang.Class<?> toClassConfident​(java.lang.String name)
      请仅在确定类存在的情况下调用该方法
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • getSimpleName

        public static java.lang.String getSimpleName​(java.lang.String className)
        获取类名
        参数:
        className - className 全类名
        返回:
        ignore
      • toClassConfident

        public static java.lang.Class<?> toClassConfident​(java.lang.String name)

        请仅在确定类存在的情况下调用该方法

        参数:
        name - 类名称
        返回:
        返回转换后的 Class
      • getDefaultClassLoader

        public static java.lang.ClassLoader getDefaultClassLoader()
        Return the default ClassLoader to use: typically the thread context ClassLoader, if available; the ClassLoader that loaded the ClassUtils class will be used as fallback.

        Call this method if you intend to use the thread context ClassLoader in a scenario where you clearly prefer a non-null ClassLoader reference: for example, for class path resource loading (but not necessarily for Class.forName, which accepts a null ClassLoader reference as well).

        返回:
        the default ClassLoader (only null if even the system ClassLoader isn't accessible)
        从以下版本开始:
        3.3.2
        另请参阅:
        Thread.getContextClassLoader(), ClassLoader.getSystemClassLoader()