{
resources = resMgr.findResources(resourcePattern);
}
catch (ResourceMgrException e)
{
throw new ModelException("MissingItemTypeDescriptors", "No item type files found matching '" + resourcePattern + "'.");
}
if (resources.length == 0)
throw new ModelException("MissingItemTypeDescriptors", "No item type files found matching '" + resourcePattern + "'.");
XMLDriver driver = XMLDriver.getInstance();
ItemTypeDescriptor itd;
for (int i = 0; i < resources.length; i++)
{
// Deserialize item descriptor file
try
{
itd = (ItemTypeDescriptor) driver.deserializeResource(ItemTypeDescriptor.class, resources[i]);
}
catch (XMLDriverException pe)
{
throw new ModelException("Initialization", "Error reading component type descriptor resource '" + resources[i].getDescription()
+ "': " + pe.getMessage());
}
// Add the item to the model
addItemTypeDescriptor(itd);