final DependencyDirective[] roles = blockEntry.getTemplate()
.getDependencies();
for( int i = 0; i < roles.length; i++ )
{
final DependencyDirective role = roles[ i ];
final Object dependency = m_application.getBlock(
role.getProviderName() );
final String key = role.getKey();
final DependencyDescriptor candidate =
info.getDependency( key );
if( candidate.isArray() )
{
ArrayList list = (ArrayList)sets.get( key );
if( null == list )
{
list = new ArrayList();
sets.put( key, list );
}
list.add( dependency );
}
else if( candidate.isMap() )
{
HashMap smap = (HashMap)sets.get( key );
if( null == smap )
{
smap = new HashMap();
sets.put( key, smap );
}
smap.put( role.getAlias(), dependency );
}
else
{
map.put( key, dependency );
}