Beispiel #1
0
 public <T> T fromJson(Reader paramReader, Class<T> paramClass)
     throws JsonSyntaxException, JsonIOException {
   paramReader = new JsonReader(paramReader);
   Object localObject = fromJson(paramReader, paramClass);
   assertFullConsumption(localObject, paramReader);
   return Primitives.wrap(paramClass).cast(localObject);
 }
Beispiel #2
0
 public <T> T fromXml(final Reader json, final Class<T> classOfT)
     throws JsonSyntaxException, JsonIOException {
   final XmlReader jsonReader = new XmlReader(json, xmlParserCreator, options); // change reader
   final Object object = fromXml(jsonReader, classOfT);
   assertFullConsumption(object, jsonReader);
   return Primitives.wrap(classOfT).cast(object);
 }
Beispiel #3
0
 public <T> T fromJson(JsonElement jsonElement, Class<T> cls) throws JsonSyntaxException {
   return Primitives.wrap(cls).cast(fromJson(jsonElement, (Type) cls));
 }
Beispiel #4
0
 public <T> T fromJson(Reader reader, Class<T> cls) throws JsonSyntaxException, JsonIOException {
   JsonReader jsonReader = new JsonReader(reader);
   Object fromJson = fromJson(jsonReader, (Type) cls);
   assertFullConsumption(fromJson, jsonReader);
   return Primitives.wrap(cls).cast(fromJson);
 }
Beispiel #5
0
 public <T> T fromJson(String str, Class<T> cls) throws JsonSyntaxException {
   return Primitives.wrap(cls).cast(fromJson(str, (Type) cls));
 }
Beispiel #6
0
 public <T> T fromJson(String paramString, Class<T> paramClass) throws JsonSyntaxException {
   paramString = fromJson(paramString, paramClass);
   return Primitives.wrap(paramClass).cast(paramString);
 }
Beispiel #7
0
 public <T> T fromJson(JsonElement paramJsonElement, Class<T> paramClass)
     throws JsonSyntaxException {
   paramJsonElement = fromJson(paramJsonElement, paramClass);
   return Primitives.wrap(paramClass).cast(paramJsonElement);
 }
Beispiel #8
0
 public <T> T fromXml(final String json, final Class<T> classOfT) throws JsonSyntaxException {
   final Object object = fromXml(json, (Type) classOfT);
   return Primitives.wrap(classOfT).cast(object);
 }