return new CompositeReader(readers);
} else {
return null;
}
} else {
ScriptResource resource = getResource(resourceId);
if (resource != null) {
List<Module> modules = new ArrayList<Module>(resource.getModules());
Collections.sort(modules, MODULE_COMPARATOR);
ArrayList<Reader> readers = new ArrayList<Reader>(modules.size() * 2);
StringBuilder buffer = new StringBuilder();
//
boolean isModule = FetchMode.ON_LOAD.equals(resource.getFetchMode());
if (isModule) {
JSONArray deps = new JSONArray();
LinkedList<String> params = new LinkedList<String>();
List<String> argNames = new LinkedList<String>();
List<String> argValues = new LinkedList<String>(params);
for (ResourceId id : resource.getDependencies()) {
ScriptResource dep = getResource(id);
if (dep != null) {
Set<DepInfo> depInfos = resource.getDepInfo(id);
for (DepInfo info : depInfos) {
String pluginRS = info.getPluginRS();
String alias = info.getAlias();
if (alias == null) {
alias = dep.getAlias();
}
deps.put(parsePluginRS(dep.getId().toString(), pluginRS));
params.add(encode(params, alias));
argNames.add(parsePluginRS(alias, pluginRS));
}
} else if (RESERVED_MODULE.contains(id.getName())) {
String reserved = id.getName();