public abstract class ClassCacheUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static ConcurrentHashMap<String,Class<?>> |
classExistCache |
protected static Map<Class<?>,Map<String,Method>> |
classReadMethods |
protected static Map<Class<?>,Map<String,Method>> |
classWriteMethods |
protected static Map<Class<?>,Map<String,Object>> |
uniqueMethodCache |
| Constructor and Description |
|---|
ClassCacheUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
cacheReadWriteMethodsAndBoxField(Class<?> clazz) |
static Class<?> |
checkClassExist(String className)
Check class if exist, if exit return it, otherwise return null
|
static Method |
checkMethodExist(Class<?> clazz,
String uniqueMethodName)
Check if a unique method name exists in class, if exist return the method,
otherwise return null
|
static Object |
createNewEntity(Class<?> entityClass)
Create a new Object by given entityClass, if any exception happen, throw
DialectException |
static Method |
getClassFieldReadMethod(Class<?> clazz,
String fieldName)
Return cached class field read method to avoid each time use reflect
|
static Method |
getClassFieldWriteMethod(Class<?> clazz,
String fieldName)
Return cached class field write method to avoid each time use reflect
|
static Map<String,Method> |
getClassReadMethods(Class<?> clazz)
Return cached class read methods to avoid each time use reflect
|
static Map<String,Method> |
getClassWriteMethods(Class<?> clazz)
Return cached class write methods to avoid each time use reflect
|
static Object |
readValueFromBeanField(Object entityBean,
String fieldName)
Read value from entityBean field
|
static void |
registerClass(Class<?> clazz) |
static void |
writeValueToBeanField(Object entityBean,
String fieldName,
Object value)
write value to entityBean field
|
protected static ConcurrentHashMap<String,Class<?>> classExistCache
public static Class<?> checkClassExist(String className)
public static void registerClass(Class<?> clazz)
public static Method checkMethodExist(Class<?> clazz, String uniqueMethodName)
public static void cacheReadWriteMethodsAndBoxField(Class<?> clazz)
public static Map<String,Method> getClassReadMethods(Class<?> clazz)
public static Method getClassFieldReadMethod(Class<?> clazz, String fieldName)
public static Map<String,Method> getClassWriteMethods(Class<?> clazz)
public static Method getClassFieldWriteMethod(Class<?> clazz, String fieldName)
public static Object readValueFromBeanField(Object entityBean, String fieldName)
public static void writeValueToBeanField(Object entityBean, String fieldName, Object value)
public static Object createNewEntity(Class<?> entityClass)
DialectExceptionCopyright © 2021. All rights reserved.