Package flex2.compiler.util

Examples of flex2.compiler.util.QName


    {
        QNameMap<BindingExpression> attributeBindings = null;

        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)
View Full Code Here


    {
        final QNameMap<AtResource> attributeResources = new QNameMap<AtResource>();
       
        for (Iterator i = node.getAttributeNames(); i != null && i.hasNext();)
        {
            final QName qname = (QName)i.next();
            final String text = (String) node.getAttributeValue(qname);

            final String atFunction = TextParser.getAtFunctionName(text);
            if ("Resource".equals(atFunction))
            {
                //TODO I am assuming that this should always be a string type because this is
                //     XML, though @Resources allow things like Embed. I'm right?
                //TODO test an Embed and see what happens?
                final AtResource atResource
                    = (AtResource)textParser.resource(text, typeTable.stringType);
               
                if (atResource != null)
                {               
                    // C: only localPart as the key?
                    attributeResources.put(qname, atResource);
                   
                    // we don't remove these here since we don't want to reorder the attributes
                    // we also don't call addAttribute() to update the map to avoid a potential
                    // ConcurrentModificationException on the iterator
                    //i.remove();
                }
            }
            else if (atFunction != null)
            {
                // if we found an invalid @Function, throw an error
                textParser.desc = atFunction;
                textParser.line = node.beginLine;
                textParser.error(TextParser.ErrUnrecognizedAtFunction, null, null, null);
            }
        }
       
        // now update the definitions in the attribute map
        for(Iterator<QName> iter = attributeResources.keySet().iterator(); iter.hasNext();)
        {
            final QName qname = iter.next();
            final AtResource atResource = attributeResources.get(qname);
           
            // attributes are in a LinkedHashMap, so this just updates the existing mapping
            // with the qname -> AtResource. When Element.toStartElement() is emitting the
            // attribute's value, it will notice the special case of an AtResource object
            // (instead of String) and emit an E4X expression with braces rather than a
            // String with double-quotes.
            node.addAttribute(qname.getNamespace(), qname.getLocalPart(), atResource, node.beginLine);
        }
    }
View Full Code Here

    private Boolean hasStateSpecificAttributes(Node node)
    {
      for (Iterator<QName> attributes = node.getAttributeNames();
          attributes != null && attributes.hasNext();)
      {
        QName qname = attributes.next();
        String localPart = qname.getLocalPart();
        if (TextParser.isScopedName(localPart))
            return true;
     
      return false;
    }
View Full Code Here

   */
  public Value evaluate(Context context, FunctionDefinitionNode node)
  {
    if (inClass)
    {
      QName qname = new QName(NodeMagic.getUserNamespace(node), NodeMagic.getFunctionName(node));
      GenerativeClassInfo.AccessorInfo accessorInfo = bindableInfo.getAccessor(qname);

      if (accessorInfo instanceof GetterSetterInfo)
      {
        if (NodeMagic.functionIsSetter(node))
        {
          hideFunction(node, accessorInfo);
          registerRenamedAccessor(accessorInfo);
                    ((GetterSetterInfo) accessorInfo).setSetterInfo(node);
        }
                else
                {
                    ((GetterSetterInfo) accessorInfo).setGetterInfo(node);

                    if (!bindableInfo.getClassInfo().definesSetter(qname.getLocalPart(), false))
                    {
                        context.localizedError2(node.pos(), new MissingNonInheritedSetter(qname.getLocalPart()));
                    }
                }
      }
    }

View Full Code Here

   */
  public Value evaluate(Context context, VariableDefinitionNode node)
  {
    if (inClass)
    {
      QName qname = new QName(NodeMagic.getUserNamespace(node), NodeMagic.getVariableName(node));
      GenerativeClassInfo.AccessorInfo accessorInfo = bindableInfo.getAccessor(qname);
      if (accessorInfo != null)
      {
        hideVariable(node, accessorInfo);
        registerRenamedAccessor(accessorInfo);
View Full Code Here

                    {
                        //turn it into a Primitive with properties
                        Primitive p = new Primitive(document, getPrimitiveType(typeTable, value), value, cdata.beginLine);
                        for (Iterator i = node.getAttributeNames(); i.hasNext();)
                        {
                            QName propName = (QName)i.next();
                            p.setProperty(propName.getLocalPart(), node.getAttributeValue(propName), node.getLineNumber(propName));
                        }
                        value = p;
                    }
                    return value;
                }
View Full Code Here

    private void processAttributes(Node node, Model model)
    {
        for (Iterator i = node.getAttributeNames(); i != null && i.hasNext();)
        {
            QName qname = (QName)i.next();
      String text = (String)node.getAttributeValue(qname);
            String localPart = qname.getLocalPart();
      int line = node.getLineNumber(qname);

            processDynamicPropertyText(localPart, text, AbstractBuilder.TextOrigin.FROM_ATTRIBUTE, line, model, null);
        }
    }
View Full Code Here

    {
        Map<String, Integer> counts = new HashMap<String, Integer>();

        for (Iterator i = node.getAttributeNames(); i != null && i.hasNext();)
        {
            QName qname = (QName)i.next();

            String namespaceURI = qname.getNamespace();
            String localPart = qname.getLocalPart();
            if (SymbolTable.OBJECT.equals(localPart) && namespaceURI.length() == 0)
            {
                continue;
            }
View Full Code Here

        {
            Iterator<QName> iterator = functions.iterator();

            while ( iterator.hasNext() )
            {
                QName qName = iterator.next();
                if ( functionName.equals( qName.getLocalPart() ) )
                {
                    result = true;
                }
            }
        }
View Full Code Here

        {
            Iterator<QName> iterator = getters.iterator();

            while ( iterator.hasNext() )
            {
                QName qName = iterator.next();
                if ( getterName.equals( qName.getLocalPart() ) )
                {
                    result = true;
                }
            }
        }
View Full Code Here

TOP

Related Classes of flex2.compiler.util.QName

Copyright © 2018 www.massapicom. 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.