mirror of
https://e.coding.net/circlecloud/GsonAgent.git
synced 2024-11-22 01:48:50 +00:00
修改获取类名...
Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
parent
2dc3901c06
commit
64571818cc
@ -21,14 +21,14 @@ import cn.citycraft.GsonAgent.api.utils.Utils;
|
|||||||
* @since 2016年1月5日 下午12:51:30
|
* @since 2016年1月5日 下午12:51:30
|
||||||
* @author 喵♂呜,曲尘
|
* @author 喵♂呜,曲尘
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked", "rawtypes", "unused" })
|
||||||
public class GsonAgent {
|
public class GsonAgent {
|
||||||
public static boolean newVersion = false;
|
public static boolean newVersion = false;
|
||||||
private static String internalPackageName;
|
private static String internalPackageName;
|
||||||
private static Class TypeAdapter;
|
private static Class TypeAdapter;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
internalPackageName = "cn.citycraft.PluginHelper.gsonagent.";
|
internalPackageName = "cn.citycraft.GsonAgent.";
|
||||||
try {
|
try {
|
||||||
Thread.currentThread().getContextClassLoader().loadClass("com.google.gson.Gson");
|
Thread.currentThread().getContextClassLoader().loadClass("com.google.gson.Gson");
|
||||||
newVersion = true;
|
newVersion = true;
|
||||||
@ -39,7 +39,6 @@ public class GsonAgent {
|
|||||||
try {
|
try {
|
||||||
TypeAdapter = getInternalClass("bind.TypeAdapter");
|
TypeAdapter = getInternalClass("bind.TypeAdapter");
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,4 +131,14 @@ public class GsonAgent {
|
|||||||
private static Class<?> getInternalClass(final String className) throws ClassNotFoundException {
|
private static Class<?> getInternalClass(final String className) throws ClassNotFoundException {
|
||||||
return Class.forName(internalPackageName + className + "Handle");
|
return Class.forName(internalPackageName + className + "Handle");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void none() {
|
||||||
|
Class clazz;
|
||||||
|
clazz = cn.citycraft.GsonAgent.api.bind.TypeAdapter.class;
|
||||||
|
clazz = cn.citycraft.GsonAgent.nms.bind.TypeAdapterHandle.class;
|
||||||
|
clazz = cn.citycraft.GsonAgent.normal.bind.TypeAdapterHandle.class;
|
||||||
|
clazz = cn.citycraft.GsonAgent.api.bind.TypeAdapterFactory.class;
|
||||||
|
clazz = cn.citycraft.GsonAgent.nms.bind.TypeAdapterFactoryHandle.class;
|
||||||
|
clazz = cn.citycraft.GsonAgent.normal.bind.TypeAdapterFactoryHandle.class;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user