//通过类名获取类
//String dataType = jsonObject.containsKey("data_type") ? jsonObject.getString("data_type").trim() : "";
//JSONObject.parseObject(dataType,getClazz("com.entity."+dataType));
public static Class<?> getClazz(String clazzName){
try {
return Class.forName(clazzName);
} catch (ClassNotFoundException e) {
return null;
}
}
java反射,通过类名加载类
最新推荐文章于 2024-07-20 03:19:38 发布