// check the configuration information before making a factory
if( isResolvableType( element, resolve ) &&
isTargetTypeSupported(element, adapter)){
// Use the extension point information as a quick sanity check to ensure
// the factory is relevant to the problem at hand
IResolveAdapterFactory factory = getResolveAdapterFactory( entry );
if( factory.canAdapt( resolve, adapter)){
// we think we can do this one...
IProgressMonitor subMonitor = SubMonitor.convert(monitor, factory.getClass().getCanonicalName(), 10 );
Object value = factory.adapt( resolve, adapter, subMonitor );
if( value != null ){
return adapter.cast( value );
}
}
else {
monitor.worked(10);
}
}
else {
monitor.worked(10);
}
}
catch( RuntimeException ignore ){
// problem encountered with entry; depending
// on the problem we may consider disabling the entry
// and logging a warning?
CatalogPlugin.log( ignore.getLocalizedMessage(), ignore );
}
}
// Go through registered factories second, ensuring that
// XML can always override something that has been hard coded
//
for( IResolveAdapterFactory factory : registeredFactories ) {
try {
Set<Class<?>> ignoreSet = exceptions.get(factory);
if( ignoreSet != null && ignoreSet.contains(adapter) ){
monitor.worked(10);
continue; // skip this as it is listed as an exception
}
if( factory.canAdapt( resolve, adapter)){
// we think we can do this one...
IProgressMonitor subMonitor = SubMonitor.convert(monitor, factory.getClass().getCanonicalName(), 10 );
Object value = factory.adapt( resolve, adapter, subMonitor );
if( value != null ){
return adapter.cast( value );
}
}
else {