//item.isWithdrawn = itemNode.get("isWithdrawn").asBoolean();
//item.submitterFullName = itemNode.get("submitter").get("fullName").asText();
if(itemNode.has("metadata")) {
JsonNode metadataNode = itemNode.get("metadata");
item.metadata = new ArrayList<MetadataField>();
for(JsonNode field : metadataNode) {
String key = field.get("key").asText();
String value = field.get("value").asText();
item.metadata.add(new MetadataField(key, value));
}
}
if(itemNode.has("bitstreams")) {
item.bitstreams = new ArrayList<Bitstream>();
JsonNode bitstreamsNode = itemNode.get("bitstreams");
for(JsonNode bitstreamNode : bitstreamsNode) {
Bitstream bitstream = Bitstream.parseBitstreamFromJSON(bitstreamNode);
item.bitstreams.add(bitstream);
}
}
if(itemNode.has("parentCollectionList")) {
JsonNode collectionNodes = itemNode.get("parentCollectionList");
for(JsonNode collectionNode : collectionNodes) {
Collection collection = Collection.parseCollectionFromJSON(collectionNode);
item.collections.add(collection);
}
}
if(itemNode.has("parentCommunityList")) {
JsonNode communityNodes = itemNode.get("parentCommunityList");
for(JsonNode communityNode : communityNodes) {
Community community = Community.parseCommunityFromJSON(communityNode);
item.communities.add(community);
}
}