Class ClassHelper

java.lang.Object
org.apache.dubbo.common.utils.ClassHelper

public class ClassHelper extends Object
Deprecated.
Replace to ClassUtils
See Also:
  • Constructor Details

    • ClassHelper

      public ClassHelper()
      Deprecated.
  • Method Details

    • forNameWithThreadContextClassLoader

      public static Class<?> forNameWithThreadContextClassLoader(String name) throws ClassNotFoundException
      Deprecated.
      Throws:
      ClassNotFoundException
    • forNameWithCallerClassLoader

      public static Class<?> forNameWithCallerClassLoader(String name, Class<?> caller) throws ClassNotFoundException
      Deprecated.
      Throws:
      ClassNotFoundException
    • getCallerClassLoader

      public static ClassLoader getCallerClassLoader(Class<?> caller)
      Deprecated.
    • getClassLoader

      public static ClassLoader getClassLoader(Class<?> clazz)
      Deprecated.
      get class loader
      Parameters:
      clazz -
      Returns:
      class loader
    • getClassLoader

      public static ClassLoader getClassLoader()
      Deprecated.
      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 absolutely need 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).

      Returns:
      the default ClassLoader (never null)
      See Also:
    • forName

      public static Class<?> forName(String name) throws ClassNotFoundException
      Deprecated.
      Same as Class.forName(), except that it works for primitive types.
      Throws:
      ClassNotFoundException
    • forName

      public static Class<?> forName(String name, ClassLoader classLoader) throws ClassNotFoundException, LinkageError
      Deprecated.
      Replacement for Class.forName() that also returns Class instances for primitives (like "int") and array class names (like "String[]").
      Parameters:
      name - the name of the Class
      classLoader - the class loader to use (may be null, which indicates the default class loader)
      Returns:
      Class instance for the supplied name
      Throws:
      ClassNotFoundException - if the class was not found
      LinkageError - if the class file could not be loaded
      See Also:
    • resolvePrimitiveClassName

      public static Class<?> resolvePrimitiveClassName(String name)
      Deprecated.
      Resolve the given class name as primitive class, if appropriate, according to the JVM's naming rules for primitive classes.

      Also supports the JVM's internal class names for primitive arrays. Does not support the "[]" suffix notation for primitive arrays; this is only supported by forName(java.lang.String).

      Parameters:
      name - the name of the potentially primitive class
      Returns:
      the primitive class, or null if the name does not denote a primitive class or primitive array class
    • toShortString

      public static String toShortString(Object obj)
      Deprecated.
    • simpleClassName

      public static String simpleClassName(Class<?> clazz)
      Deprecated.
    • isSetter

      public static boolean isSetter(Method method)
      Deprecated.
      Replace to MethodUtils#isSetter(Method)
      See Also:
    • isGetter

      public static boolean isGetter(Method method)
      Deprecated.
      Replace to MethodUtils#isGetter(Method)
      See Also:
    • isPrimitive

      public static boolean isPrimitive(Class<?> type)
      Deprecated.
    • convertPrimitive

      public static Object convertPrimitive(Class<?> type, String value)
      Deprecated.
    • isTypeMatch

      public static boolean isTypeMatch(Class<?> type, String value)
      Deprecated.
      We only check boolean value at this moment.
      Parameters:
      type -
      value -
      Returns: