Improved unmarshalling in ElementMapper
This commit is contained in:
parent
f9137ffff9
commit
1368f707c8
|
@ -312,7 +312,11 @@ public abstract class ElementMapper {
|
|||
}
|
||||
JsonNode jsonNode = mapper.readTree(reader);
|
||||
jsonNode = analizeTypes((ObjectNode) jsonNode);
|
||||
return ElementMapper.unmarshal(clz, mapper.writeValueAsString(jsonNode));
|
||||
try {
|
||||
return ElementMapper.unmarshal(clz, mapper.writeValueAsString(jsonNode));
|
||||
}catch (Throwable t) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -336,7 +340,11 @@ public abstract class ElementMapper {
|
|||
}
|
||||
JsonNode jsonNode = mapper.readTree(stream);
|
||||
jsonNode = analizeTypes((ObjectNode) jsonNode);
|
||||
return ElementMapper.unmarshal(clz, mapper.writeValueAsString(jsonNode));
|
||||
try {
|
||||
return ElementMapper.unmarshal(clz, mapper.writeValueAsString(jsonNode));
|
||||
}catch (Throwable t) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -359,7 +367,11 @@ public abstract class ElementMapper {
|
|||
}
|
||||
JsonNode jsonNode = mapper.readTree(string);
|
||||
jsonNode = analizeTypes((ObjectNode) jsonNode);
|
||||
return ElementMapper.unmarshal(clz, mapper.writeValueAsString(jsonNode));
|
||||
try {
|
||||
return ElementMapper.unmarshal(clz, mapper.writeValueAsString(jsonNode));
|
||||
}catch (Throwable t) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -374,9 +386,13 @@ public abstract class ElementMapper {
|
|||
}
|
||||
List<El> ret = new ArrayList<>();
|
||||
ArrayNode arrayNode = (ArrayNode) mapper.readTree(string);
|
||||
for(JsonNode jsonNode : arrayNode) {
|
||||
jsonNode = analizeTypes((ObjectNode) jsonNode);
|
||||
ret.add(ElementMapper.unmarshal(clz, mapper.writeValueAsString(jsonNode)));
|
||||
try {
|
||||
for(JsonNode jsonNode : arrayNode) {
|
||||
jsonNode = analizeTypes((ObjectNode) jsonNode);
|
||||
ret.add(ElementMapper.unmarshal(clz, mapper.writeValueAsString(jsonNode)));
|
||||
}
|
||||
}catch (Throwable t) {
|
||||
throw e;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -390,9 +406,13 @@ public abstract class ElementMapper {
|
|||
} catch (InvalidTypeIdException e) {
|
||||
List<El> ret = new ArrayList<>();
|
||||
ArrayNode arrayNode = (ArrayNode) mapper.readTree(string);
|
||||
for(JsonNode jsonNode : arrayNode) {
|
||||
jsonNode = analizeTypes((ObjectNode) jsonNode);
|
||||
ret.add((El) ElementMapper.unmarshal(Element.class, mapper.writeValueAsString(jsonNode)));
|
||||
try {
|
||||
for(JsonNode jsonNode : arrayNode) {
|
||||
jsonNode = analizeTypes((ObjectNode) jsonNode);
|
||||
ret.add((El) ElementMapper.unmarshal(Element.class, mapper.writeValueAsString(jsonNode)));
|
||||
}
|
||||
}catch (Throwable t) {
|
||||
throw e;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue