//-------------------------------------------------< item factory methods >
private ItemImpl createItemInstance(ItemId id)
throws ItemNotFoundException, RepositoryException {
// create instance of item using its state object
ItemImpl item;
ItemState state;
try {
state = itemStateProvider.getItemState(id);
} catch (NoSuchItemStateException nsise) {
throw new ItemNotFoundException(id.toString());
} catch (ItemStateException ise) {
String msg = "failed to retrieve item state of item " + id;
log.error(msg, ise);
throw new RepositoryException(msg, ise);
}
if (id.equals(rootNodeId)) {
// special handling required for root node
item = createNodeInstance((NodeState) state, rootNodeDef);
} else if (state.isNode()) {
item = createNodeInstance((NodeState) state);
} else {
item = createPropertyInstance((PropertyState) state);
}
return item;