Package flex2.compiler.util

Examples of flex2.compiler.util.MultiName


        if (!classInfo.implementsInterface(StandardDefs.PACKAGE_FLASH_EVENTS,
                           GenerativeExtension.IEVENT_DISPATCHER))
        {
          currentInfo.setNeedsToImplementIEventDispatcher(true);

          MultiName multiName = new MultiName(StandardDefs.PACKAGE_FLASH_EVENTS,
                            GenerativeExtension.IEVENT_DISPATCHER);
          InterfaceInfo interfaceInfo = typeAnalyzer.analyzeInterface(context, multiName, classInfo);

          // interfaceInfo will be null if IEventDispatcher was not resolved.
          // This most likely means that playerglobal.swc was not in the
          // external-library-path and other errors will be reported, so punt.
          if ((interfaceInfo == null) || checkForExistingMethods(context, node, classInfo, interfaceInfo))
          {
            return null;
          }

          classInfo.addInterfaceMultiName(StandardDefs.PACKAGE_FLASH_EVENTS,
                                                    GenerativeExtension.IEVENT_DISPATCHER);
        }

        if (!classInfo.implementsInterface(standardDefs.getDataPackage(), IMANAGED))
        {
          currentInfo.setNeedsToImplementIManaged(true);

                    // Don't be tempted to check for mx.core.IUID here, because
                    // analyzeInterface() sets up the inheritance for downstream
                    // consumers and if we only add IUID to the inheritance, then
                    // the check for IManaged in the enclosing if statement will fail.
          MultiName multiName = new MultiName(standardDefs.getDataPackage(), IMANAGED);
          InterfaceInfo interfaceInfo = typeAnalyzer.analyzeInterface(context, multiName, classInfo);

          // interfaceInfo will be null if IManaged was not resolved.
          // This most likely means that fds.swc was not in the
          // library-path and other errors will be reported, so punt.
View Full Code Here


            // Valid references shouldn't have a dot in them, but
            // sometimes ASC creates them.  Filter them out here.
            if ((ref.name.indexOf(".") < 0) && !history.containsKey(namespaceURI, ref.name))
      {
        target.add(new MultiName(namespaceURI, ref.name));
      }
    }

    unresolved.clear();
  }
View Full Code Here

        // base Skin class from the framework implements IEventDispatcher.
        // We're comfortable with doing this because IEventDispatcher is player
        // runtime interface that isn't linked into a SWF. See SDK-29306
        if (unit.hostComponentMetaData != null)
        {
            unit.inheritance.add(new MultiName(StandardDefs.PACKAGE_FLASH_EVENTS, "IEventDispatcher"));
        }
    }
View Full Code Here

                throw new SkinClassNotFound(skinClassName);
            }

            result = new TranscodingResults();
            TypeAnalyzer typeAnalyzer = symbolTable.getTypeAnalyzer();
            ClassInfo skinClassInfo = typeAnalyzer.analyzeClass(null, new MultiName(NameFormatter.toColon(skinClassName)));
            result.generatedCode = generateSource(className, skinClassName, skinClassInfo);
        }
        else
        {
            throw new EmbedRequiresCodegen((String) args.get(Transcoder.ORIGINAL), className);
View Full Code Here

            {
                PackageIdentifiersNode packageIdentifiers = packageName.id;

                if ((packageIdentifiers != null) && (packageIdentifiers.pkg_part != null))
                {
                    definitionMultiNames.add(new MultiName(packageIdentifiers.pkg_part, classDefinition.name.name));
                }
            }
        }

        if (classDefinition.statements != null)
        {
            processImports(classDefinition.statements.items.iterator());
        }

        // process extends
        if (classDefinition.baseclass != null)
        {
            if (classDefinition.baseclass instanceof MemberExpressionNode)
            {
                MemberExpressionNode memberExpression = (MemberExpressionNode) classDefinition.baseclass;

                if (memberExpression.selector != null)
                {
                    IdentifierNode identifier = memberExpression.selector.getIdentifier();
                    String baseClassName = toString(identifier);
                    inheritanceNames.add(baseClassName);
                }
            }
            else if (classDefinition.baseclass instanceof LiteralStringNode)
            {
                String baseClassName = ((LiteralStringNode) classDefinition.baseclass).value;
                inheritanceNames.add(baseClassName);
            }
            else
            {
                assert false;
            }
        }
        else
        {
          inheritanceNames.add(":Object");
        }

        // process interfaces
        if (classDefinition.interfaces != null)
        {
            Iterator iterator = classDefinition.interfaces.items.iterator();

            while ( iterator.hasNext() )
            {
                MemberExpressionNode memberExpression = (MemberExpressionNode) iterator.next();

                if (memberExpression.selector != null)
                {
                    IdentifierNode identifier = memberExpression.selector.getIdentifier();
                    String interfaceName = toString(identifier);

                    if ((identifier.ref != null) && (identifier.ref.namespaces != null))
                    {
                        NamespaceValue namespaceValue = (NamespaceValue) identifier.ref.namespaces.get(0);
                        if (namespaceValue.name.length() > 0)
                        {
                            inheritanceMultiNames.add(new MultiName(namespaceValue.name, interfaceName));
                        }
                        else
                        {
                            inheritanceNames.add(interfaceName);
                        }
View Full Code Here

            {
                PackageIdentifiersNode packageIdentifiers = packageName.id;

                if ((packageIdentifiers != null) && (packageIdentifiers.pkg_part != null))
                {
                    definitionMultiNames.add(new MultiName(packageIdentifiers.pkg_part, interfaceDefinition.name.name));
                }
            }
        }

        if (interfaceDefinition.statements != null)
        {
            processImports(interfaceDefinition.statements.items.iterator());
        }

        // process extends
        if (interfaceDefinition.baseclass != null)
        {
            if (interfaceDefinition.baseclass instanceof MemberExpressionNode)
            {
                MemberExpressionNode memberExpression = (MemberExpressionNode) interfaceDefinition.baseclass;

                if (memberExpression.selector != null)
                {
                    IdentifierNode identifier = memberExpression.selector.getIdentifier();
                    String baseInterfaceName = toString(identifier);
                    inheritanceNames.add(baseInterfaceName);
                }
            }
            else
            {
                assert false;
            }
        }
        else
        {
          inheritanceNames.add(":Object");
        }

        // process interfaces: It would seem that ASC sometimes puts an interface's base
        // interface in the InterfaceDefinitionNode's interfaces list.  I'm not sure if
        // this is always the case, though.
        if (interfaceDefinition.interfaces != null)
        {
            Iterator iterator = interfaceDefinition.interfaces.items.iterator();

            while ( iterator.hasNext() )
            {
                MemberExpressionNode memberExpression = (MemberExpressionNode) iterator.next();

                if (memberExpression.selector != null)
                {
                    IdentifierNode identifier = memberExpression.selector.getIdentifier();
                    String baseInterfaceName = toString(identifier);

                    if ((identifier.ref != null) && (identifier.ref.namespaces != null))
                    {
                        NamespaceValue namespaceValue = (NamespaceValue) identifier.ref.namespaces.get(0);
                        if (namespaceValue.name.length() > 0)
                        {
                            inheritanceMultiNames.add(new MultiName(namespaceValue.name, baseInterfaceName));
                        }
                        else
                        {
                            inheritanceNames.add(baseInterfaceName);
                        }
View Full Code Here

            while ( iterator.hasNext() )
            {
                String inheritanceName = iterator.next();

                MultiName inheritanceMultiName = getMultiName(inheritanceName);

                inheritanceMultiNames.add(inheritanceMultiName);
            }
        }

        // Remove definitions from the inheritance, so we don't run into circular
        // reference errors downstream.
        Iterator inheritanceIterator = inheritanceMultiNames.iterator();

        while ( inheritanceIterator.hasNext() )
        {
            MultiName inheritanceMultiName = (MultiName) inheritanceIterator.next();
            String[] namespaces = inheritanceMultiName.getNamespace();
            Iterator<MultiName> definitionIterator = definitionMultiNames.iterator();

            while ( definitionIterator.hasNext() )
            {
                MultiName definitionMultiName = definitionIterator.next();
                String namespace = definitionMultiName.getNamespace()[0];

                if (inheritanceMultiName.getLocalPart().equals(definitionMultiName.getLocalPart()))
                {
                    for (int i = 0; i < inheritanceMultiName.namespaceURI.length; i++)
                    {
                        if (namespaces[i].equals(namespace))
                        {
View Full Code Here

    private MultiName getMultiName(String name)
    {
        assert name != null : "InheritanceEvaluator.getMultiName(): null name";

        MultiName result;

        int lastIndex = name.lastIndexOf(":");

        if (lastIndex < 0)
        {
            lastIndex = name.lastIndexOf(".");
        }

        if (lastIndex >= 0)
        {
            result = new MultiName(new String[] {name.substring(0, lastIndex)},
                                   name.substring(lastIndex + 1));
        }
        else if ((qualifiedImports != null) && qualifiedImports.containsKey(name))
        {
            result = new MultiName(new String[] {qualifiedImports.get(name)}, name);
        }
        else if (imports != null)
        {
            String[] namespaces = new String[imports.size()];
            imports.toArray(namespaces);
            result = new MultiName(namespaces, name);
        }
        else
        {
            result = new MultiName(name);
        }

        return result;
    }
View Full Code Here

      if (accessibilityList.size() > 0)
      {
        for (Iterator it = accessibilityList.iterator(); it.hasNext();)
        {
          String className = (String) it.next();
          MultiName mName = new MultiName(NameFormatter.retrievePackageName(className), NameFormatter.retrieveClassName(className));
          flex2.compiler.CompilerAPI.resolveMultiName(mName, sources, sourceList, sourcePath, resources, swcContext, symbolTable);
        }
      }

        // Sort the checksums to make sure the checksums are always in the same order.
View Full Code Here

    {
        Iterator iterator = multiNames.iterator();

        while ( iterator.hasNext() )
        {
            MultiName multiName = (MultiName) iterator.next();

            analyzeInterface(context, multiName, info);
        }
    }
View Full Code Here

TOP

Related Classes of flex2.compiler.util.MultiName

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.