*/
private static AtEmbed createResolved(ContextStatics perCompileData, Source source, String value, String path, int line, String prefix, boolean logInvalidEmbedOnMissingFile)
{
AtEmbed result = null;
MetaData metaData = MetaDataParser.parse(perCompileData, source, line, value);
String sourceValue = null;
Map<String, Object> values = new HashMap<String, Object>();
// Embed("foo.swf", "barSymbol", ...) or Embed("foo", "image/png", ...)
if ((metaData.count() > 1) && (metaData.getKey(0) == null) && (metaData.getKey(1) == null))
{
sourceValue = metaData.getValue(0);
String symbolOrMimeType = metaData.getValue(1);
if (MimeMappings.getExtension(symbolOrMimeType) != null)
{
values.put(Transcoder.MIMETYPE, symbolOrMimeType);
}
else
{
values.put(Transcoder.SYMBOL, symbolOrMimeType);
}
}
// Embed("foo.png", ...)
else if ((metaData.count() > 0) && (metaData.getKey(0) == null))
{
sourceValue = metaData.getValue(0);
}
// Embed(skinClass="foo", source="bar.swc")
else if ((metaData.getValue(Transcoder.SKINCLASS) != null) &&
(metaData.getValue(Transcoder.SOURCE) != null))
{
logSkinClassWithSourceNotSupported(value, path, line);
}
// Embed(skinClass="foo")
else if (metaData.getValue(Transcoder.SKINCLASS) != null)
{
String skinClass = metaData.getValue(Transcoder.SKINCLASS);
}
// Embed(source="foo.png")
else
{
sourceValue = metaData.getValue(Transcoder.SOURCE);
}
// logInvalidEmbedOnMissingFile - if 'true', we will logInvalidEmbed(), however
// in certain scenarios the caller needs to log a different error, so they pass 'false'.
if (((sourceValue != null) &&
tokenizeAndResolveSource(sourceValue, values, source, value, path, line, logInvalidEmbedOnMissingFile)) ||
(metaData.getValue(Transcoder.SKINCLASS) != null))
{
for (Iterator it = metaData.getValueMap().entrySet().iterator(); it.hasNext();)
{
Map.Entry e = (Map.Entry) it.next();
String key = (String) e.getKey();
if (!values.containsKey(key))