}
return list;
}
protected Resource createDynamicResource(ResourceKey resourceKey, boolean useDependencyInjection) {
Resource result = null;
Map<String, String> params = null;
MappedResourceData mappedResourceData = mappedResourceDataMap.get(resourceKey);
ResourceKey actualKey;
if (mappedResourceData != null) {
actualKey = mappedResourceData.getResourceKey();
if (useDependencyInjection) {
params = mappedResourceData.getParams();
}
} else {
actualKey = resourceKey;
if (useDependencyInjection) {
params = Collections.<String, String>emptyMap();
}
}
if (Strings.isNullOrEmpty(resourceKey.getResourceName())) {
return null;
}
if (actualKey.getResourceName().endsWith(".ecss")) {
// TODO nick - params?
result = createCompiledCSSResource(actualKey);
} else {
result = createHandlerDependentResource(actualKey, params);
}
if (result != null) {
result.setLibraryName(resourceKey.getLibraryName());
result.setResourceName(resourceKey.getResourceName());
} else if (mappedResourceData != null) {
result = defaultHandler.createResource(actualKey.getResourceName(), actualKey.getLibraryName());
}
return result;