Updated RuntimeClasspath Serializer/Deserializer

This commit is contained in:
patton73 2019-06-21 19:55:05 +02:00
parent 747238a479
commit 9bf487f0b7
2 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,8 @@ public class RuntimeClasspathDeserializerLocator<T> implements InstanceLocator<D
return Classes.newInstance("io.jsonwebtoken.io.JacksonDeserializer");
} else if (isAvailable("org.json.JSONObject")) {
return Classes.newInstance("io.jsonwebtoken.io.OrgJsonDeserializer");
} else if (isAvailable("com.google.gson.GsonBuilder")) {
return Classes.newInstance("io.jsonwebtoken.io.GsonDeSerializer");
} else {
throw new IllegalStateException("Unable to discover any JSON Deserializer implementations on the classpath.");
}

View File

@ -34,6 +34,8 @@ public class RuntimeClasspathSerializerLocator implements InstanceLocator<Serial
return Classes.newInstance("io.jsonwebtoken.io.JacksonSerializer");
} else if (isAvailable("org.json.JSONObject")) {
return Classes.newInstance("io.jsonwebtoken.io.OrgJsonSerializer");
} else if (isAvailable("com.google.gson.GsonBuilder")) {
return Classes.newInstance("io.jsonwebtoken.io.GsonSerializer");
} else {
throw new IllegalStateException("Unable to discover any JSON Serializer implementations on the classpath.");
}