*/
protected Item readItemDescriptor(Model model, ItemTypeDescriptor itd, Resource itemDescriptorResource)
{
XMLDriver driver = XMLDriver.getInstance();
Item item = null;
// Deserialize item descriptor file
try
{
if (itd.isContainedItem())
{
// Item is wrapped by a container class in its xml file
ItemContainer container = (ItemContainer) driver.deserializeResource(ItemContainer.class, itemDescriptorResource);
item = container.getItem();
}
else
{
item = (Item) driver.deserializeResource(itd.getItemClass(), itemDescriptorResource);
}
}
catch (XMLDriverException pe)
{
getMsgContainer().addMsg(model, "Error reading component descriptor file $0 in model manager $1.", new Object[]
{
itemDescriptorResource.getDescription(), getClass().getName(), pe
});
return null;
}
// Explicitely make this item an item of the specified type
item.setItemType(itd.getItemType());
return item;
}