Package org.apache.dubbo.common.utils
Class ClassHelper
java.lang.Object
org.apache.dubbo.common.utils.ClassHelper
Deprecated.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectconvertPrimitive(Class<?> type, String value) Deprecated.static Class<?> Deprecated.Same asClass.forName(), except that it works for primitive types.static Class<?> forName(String name, ClassLoader classLoader) Deprecated.Replacement forClass.forName()that also returns Class instances for primitives (like "int") and array class names (like "String[]").static Class<?> forNameWithCallerClassLoader(String name, Class<?> caller) Deprecated.static Class<?> Deprecated.static ClassLoadergetCallerClassLoader(Class<?> caller) Deprecated.static ClassLoaderDeprecated.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 ClassLoadergetClassLoader(Class<?> clazz) Deprecated.get class loaderstatic booleanDeprecated.Replace toMethodUtils#isGetter(Method)static booleanisPrimitive(Class<?> type) Deprecated.static booleanDeprecated.Replace toMethodUtils#isSetter(Method)static booleanisTypeMatch(Class<?> type, String value) Deprecated.We only check boolean value at this moment.static Class<?> Deprecated.Resolve the given class name as primitive class, if appropriate, according to the JVM's naming rules for primitive classes.static StringsimpleClassName(Class<?> clazz) Deprecated.static StringtoShortString(Object obj) Deprecated.
-
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
Deprecated. -
getClassLoader
Deprecated.get class loader- Parameters:
clazz-- Returns:
- class loader
-
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 anullClassLoader reference as well).- Returns:
- the default ClassLoader (never
null) - See Also:
-
forName
Deprecated.Same asClass.forName(), except that it works for primitive types.- Throws:
ClassNotFoundException
-
forName
public static Class<?> forName(String name, ClassLoader classLoader) throws ClassNotFoundException, LinkageError Deprecated.Replacement forClass.forName()that also returns Class instances for primitives (like "int") and array class names (like "String[]").- Parameters:
name- the name of the ClassclassLoader- the class loader to use (may benull, which indicates the default class loader)- Returns:
- Class instance for the supplied name
- Throws:
ClassNotFoundException- if the class was not foundLinkageError- if the class file could not be loaded- See Also:
-
resolvePrimitiveClassName
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
nullif the name does not denote a primitive class or primitive array class
-
toShortString
Deprecated. -
simpleClassName
Deprecated. -
isSetter
Deprecated.Replace toMethodUtils#isSetter(Method)- See Also:
-
isGetter
Deprecated.Replace toMethodUtils#isGetter(Method)- See Also:
-
isPrimitive
Deprecated. -
convertPrimitive
Deprecated. -
isTypeMatch
Deprecated.We only check boolean value at this moment.- Parameters:
type-value-- Returns:
-
ClassUtils