{
for ( Iterator i = sharedFlowRefs.iterator(); i.hasNext(); )
{
AnnotationInstance sharedFlowRef = ( AnnotationInstance ) i.next();
String name = CompilerUtils.getString( sharedFlowRef, NAME_ATTR, true );
TypeInstance type = CompilerUtils.getTypeInstance( sharedFlowRef, TYPE_ATTR, true );
if ( type instanceof DeclaredType ) // if it's not a DeclaredType, the error will be caught elsewhere.
{
TypeDeclaration typeDecl = ( ( DeclaredType ) type ).getDeclaration();
if ( typeDecl != null ) // If the declaration is null, it's an error type.
{
_sharedFlowTypes.put( name, typeDecl );
}
}
}
}
//
// If there's no SharedFlowController, fall back to the deprecated Global.app.
//
if ( _sharedFlowTypes.isEmpty() )
{
TypeDeclaration type = env.getTypeDeclaration( GLOBALAPP_FULL_CLASSNAME );
if ( type != null ) _sharedFlowTypes.put( GLOBALAPP_SHARED_FLOW_NAME, type );
}
_sharedFlowTypeNames = new LinkedHashMap();
_sharedFlowFiles = new LinkedHashMap();
for ( Iterator i = _sharedFlowTypes.entrySet().iterator(); i.hasNext(); )
{
Map.Entry entry = ( Map.Entry ) i.next();
TypeDeclaration type = ( TypeDeclaration ) entry.getValue();
_sharedFlowTypeNames.put( entry.getKey(), type.getQualifiedName() );
File file = CompilerUtils.getSourceFile( type, false );
if ( file != null )
{
_sharedFlowFiles.put( entry.getKey(), file );