if (metaModel.getHandle().equals(key.getElement())) {
List<Map<String, Serializable>> value = (List<Map<String, Serializable>>)added.get("value");
Integer maxAge = (Integer)added.get("maxAge");
//
AssetsMetaModel assetsMetaModel = metaModel.getChild(AssetsMetaModel.KEY);
assetsMetaModel.removeAssets("module");
ArrayList<Asset> list = new ArrayList<Asset>();
for (Map<String, Serializable> a : value) {
HashMap<String, Serializable> asset = new HashMap<String, Serializable>(a);
if (asset.get("location") == null) {
asset.put("location", AssetLocation.APPLICATION.name());
}
if (asset.get("maxAge") == null && maxAge != null) {
asset.put("maxAge", maxAge);
}
if (asset.get("id") == null) {
asset.put("id", asset.get("value"));
}
List<String> aliases = (List<String>)a.get("aliases");
String adapter = (String)a.get("adapter");
list.add(new ModuleAsset(asset, adapter, aliases));
}
//
for (Asset asset : list) {
assetsMetaModel.addAsset(asset);
}
//
assetsMetaModel.addAsset(REQUIRE_JS);
}
}