*
* @param node node represents Resource compiler directive in MXML
*/
void processMXMLResource(IMXMLResourceNode node, Context context)
{
ITypeDefinition type = node.getType();
FlexProject project = getProject();
try
{
String bundleName = node.getBundleName();
String key = node.getKey();
if(bundleName != null && key != null)
{
//compilation unit of the file that has the compiler directive
final ICompilationUnit refCompUnit = project.getScope(
).getCompilationUnitForScope(((NodeBase)node).getASScope());
assert refCompUnit != null;
ResourceBundleUtils.resolveDependencies(bundleName, refCompUnit, project, node, getProblems());
}
}
catch(InterruptedException ie)
{
throw new CodegenInterruptedException(ie);
}
//Based on the type of the identifier which its value is set with this compiler
//directive, we are figuring out which method we need to call on ResourceManager instance.
String methodName = null;
if (type.isInstanceOf((ITypeDefinition)project.getBuiltinType(
BuiltinType.STRING), project))
{
methodName = "getString";
}
else if (type.isInstanceOf((ITypeDefinition)project.getBuiltinType(
BuiltinType.BOOLEAN), project))
{
methodName = "getBoolean";
}
else if (type.isInstanceOf((ITypeDefinition)project.getBuiltinType(
BuiltinType.NUMBER), project))
{
methodName = "getNumber";
}
else if (type.isInstanceOf((ITypeDefinition)project.getBuiltinType(
BuiltinType.INT), project))
{
methodName = "getInt";
}
else if (type.isInstanceOf(project.getBuiltinType(
BuiltinType.UINT).resolveType(project), project))
{
methodName = "getUint";
}
else if (type.isInstanceOf((ITypeDefinition)project.getBuiltinType(
BuiltinType.CLASS), project))
{
methodName = "getClass";
}
else if (type.isInstanceOf((ITypeDefinition)project.getBuiltinType(
BuiltinType.ARRAY), project))
{
methodName = "getStringArray";
}
else