use of nikita.common.model.noark5.v4.NoarkGeneralEntity in project nikita-noark5-core by HiOA-ABI.
the class HateoasDeserializer method deserialize.
@Override
public HateoasNoarkObject deserialize(JsonParser jsonParser, DeserializationContext dc) throws IOException {
StringBuilder errors = new StringBuilder();
NoarkGeneralEntity entity = new NoarkGeneralEntity();
ObjectNode objectNode = mapper.readTree(jsonParser);
// Deserialise general properties
CommonUtils.Hateoas.Deserialize.deserialiseNoarkEntity(entity, objectNode, errors);
// If there are additional throw a malformed input exception
if (objectNode.size() != 0) {
errors.append("The arkiv you tried to create is malformed. The " + "following fields are not recognised as arkiv fields [" + CommonUtils.Hateoas.Deserialize.checkNodeObjectEmpty(objectNode) + "]. ");
}
// if (0 < errors.length())
// throw new NikitaMalformedInputDataException(errors.toString());
HateoasNoarkObject hateoasNoarkObject = new HateoasNoarkObject(entity);
return hateoasNoarkObject;
}
Aggregations