if (uri == null) {
return (T)unresolved;
}
// Lookup the artifact
Artifact resolved = (Artifact) map.get(uri);
if (resolved != null) {
return modelClass.cast(resolved);
}
// If not found, delegate the resolution to the imports (in this case based on the resource imports)
for (Import import_ : this.contribution.getImports()) {
if (import_ instanceof ResourceImport) {
ResourceImport resourceImport = (ResourceImport)import_;
//check the import location against the computed package name from the componentType URI
if ((resourceImport.getURI().equals(uri)) &&
(resourceImport.getModelResolver() != null)){
// Delegate the resolution to the import resolver
resolved = resourceImport.getModelResolver().resolveModel(Artifact.class, (Artifact)unresolved, context);
if (!resolved.isUnresolved()) {
return modelClass.cast(resolved);
}
}
}
}