Package org.apache.flex.compiler.definitions

Examples of org.apache.flex.compiler.definitions.IClassDefinition


            for (IDefinition definition : getAllExternallyVisibleDefinitions(compilationUnits))
            {
                if (!(definition instanceof IClassDefinition))
                    continue;

                IClassDefinition classDefinition = (IClassDefinition)definition;
               
                IMetaTag iconFileMetaTag = classDefinition.getMetaTagByName(IMetaAttributeConstants.ATTRIBUTE_ICON_FILE);
               
                String iconFilePath = classDefinition.getIconFile();
                if (iconFilePath == null)
                    continue;

                String packageName = classDefinition.getPackageName();
                String key = packageName.replaceAll("\\.", "/") + "/" + iconFilePath;

                ICompilationUnit cu = project.getScope().getCompilationUnitForDefinition(classDefinition);
                IBinaryFileSpecification fileSpec = null;
                if (cu.getCompilationUnitType() == UnitType.SWC_UNIT)
                {
                    ISWC swc = project.getWorkspace().getSWCManager().get(new File(cu.getAbsoluteFilename()));
                    ISWCFileEntry swcFileEntry = swc.getFile(key);
                    fileSpec = new SWCFileSpecification(key, swcFileEntry);
                }
                else
                {
                    String sourcePath = classDefinition.getSourcePath();
                    iconFilePath = FilenameUtils.getFullPath(sourcePath) + iconFilePath;
                    fileSpec = project.getWorkspace().getLatestBinaryFileSpecification(iconFilePath);
                }

                FileEntryValue value = new FileEntryValue(fileSpec, iconFileMetaTag);
View Full Code Here


        return classDefinition.getNode();
    }
   
    private static IClassDefinition getObjectDefinition(ICompilerProject project)
    {
        IClassDefinition objectDefinition = (IClassDefinition)project.getBuiltinType(
            IASLanguageConstants.BuiltinType.OBJECT);
       
        if (objectDefinition == null)
        {
            // Abort codegen with a more comprehensible diagnostic.
View Full Code Here

    private void buildDescriptor(IMXMLClassReferenceNode node, Context context)
    {
        context.startUsing(IL.DESCRIPTOR);
       
        FlexProject project = getProject();
        IClassDefinition instanceClass = node.getClassReference(project);
       
        Name type = ((ClassDefinition)instanceClass).getMName(project);
       
        String id = node instanceof IMXMLInstanceNode ?
                    ((IMXMLInstanceNode)node).getEffectiveID() :
View Full Code Here

            // so that processMXMLInstance() can use it to construct the instance
            // and so that endNode() can use it to generate the reference variable
            // autogenerated for the id and to generate an initializer method
            // if appropriate.
            ICompilerProject project = getProject();
            IClassDefinition instanceClassReference = instanceNode.getClassReference(project);
            childContext.instanceClassName =
                instanceClassReference != null ?
                ((DefinitionBase)instanceClassReference).getMName(project) :
                null;
View Full Code Here

        protected void pushInterfaces()
        {
            boolean pushedInterface = false;
            while(!pushedInterface && !classesWithInterfaces.isEmpty())
            {
                IClassDefinition clazz = classesWithInterfaces.pop();

                IInterfaceDefinition[] interfaces = clazz.resolveImplementedInterfaces(project);
                for (int i = interfaces.length - 1; i >= 0; i--)
                {
                    if (interfaces[i] != null)
                    {
                        pushedInterface = true;
View Full Code Here

            // order, while also making sure that we don't resolve the interfaces until we have
            // to - many iterations will stop once they find the property they are looking for,
            // and will never need to look in the interfaces.
            if (type instanceof IClassDefinition)
            {
                IClassDefinition classDef = (IClassDefinition)type;
                if( classDef.getImplementedInterfaceReferences().length > 0 )
                    classesWithInterfaces.push(classDef);

                IClassDefinition baseClass = classDef.resolveBaseClass(project);
                if (baseClass != null)
                    push(baseClass);
            }
            else if (type instanceof IInterfaceDefinition)
            {
View Full Code Here

    {
        ICommonClassNode decoratedClassNode = (ICommonClassNode)getAncestorOfType(ICommonClassNode.class);
        if (decoratedClassNode == null)
            return null;
        IWorkspace workspace = getWorkspace();
        IClassDefinition decoratedClassDefinition = decoratedClassNode.getDefinition();
        assert decoratedClassDefinition != null;
        return decoratedClassDefinition.getEffectDefinition(workspace, getName());
    }
View Full Code Here

        ICommonClassNode decoratedClassNode =
            (ICommonClassNode)getAncestorOfType(ICommonClassNode.class);
        if (decoratedClassNode == null)
            return null;
       
        IClassDefinition decoratedClassDefinition = decoratedClassNode.getDefinition();
        assert decoratedClassDefinition != null;

        IWorkspace workspace = getWorkspace();
        return decoratedClassDefinition.getEventDefinition(workspace, getName());
    }
View Full Code Here

            Iterator<IClassDefinition> classIterator = cls.classIterator(project, true);

            while (classIterator.hasNext())
            {
                IClassDefinition nextClass = classIterator.next();
                ClassDefinitionBase classDefinitionBase = (ClassDefinitionBase)nextClass;

                // Note: getImplementedIntefaceRefs will not return one for IEventDispatcher
                // on [Bindable] classes. Since we don't want to see IEventDisp, we iterate this way.
                IReference[] refs = nextClass.getImplementedInterfaceReferences();

                InterfaceDefinition[] idefs = classDefinitionBase.resolveImplementedInterfaces(project, problems);
                for (int i = 0; i < refs.length; ++i)
                {
                    if (idefs[i] != null)
View Full Code Here

    {
        // Only have to check if this Definition is static
        if( this.isStatic() )
        {
            // Get the class this definition is in
            IClassDefinition containingClass = (IClassDefinition)this.getAncestorOfType(IClassDefinition.class);

            // Grab the scope the fromNode uses to resolve itself, and walk
            // up the containing scopes looking for an instance scope
            ASScope fromScope = fromNode.getASScope();
            while( fromScope != null )
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.definitions.IClassDefinition

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.