use of org.apache.jackrabbit.spi.ChildInfo in project jackrabbit by apache.
the class ItemInfoJsonHandler method endObject.
public void endObject() throws IOException {
try {
NodeInfoImpl nInfo = (NodeInfoImpl) nodeInfos.pop();
List<PropertyInfoImpl> props = propInfoLists.pop();
// all required information to create a node info should now be gathered
nInfo.setPropertyInfos(props.toArray(new PropertyInfoImpl[props.size()]), idFactory);
NodeInfo parent = getCurrentNodeInfo();
if (parent != null) {
if (nInfo.getPath().getAncestor(1).equals(parent.getPath())) {
ChildInfo ci = new ChildInfoImpl(nInfo.getName(), nInfo.getUniqueID(), nInfo.getIndex());
((NodeInfoImpl) parent).addChildInfo(ci);
} else {
log.debug("NodeInfo '" + nInfo.getPath() + "' out of hierarchy. Parent path = " + parent.getPath());
}
}
if (nInfo.isCompleted()) {
itemInfos.addAll(props);
itemInfos.add(nInfo);
} else {
log.debug("Incomplete NodeInfo '" + nInfo.getPath() + "' -> Only present as ChildInfo with its parent.");
}
} catch (RepositoryException e) {
throw new IOException(e.getMessage());
} finally {
// reset all node-related handler state
name = null;
index = Path.INDEX_DEFAULT;
}
}
Aggregations