Examples of BindingExpression


Examples of flex2.compiler.mxml.rep.BindingExpression

             */
            CDATANode cdata = (CDATANode)node.getChildAt(0);

            if (cdata.image.length() > 0)
            {
                BindingExpression be = textParser.parseBindingExpression(cdata.image, cdata.beginLine);

                if (be != null)
                {
                    if (allowTopLevelBinding)
                    {
                        if (!be.isTwoWayPrimary() || allowTwoWayBind)
                        {
                            be.setDestination(xml);
                            writer.write("null");
                        }
                        else
                        {
                            log(cdata, new AbstractBuilder.TwoWayBindingNotAllowed());
View Full Code Here

Examples of flex2.compiler.mxml.rep.BindingExpression

                else
                {
                    attrExpr = getElementsByLocalName + ".attributes[\"" + attrName.getLocalPart() + "\"]";
                }

                BindingExpression be = attributeBindings.get(attrName);

                be.setDestinationE4X(e4x);
                be.setDestinationXMLAttribute(true);
                be.setDestinationLValue(attrExpr);
                be.setDestinationProperty(destinationProperty + "[" + node.getIndex() + "]");
                be.setDestination(xml);

                xml.setHasBindings(true);

                if (e4x)
                {
                    PrefixMapping.pushNamespaces(be, namespaces);
                    if (nsUri.length() > 0)
                    {
                        be.addNamespace(nsUri, nsId);
                    }
                }
            }
        }

        try
        {
            if (e4x)
            {
                node.toStartElement((StringWriter) serializer);
            }
            else
            {
                QName qname = new QName(node.getNamespace(), node.getLocalPart(), node.getPrefix());
                ((XMLStringSerializer) serializer).startElement(qname, new AttributesHelper(node));
            }

            if (node.getChildCount() == 1 && node.getChildAt(0) instanceof CDATANode)
            {
                CDATANode cdata = (CDATANode) node.getChildAt(0);
                if (cdata.image.length() > 0)
                {
                    if (cdata.inCDATA)
                    {
                        //in CDATA Section, leave exactly as is
                        if (e4x)
                        {
                            ((StringWriter) serializer).write("<![CDATA[" + cdata.image + "]]>");
                        }
                        else
                        {
                            ((XMLStringSerializer) serializer).writeString(cdata.image);
                        }                       
                    }
                    else
                    {
                        //not in CDATA section so extract bindings and cleanup binding escapes
                        BindingExpression be = textParser.parseBindingExpression(cdata.image, cdata.beginLine);
                        if (be != null)
                        {
                            if (be.isTwoWayPrimary() && !allowTwoWayBind)
                            {
                                log(cdata, new AbstractBuilder.TwoWayBindingNotAllowed());
                            }
                            else
                            {
                                String destinationProperty = createExpression(destinationPropertyStack);

                                be.setDestinationLValue(getElementsByLocalName);
                                be.setDestinationProperty(destinationProperty + "[" + node.getIndex() + "]");
                                be.setDestination(xml);
                                be.setDestinationXMLNode(true);

                                xml.setHasBindings(true);

                                if (e4x)
                                {
                                    be.setDestinationE4X(true);
                                    PrefixMapping.pushNamespaces(be, namespaces);
                                }
                            }
                        }
                        else if (e4x)
View Full Code Here

Examples of flex2.compiler.mxml.rep.BindingExpression

                        }                       
                    }
                    else
                    {
                        // We're not in CDATA section so extract bindings and cleanup binding escapes
                        BindingExpression be = textParser.parseBindingExpression(cdata.image, cdata.beginLine);
                        if (be != null)
                        {
                            if (be.isTwoWayPrimary() && !allowTwoWayBind)
                            {
                                log(cdata, new AbstractBuilder.TwoWayBindingNotAllowed());
                            }
                            else
                            {
                                be.setDestinationLValue(getElementsByLocalName + ".text()[" + (numCData - 1) + "]");
                                be.setDestinationProperty(destinationProperty + "[" + node.getIndex() + "]" + ".text()[" + i + "]" );
                                be.setDestination(xml);
                                be.setDestinationXMLNode(true);

                                xml.setHasBindings(true);

                                if (e4x)
                                {
                                    be.setDestinationE4X(true);
                                    PrefixMapping.pushNamespaces(be, namespaces);
                                }
                               
                                // Inject placeholder cdata child so we can target it
                                // with binding.
View Full Code Here

Examples of flex2.compiler.mxml.rep.BindingExpression

        for (Iterator<QName> i = node.getAttributeNames(); i != null && i.hasNext();)
        {
            QName qname = i.next();
            String value = (String) node.getAttributeValue(qname);

            BindingExpression be = textParser.parseBindingExpression(value, node.beginLine);

            if (be != null)
            {
                if (be.isTwoWayPrimary() && !allowTwoWayBind)
                {
                    log(node, new AbstractBuilder.TwoWayBindingNotAllowed());
                    continue;
                }
                                       
View Full Code Here

Examples of flex2.compiler.mxml.rep.BindingExpression

        ArgumentListNode argumentList = null;
        Iterator<BindingExpression> iterator = propertyWatcher.getBindingExpressions().iterator();

        while (iterator.hasNext())
        {
            BindingExpression bindingExpression = iterator.next();
            MemberExpressionNode base =
                AbstractSyntaxTreeUtil.generateGetterSelector(nodeFactory, BINDINGS, false);
            GetExpressionNode selector = generateArrayIndex(nodeFactory, bindingExpression.getId());
            selector.setMode(Tokens.LEFTBRACKET_TOKEN);
            MemberExpressionNode memberExpression = nodeFactory.memberExpression(base, selector);
            argumentList = nodeFactory.argumentList(argumentList, memberExpression);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.