String className, String qualifiedPropertyName)
{
// Equivalent AS:
//
// var eventDispatcher:IEventDispatcher = ${bindableInfo.className}.staticEventDispatcher;
MemberExpressionNode base = AbstractSyntaxTreeUtil.generateGetterSelector(nodeFactory, className, false);
IdentifierNode staticEventDispatcherIdentifier = nodeFactory.identifier(STATIC_EVENT_DISPATCHER, false);
GetExpressionNode selector = nodeFactory.getExpression(staticEventDispatcherIdentifier);
MemberExpressionNode rvalue = nodeFactory.memberExpression(base, selector);
VariableDefinitionNode variableDefinition =
AbstractSyntaxTreeUtil.generateVariable(nodeFactory, EVENT_DISPATCHER_VAR,
FLASH_EVENTS, I_EVENT_DISPATCHER,
false, rvalue);
outerThen = nodeFactory.statementList(outerThen, variableDefinition);
ListNode test = generateEventDispatcherNotNull(nodeFactory);
// Equivalent AS:
//
// eventDispatcher.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(${bindableInfo.className}, "$entry.qualifiedPropertyName", oldValue, value));
IdentifierNode dispatchEventIdentifier = nodeFactory.identifier(DISPATCH_EVENT, false);
MemberExpressionNode propertyChangeEventMemberExpression =
AbstractSyntaxTreeUtil.generateGetterSelector(nodeFactory, MX_EVENTS, PROPERTY_CHANGE_EVENT, false);;
IdentifierNode createUpdateEventIdentifier = nodeFactory.identifier(CREATE_UPDATE_EVENT, false);
MemberExpressionNode getterSelector =
AbstractSyntaxTreeUtil.generateGetterSelector(nodeFactory, className, false);
ArgumentListNode createUpdateEventArgumentList = nodeFactory.argumentList(null, getterSelector);
LiteralStringNode literalString = nodeFactory.literalString(qualifiedPropertyName);
createUpdateEventArgumentList = nodeFactory.argumentList(createUpdateEventArgumentList, literalString);
MemberExpressionNode oldValueMemberExpression =
AbstractSyntaxTreeUtil.generateGetterSelector(nodeFactory, OLD_VALUE, false);
createUpdateEventArgumentList =
nodeFactory.argumentList(createUpdateEventArgumentList, oldValueMemberExpression);
MemberExpressionNode valueMemberExpression =
AbstractSyntaxTreeUtil.generateGetterSelector(nodeFactory, VALUE, false);
createUpdateEventArgumentList =
nodeFactory.argumentList(createUpdateEventArgumentList, valueMemberExpression);
CallExpressionNode createUpdateEventCallExpression =
(CallExpressionNode) nodeFactory.callExpression(createUpdateEventIdentifier, createUpdateEventArgumentList);
createUpdateEventCallExpression.setRValue(false);
MemberExpressionNode createUpdateEventMemberExpression =
nodeFactory.memberExpression(propertyChangeEventMemberExpression, createUpdateEventCallExpression);
ArgumentListNode dispatchEventArgumentList =
nodeFactory.argumentList(null, createUpdateEventMemberExpression);
CallExpressionNode dispatchEventCallExpression =
(CallExpressionNode) nodeFactory.callExpression(dispatchEventIdentifier, dispatchEventArgumentList);
dispatchEventCallExpression.setRValue(false);
MemberExpressionNode eventDispatcherMemberExpression =
AbstractSyntaxTreeUtil.generateGetterSelector(nodeFactory, EVENT_DISPATCHER_VAR, false);
MemberExpressionNode memberExpression =
nodeFactory.memberExpression(eventDispatcherMemberExpression, dispatchEventCallExpression);
ListNode list = nodeFactory.list(null, memberExpression);
ExpressionStatementNode expressionStatement =
nodeFactory.expressionStatement(list);
StatementListNode then = nodeFactory.statementList(null, expressionStatement);