|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.drinkjava2.jdialects.ClassCacheUtils
public abstract class ClassCacheUtils
ClassCacheUtils is utility class to cache some info of classes read and write method
| Nested Class Summary | |
|---|---|
protected static class |
ClassCacheUtils.ClassOrMethodNotExist
|
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
ClassCacheUtils()
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static ConcurrentHashMap<String,Class<?>> classExistCache
protected static Map<Class<?>,Map<String,Object>> uniqueMethodCache
protected static Map<Class<?>,Map<String,Method>> classReadMethods
protected static Map<Class<?>,Map<String,Method>> classWriteMethods
| Constructor Detail |
|---|
public ClassCacheUtils()
| Method Detail |
|---|
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)
DialectException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||