После того, как я принял решение от RIAstar, именно это я и сделал (и компилятор Flex 3.5, и код компилятора 4.6)
Компилятор Flex 3.5, использующий as3corelib.swc для JSON
import com.adobe.serialization.json.JSON;
private var temp:String ='{"workflow":{ "template":"HeapDumpAnalysis", "start":{ "instance":"HDA_run1", "user":"symtest", "date":"3-Mar-2012", "timestamp":"1330948220475" }, "host":{ "name":"estilo", "user":"symtest1", "password":"symtest1", "installpath":"", "product":"" }, "javadump":{ "pid":"8989", "corefilename":"", "heapdump":"", "stack":"", "INFA_HOME":"" }, "mat":{ }, "email":{ "to":"vsatwik@informatica.com", "subject":"", "message":"" }, "end":{ }}}';
private function test():void
{
var obj = JSON.decode(temp);
var workflow:Object = obj.workflow;
for (var key:String in workflow) {
trace(key + ': ' + workflow[key] + (key is String) + ", " + (workflow[key] is String));
}
}
output
javadump: [object Object]true, false
template: HeapDumpAnalysistrue, true
host: [object Object]true, false
end: [object Object]true, false
mat: [object Object]true, false
email: [object Object]true, false
start: [object Object]true, false
Компилятор Flex 4.6 с использованием собственного анализа Json
private var temp:String ='{"workflow":{ "template":"HeapDumpAnalysis", "start":{ "instance":"HDA_run1", "user":"symtest", "date":"3-Mar-2012", "timestamp":"1330948220475" }, "host":{ "name":"estilo", "user":"symtest1", "password":"symtest1", "installpath":"", "product":"" }, "javadump":{ "pid":"8989", "corefilename":"", "heapdump":"", "stack":"", "INFA_HOME":"" }, "mat":{ }, "email":{ "to":"ars@gmail.com", "subject":"", "message":"" }, "end":{ }}}';
private function test():void
{
var result:Object = JSON.parse(temp);
var workflow:Object = result.workflow;
for (var key:String in workflow) {
trace(key + ': ' + workflow[key] + (key is String) + ", " + (workflow[key] is String));
}
}
output
javadump: [object Object]true, false
mat: [object Object]true, false
end: [object Object]true, false
email: [object Object]true, false
host: [object Object]true, false
start: [object Object]true, false
template: HeapDumpAnalysistrue, true