if( name == null )
{
throw new AssemblyException( "Layer must have name set" );
}
ActivatorsModel<Layer> layerActivators = new ActivatorsModel<>( layerAssembly.activators() );
LayerModel layerModel = new LayerModel( name, layerAssembly.metaInfo(), usedLayersModel, layerActivators, moduleModels );
for( ModuleAssemblyImpl moduleAssembly : layerAssembly.moduleAssemblies() )
{
moduleModels.add( moduleAssembly.assembleModule( helper ) );
}
mapAssemblyModel.put( layerAssembly, layerModel );
layerModels.add( layerModel );
}
// Populate used layer lists
for( LayerAssemblyImpl layerAssembly : layerAssemblies )
{
Set<LayerAssembly> usesLayers = layerAssembly.uses();
List<LayerModel> usedLayers = mapUsedLayers.get( layerAssembly );
for( LayerAssembly usesLayer : usesLayers )
{
LayerModel layerModel = mapAssemblyModel.get( usesLayer );
usedLayers.add( layerModel );
}
}
// Bind model