类 ClassHelper
- java.lang.Object
-
- org.apache.dubbo.common.utils.ClassHelper
-
public class ClassHelper extends Object
已过时。Replace toClassUtils- 另请参阅:
ClassUtils
-
-
构造器概要
构造器 构造器 说明 ClassHelper()已过时。
-
方法概要
所有方法 静态方法 具体方法 已过时的方法 修饰符和类型 方法 说明 static ObjectconvertPrimitive(Class<?> type, String value)已过时。static Class<?>forName(String name)已过时。Same asClass.forName(), except that it works for primitive types.static Class<?>forName(String name, ClassLoader classLoader)已过时。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)已过时。static Class<?>forNameWithThreadContextClassLoader(String name)已过时。static ClassLoadergetCallerClassLoader(Class<?> caller)已过时。static ClassLoadergetClassLoader()已过时。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)已过时。get class loaderstatic booleanisGetter(Method method)已过时。Replace toMethodUtils#isGetter(Method)static booleanisPrimitive(Class<?> type)已过时。static booleanisSetter(Method method)已过时。Replace toMethodUtils#isSetter(Method)static booleanisTypeMatch(Class<?> type, String value)已过时。We only check boolean value at this moment.static Class<?>resolvePrimitiveClassName(String name)已过时。Resolve the given class name as primitive class, if appropriate, according to the JVM's naming rules for primitive classes.static StringsimpleClassName(Class<?> clazz)已过时。static StringtoShortString(Object obj)已过时。
-
-
-
方法详细资料
-
forNameWithThreadContextClassLoader
public static Class<?> forNameWithThreadContextClassLoader(String name) throws ClassNotFoundException
已过时。
-
forNameWithCallerClassLoader
public static Class<?> forNameWithCallerClassLoader(String name, Class<?> caller) throws ClassNotFoundException
已过时。
-
getCallerClassLoader
public static ClassLoader getCallerClassLoader(Class<?> caller)
已过时。
-
getClassLoader
public static ClassLoader getClassLoader(Class<?> clazz)
已过时。get class loader- 参数:
clazz-- 返回:
- class loader
-
getClassLoader
public static ClassLoader getClassLoader()
已过时。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).- 返回:
- the default ClassLoader (never
null) - 另请参阅:
Thread.getContextClassLoader()
-
forName
public static Class<?> forName(String name) throws ClassNotFoundException
已过时。Same asClass.forName(), except that it works for primitive types.
-
forName
public static Class<?> forName(String name, ClassLoader classLoader) throws ClassNotFoundException, LinkageError
已过时。Replacement forClass.forName()that also returns Class instances for primitives (like "int") and array class names (like "String[]").- 参数:
name- the name of the ClassclassLoader- the class loader to use (may benull, which indicates the default class loader)- 返回:
- Class instance for the supplied name
- 抛出:
ClassNotFoundException- if the class was not foundLinkageError- if the class file could not be loaded- 另请参阅:
Class.forName(String, boolean, ClassLoader)
-
resolvePrimitiveClassName
public static Class<?> resolvePrimitiveClassName(String name)
已过时。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).- 参数:
name- the name of the potentially primitive class- 返回:
- the primitive class, or
nullif the name does not denote a primitive class or primitive array class
-
isSetter
public static boolean isSetter(Method method)
已过时。Replace toMethodUtils#isSetter(Method)
-
isGetter
public static boolean isGetter(Method method)
已过时。Replace toMethodUtils#isGetter(Method)- 另请参阅:
(Method)
-
isPrimitive
public static boolean isPrimitive(Class<?> type)
已过时。
-
-