}
else
{
if (!isDataboundProp(propertyNode))
{
IDefinition propDef = propertyNode.getDefinition();
if (propDef.isPublic())
{
context.startUsing(IL.PROPERTIES);
context.addInstruction(OP_pushstring, propertyName);
context.isContentFactory = false;
traverse(propertyNode, context);
context.stopUsing(IL.PROPERTIES, 1);
}
else
{
Context tempContext = new Context(classDefinitionNode, iinitForNonPublicProperties);
tempContext.nonPublic = true;
// Push the object on which the property is to be set.
tempContext.pushTarget();
// Push the property value.
// Do this by codegen'ing sole child, which is an IMXMLInstanceNode.
traverse(propertyNode, tempContext);
Name n = ((DefinitionBase)propDef).getMName(getProject());
tempContext.addInstruction(OP_setproperty, n);
}
}
else
{
IMXMLInstanceNode instanceNode = propertyNode.getInstanceNode();
if (instanceNode instanceof IMXMLSingleDataBindingNode)
processMXMLDataBinding((IMXMLSingleDataBindingNode)instanceNode, context);
else if (instanceNode instanceof IMXMLConcatenatedDataBindingNode)
processMXMLConcatenatedDataBinding((IMXMLConcatenatedDataBindingNode)instanceNode, context);
}
}
return;
}
boolean isDb = isDataboundProp(propertyNode);
if (generateDescriptorCode(propertyNode, context))
{
if (!isDb)
{
context.startUsing(IL.DESCRIPTOR_PROPERTIES);
context.addInstruction(OP_pushstring, propertyName);
traverse(propertyNode, context);
context.stopUsing(IL.DESCRIPTOR_PROPERTIES, 1);
}
else
{
IMXMLInstanceNode instanceNode = propertyNode.getInstanceNode();
if (instanceNode instanceof IMXMLSingleDataBindingNode)
processMXMLDataBinding((IMXMLSingleDataBindingNode)instanceNode, context);
else if (instanceNode instanceof IMXMLConcatenatedDataBindingNode)
processMXMLConcatenatedDataBinding((IMXMLConcatenatedDataBindingNode)instanceNode, context);
}
}
if (generateNonDescriptorCode(propertyNode, context))
{
context.startUsing(IL.PROPERTIES);
if (propertyNode.getParent().getNodeID() == ASTNodeID.MXMLObjectID)
{
// TODO This case presuambly also needs
// some logic involving isDb.
// Push the property name.
context.addInstruction(OP_pushstring, propertyName);
// Push the property value.
// Do this by codegen'ing sole child, which is an IMXMLInstanceNode.
traverse(propertyNode, context);
}
else
{
// Push the object on which the property is to be set.
if (!isDb)
context.pushTarget();
// Push the property value.
// Do this by codegen'ing sole child, which is an IMXMLInstanceNode.
traverse(propertyNode, context);
// Set the property.
// unless it's a databinding, then the property is set indiretly
if (!isDb)
{
IDefinition def = propertyNode.getDefinition();
Name n = ((DefinitionBase)def).getMName(getProject());
context.addInstruction(OP_setproperty, n);
}
}