Package org.apache.flex.compiler.internal.definitions

Examples of org.apache.flex.compiler.internal.definitions.ClassDefinition


        if (getProject().getTargetSettings().getMxmlChildrenAsData())
            context.addInstruction(OP_pushtrue);
       
        // Get the Name for the mx.core.ClassFactory class.
        ICompilerProject project = getProject();
        ClassDefinition classReference = (ClassDefinition)factoryNode.getClassReference(project);
        Name factoryClassName = classReference != null ? classReference.getMName(project) : null;
       
        // Push this class.
        context.addInstruction(OP_finddef, factoryClassName);
       
        // Push the class to be used as the generator,
View Full Code Here


        if (!getProject().getTargetSettings().getMxmlChildrenAsData())
        {
            // Get the Name for the mx.core.DeferredInstanceFromClass
            // or mx.core.DeferredInstanceFromFunction class.
            ICompilerProject project = getProject();
            ClassDefinition classReference = (ClassDefinition)deferredInstanceNode.getClassReference(project);
            Name deferredInstanceClassName = classReference.getMName(project);
           
            // Push this class.
            context.addInstruction(OP_finddef, deferredInstanceClassName);
           
            // Push the class or function to be used as the generator,
View Full Code Here

            context.addInstruction(OP_pushstring, node.getID());
        }
        // Resolve the outer document, and if it doesn't resolve to the contingent
        // definition, that means there is already an existing definition declared
        // which is an error.
        ClassDefinition componentClass = (ClassDefinition)node.getContainedClassDefinition();
        ASScope classScope = componentClass.getContainedScope();
        IDefinition outerDocument = classScope.getPropertyFromDef(
            getProject(), componentClass, IMXMLLanguageConstants.PROPERTY_OUTER_DOCUMENT, false);
        assert (outerDocument != null) : "outerDocument should never be null, as always added";
        if (!outerDocument.isContingent())
        {
View Full Code Here

        MXMLClassDirectiveProcessor dp = new MXMLClassDirectiveProcessor(node, globalScope, emitter);
        dp.processMainClassDefinitionNode(node);
        dp.finishClassDefinition();
       
        // Leave a reference to the class on the stack.
        ClassDefinition classDefinition =
            (ClassDefinition)((IMXMLClassDefinitionNode)node).getClassDefinition();
        ICompilerProject project = getProject();
        Name className = classDefinition.getMName(project);
        context.addInstruction(OP_getlex, className);
    }
View Full Code Here

   
    void processMXMLEmbed(IMXMLEmbedNode node, Context context)
    {
        // push a reference to the asset class on the stack
        ICompilerProject project = getProject();
        ClassDefinition classDefinition = (ClassDefinition)node.getClassReference(project);
        Name className = classDefinition != null ? classDefinition.getMName(project) : null;
        if (getProject().getTargetSettings().getMxmlChildrenAsData())
            context.addInstruction(OP_pushtrue);

        context.addInstruction(OP_getlex, className);       
    }
View Full Code Here

            final ASFileScope fileScope = new ASFileScope(getProject().getWorkspace(), null);

            Multiname mname = Multiname.crackDottedQName(getProject(), qname);
            INamespaceDefinition packageNS = Iterables.getOnlyElement(mname.getNamespaceSet());

            final ClassDefinition classDefinition = new ClassDefinition(mname.getBaseName(),
                    (INamespaceReference)packageNS);
            fileScope.addDefinition(classDefinition);

            return new FileScopeRequestResultBase(Collections.<ICompilerProblem> emptySet(),
                    ImmutableSet.<IASScope> of(fileScope));
View Full Code Here

                String classNSURI = namespace.getName();
                protectedNSURI = (classNSURI.isEmpty() ? "" : classNSURI + ":") + typeName;
            }
            NamespaceDefinition.IProtectedNamespaceDefinition protectedNSDefinition = NamespaceDefinition.createProtectedNamespaceDefinition(protectedNSURI);
           
            final ClassDefinition classDefinition = new ClassDefinition(typeName, namespaceRef, protectedNSDefinition);
            final IReference baseClass = getReference(iinfo.superName);
            classDefinition.setBaseClassReference(baseClass);

            final IReference[] implementedInterfaces = getReferences(iinfo.interfaceNames);
            classDefinition.setImplementedInterfaceReferences(implementedInterfaces);

            setupConstructor(iinfo, classDefinition);

            typeDefinition = classDefinition;
        }
View Full Code Here

    {
        if (metaTags == null)
            metaTags = new IMetaTag[0];
        if (definition instanceof ClassDefinition)
        {
            ClassDefinition classDef = (ClassDefinition)definition;
            IFunctionDefinition constructor = classDef.getConstructor();
            if (constructor != null)
            {
                IMetaTag ctorGotoDefHelpTag = findMetaTag(IMetaAttributeConstants.ATTRIBUTE_GOTODEFINITION_CTOR_HELP);
                if (ctorGotoDefHelpTag != null)
                    setNameLocation(constructor, ctorGotoDefHelpTag);
View Full Code Here

        for(IDefinition def : definitions)
        {
            Multiname mname = Multiname.crackDottedQName(getProject(), def.getQualifiedName());
            INamespaceDefinition packageNS = Iterables.getOnlyElement(mname.getNamespaceSet());

            ClassDefinition classDefinition = new ClassDefinition(mname.getBaseName(), (INamespaceReference)packageNS);
            IReference baseClass = ReferenceFactory.packageQualifiedReference(getProject().getWorkspace(), getFlexProject().getResourceBundleClass());
            classDefinition.setBaseClassReference(baseClass);
            classDefinition.setExcludedClass();

            TypeScope classScope = new TypeScope(packageScope, classDefinition);
            classScope.setContainingDefinition(classDefinition);
            classDefinition.setContainedScope(classScope);
            classDefinition.setupThisAndSuper();

            packageScope.addDefinition(classDefinition);
        }

        return fileScope;
View Full Code Here

        fileScope.collectExternallyVisibleDefinitions(definitions, false);
        for (IDefinition definition : definitions)
        {
            if (definition instanceof ClassDefinition)
            {
                ClassDefinition classDefinition = (ClassDefinition)definition;
                classDefinition.setGeneratedEmbedClass();
                classDefinition.setExcludedClass();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.internal.definitions.ClassDefinition

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.