Class<?>[] classes = modelType.getInterfaces();
for (Class<?> c : classes) {
Class<? extends ModelResolver> resolver = resolvers.get(c);
if (resolver == null) {
ServiceDeclaration resolverClass = loadedResolvers.get(c.getName());
if (resolverClass != null) {
try {
return (Class<? extends ModelResolver>)resolverClass.loadClass();
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
}
} else {
return resolver;
}
}
Class<? extends ModelResolver > resolver = resolvers.get(modelType);
if (resolver == null) {
ServiceDeclaration resolverClass = loadedResolvers.get(modelType.getName());
if (resolverClass != null) {
try {
return (Class<? extends ModelResolver>)resolverClass.loadClass();
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
}
}