Package flex2.compiler.util

Examples of flex2.compiler.util.QName


           
            //Search through all parent classes and implemented interfaces
            Iterator iter = inheritance.iterator();
           
            CommentsTable baseClassObj = null;
            QName baseClass = null;
            while (iter.hasNext()){
                QName nextClass = (QName)iter.next();
                CommentsTable t = classTable.get(NameFormatter.toDot(nextClass));
               
                if(restoreBuiltinClasses && t == null && nextClass.getNamespace().equals(QName.DEFAULT_NAMESPACE) && !"Object_ASDoc".equals(abcClass.getName()))
                {
                    nextClass = new QName(QName.DEFAULT_NAMESPACE, nextClass.getLocalPart() + "_ASDoc");
                    t = classTable.get(NameFormatter.toDot(nextClass));
                }
               
                if (t != null)
                {
                    if(!t.isInterface())
                    {
                        baseClassObj = t;
                        baseClass = nextClass;
                        continue;
                    }
                   
                    //retrieve inherited Documentation.
                    //Special case for class definition comments
                    if (key.type == DocComment.CLASS)
                        inheritDoc = t.getCommentForInherit(new KeyPair(nextClass.getLocalPart(), DocComment.CLASS));
                    else 
                        inheritDoc = t.getCommentForInherit(key);
                }
                if (inheritDoc != null)
                    break;
View Full Code Here


    return packageName;
  }

    public QName getQName()
    {
        return qname != null ? qname : (qname = new QName(packageName, className));
    }
View Full Code Here

    public InterfaceInfo analyzeInterface(Context context, MultiName multiName, Info info)
    {
        InterfaceInfo interfaceInfo = null;

        QName qName = findQName(multiName);

        if (qName != null)
        {
            Source source = symbolTable.findSourceByQName(qName);

            interfaceInfo = interfaceInfoMap.get( qName.toString() );

            if (interfaceInfo == null)
            {
                CompilationUnit compilationUnit = source.getCompilationUnit();

                if (compilationUnit != null)
                {
                    AbcClass abcClass = compilationUnit.classTable.get( qName.toString() );

                    if (abcClass != null)
                    {
                        buildInterfaceInfo(context, qName, abcClass);
                    }
                    else
                    {
                        Node node = getNode(compilationUnit);

                        if (node != null)
                        {
                            Info oldInfo = currentInfo;
                            currentInfo = null;                           
                            node.evaluate(context, this);
                            currentInfo = oldInfo;
                        }
                        else
                        {
                            assert false : "Compilation unit had no type info and after parsing has no syntax tree";
                        }
                    }
                }

                interfaceInfo = interfaceInfoMap.get( qName.toString() );
            }

            // The interfaceInfo can be null if there was a missing import.
            if (interfaceInfo != null)
            {
View Full Code Here

     */
    public ClassInfo analyzeClass(Context context, MultiName multiName)
    {
        ClassInfo classInfo = null;

        QName qName = findQName(multiName);

        if (qName != null)
        {
            classInfo = classInfoMap.get( qName.toString() );

            if (classInfo == null)
            {
                Source source = symbolTable.findSourceByQName(qName);

                assert source != null : "no source for qname '" + qName + "', even though multiname was resolved";

                CompilationUnit compilationUnit = source.getCompilationUnit();

                AbcClass abcClass = compilationUnit.classTable.get( qName.toString() );

                if (abcClass != null)
                {
                    buildClassInfo(context, qName, abcClass);
                }
                else
                {
                    Node node = getNode(compilationUnit);

                    if (node != null)
                    {
                        Info oldInfo = currentInfo;
                        currentInfo = null;
                        node.evaluate(context, this);
                        currentInfo = oldInfo;
                    }
                    else if (Trace.error)
                    {
                        // This can happen when an error, like base class not found, happens.
                        Trace.trace("Compilation unit had no type info and after parsing has no syntax tree: qname = '" +
                                    qName.toString() + "'");
                    }
                }

                classInfo = classInfoMap.get( qName.toString() );
            }
        }
        else
        {
            if (Trace.binding)
View Full Code Here

        return classInfo;
    }

    private void analyzeBaseInterface(Context context, MultiName multiName, InterfaceInfo interfaceInfo)
    {
        QName qName = findQName(multiName);

        if (qName != null)
        {
            Source source = symbolTable.findSourceByQName(qName);

            InterfaceInfo baseInterfaceInfo = interfaceInfoMap.get( qName.toString() );

            if (baseInterfaceInfo == null)
            {
                CompilationUnit compilationUnit = source.getCompilationUnit();

                AbcClass abcClass = null;

                if (compilationUnit != null)
                {
                    abcClass = compilationUnit.classTable.get( qName.toString() );

                    if (abcClass != null)
                    {
                        buildInterfaceInfo(context, qName, abcClass);
                    }
                }

                if (abcClass == null)
                {
                    Node node = getNode(compilationUnit);
                   
                    if (node != null)
                    {
                        Info oldInfo = currentInfo;
                        currentInfo = null;
                        node.evaluate(context, this);
                        currentInfo = oldInfo;
                    }
                    else
                    {
                        assert false : "Compilation unit had no type info and after parsing has no syntax tree";
                    }
                }

                baseInterfaceInfo = interfaceInfoMap.get( qName.toString() );
            }

            // The baseInterfaceInfo can be null if there was a missing import.
            if (baseInterfaceInfo != null)
            {
View Full Code Here

        Iterator<Method> get_iter = abcClass.getGetterIterator();

        while(get_iter.hasNext())
        {
            Method getter = get_iter.next();
            QName getterName = getter.getQName();
            classInfo.addGetter(getterName);

            processSkinPartMetaData(getter.getMetaData(SKINPART), classInfo, getterName);
        }

        Iterator<Method> set_iter = abcClass.getSetterIterator();

        while(set_iter.hasNext())
        {
            classInfo.addSetter(set_iter.next().getQName());
        }

        Iterator<Variable> var_iter = abcClass.getVarIterator();
        while (var_iter.hasNext())
        {
            Variable variable = var_iter.next();
            QName varName = variable.getQName();
            classInfo.addVariable(varName);

            processSkinPartMetaData(variable.getMetaData(SKINPART), classInfo, varName);
        }
    }
View Full Code Here

    {
        if ((functionDefinition.name != null) &&
            (functionDefinition.name.identifier != null) &&
            (functionDefinition.name.identifier.name != null))
        {
            QName functionName = new QName(NodeMagic.getUserNamespace(functionDefinition),
                                           NodeMagic.getFunctionName(functionDefinition));

      if (currentInfo != null)
            {
        //  CAUTION used to test fexpr.kind, not name.kind. Ditto setter case below
View Full Code Here

    {
        if ((variableDefinition.list != null) &&
            (variableDefinition.list.items != null) &&
            (variableDefinition.list.items.get(0) instanceof VariableBindingNode))
        {
            QName variableName = new QName(NodeMagic.getUserNamespace(variableDefinition),
                                           NodeMagic.getVariableName(variableDefinition));

            if (currentInfo != null)
            {
                // if currentInfo is an instance of InterfaceInfo, ASC
View Full Code Here

    {
        String[] namespace = multiName.getNamespace();
        String localPart = multiName.getLocalPart();
        int i = 0;
        int length = namespace.length;
        QName result = null;

        while ((i < length) && (result == null))
        {
            if (symbolTable.findSourceByQName(namespace[i], localPart) != null)
            {
View Full Code Here

            //[Matt] I think this value is wrong but I can't see where it's used so we'll leave it for now.
            String destinationProperty = createExpression(destinationPropertyStack);

            for (Iterator<QName> i = attributeBindings.keySet().iterator(); i.hasNext();)
            {
                QName attrName = i.next();
               
                String attrExpr;
                int nsId = 0;
               
                // If the attribute node has a namespace use that.  Otherwise
                // use the namespace of the element node.
                String nsUri = attrName.getNamespace();
                if (nsUri.length() > 0)
                {
                    nsId = PrefixMapping.getNamespaceId(nsUri, namespaces);                       
                }
                else
                {
                    PrefixMapping pm = (PrefixMapping) namespaces.peek();
                    nsUri = pm.getUri();
                    nsId = pm.getNs();
                }
               
                if (nsId > 0)
                {
                    attrExpr = e4xElementsByLocalName + ".@ns" + nsId + "::" + attrName.getLocalPart();
                }
                else
                {
                    attrExpr = e4xElementsByLocalName + ".@" + attrName.getLocalPart();
                }

                BindingExpression be = attributeBindings.get(attrName);
               
                be.setDestinationLValue(attrExpr);
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.