This commit is contained in:
Redkale
2018-02-08 14:13:38 +08:00
parent fdb7ca29bc
commit f9fae91c71
2 changed files with 5 additions and 5 deletions

View File

@@ -94,7 +94,7 @@ public final class ObjectDecoder<R extends Reader, T> implements Decodeable<R, T
if (factory.isConvertDisabled(field)) continue;
ref = factory.findRef(field);
if (ref != null && ref.ignore()) continue;
Type t = TypeToken.createClassType(field.getGenericType(), this.type);
Type t = TypeToken.createClassType(TypeToken.getGenericType(field.getGenericType(), clazz), this.type);
DeMember member = new DeMember(ObjectEncoder.createAttribute(factory, clazz, field, null, null), factory.loadDecoder(t));
if (ref != null) member.index = ref.getIndex();
list.add(member);
@@ -119,7 +119,7 @@ public final class ObjectDecoder<R extends Reader, T> implements Decodeable<R, T
}
ref = factory.findRef(method);
if (ref != null && ref.ignore()) continue;
Type t = TypeToken.createClassType(method.getGenericParameterTypes()[0], this.type);
Type t = TypeToken.createClassType(TypeToken.getGenericType(method.getGenericParameterTypes()[0], clazz), this.type);
DeMember member = new DeMember(ObjectEncoder.createAttribute(factory, clazz, null, null, method), factory.loadDecoder(t));
if (ref != null) member.index = ref.getIndex();
list.add(member);
@@ -149,7 +149,7 @@ public final class ObjectDecoder<R extends Reader, T> implements Decodeable<R, T
} catch (NoSuchMethodException ex) {
getter = clazz.getMethod("is" + mn);
}
Type t = TypeToken.createClassType(getter.getGenericParameterTypes()[0], this.type);
Type t = TypeToken.createClassType(TypeToken.getGenericType(getter.getGenericParameterTypes()[0], clazz), this.type);
list.add(new DeMember(ObjectEncoder.createAttribute(factory, clazz, null, getter, null), factory.loadDecoder(t)));
}
}

View File

@@ -77,7 +77,7 @@ public final class ObjectEncoder<W extends Writer, T> implements Encodeable<W, T
if (factory.isConvertDisabled(field)) continue;
ref = factory.findRef(field);
if (ref != null && ref.ignore()) continue;
Type t = TypeToken.createClassType(field.getGenericType(), this.type);
Type t = TypeToken.createClassType(TypeToken.getGenericType(field.getGenericType(), clazz), this.type);
EnMember member = new EnMember(createAttribute(factory, clazz, field, null, null), factory.loadEncoder(t));
if (ref != null) member.index = ref.getIndex();
list.add(member);
@@ -102,7 +102,7 @@ public final class ObjectEncoder<W extends Writer, T> implements Encodeable<W, T
}
ref = factory.findRef(method);
if (ref != null && ref.ignore()) continue;
Type t = TypeToken.createClassType(method.getGenericReturnType(), this.type);
Type t = TypeToken.createClassType(TypeToken.getGenericType(method.getGenericReturnType(), clazz), this.type);
EnMember member = new EnMember(createAttribute(factory, clazz, null, method, null), factory.loadEncoder(t));
if (ref != null) member.index = ref.getIndex();
list.add(member);