Implements org::jfree::resourceloader::ResourceFactory. Definition at line 173 of file AbstractResourceFactory.java. References org::jfree::resourceloader::factory::FactoryModule::canHandleResource(), and org::jfree::resourceloader::factory::AbstractResourceFactory::factoryModules. { final TreeSet sortedEntries = new TreeSet(); final Iterator factoryModulesIt = factoryModules.iterator(); while (factoryModulesIt.hasNext()) { final FactoryModule mod = (FactoryModule) factoryModulesIt.next(); final int weight = mod.canHandleResource(manager, data); if (weight >= 0) { sortedEntries.add(new ResourceFactoryEntry(mod, weight)); } } final Iterator it = sortedEntries.iterator(); while (it.hasNext()) { final ResourceFactoryEntry entry = (ResourceFactoryEntry) it.next(); try { return entry.getModule().create(manager, data, context); } catch(Exception ex) { // ok, that one failed, try the next one ... } } throw new ContentNotRecognizedException ("No valid handler for the given content."); }
|