Package flex2.compiler.mxml.rep

Examples of flex2.compiler.mxml.rep.DocumentInfo


     * <p>InterfaceAnalyzer then adds additional stuff from the DOM, prior to interface codegen
     */
    private DocumentInfo createDocumentInfo(CompilationUnit unit, DocumentNode app, Source source)
    {
        StandardDefs standardDefs = unit.getStandardDefs();
        DocumentInfo info = new DocumentInfo(source.getNameForReporting(), standardDefs);

        //  set MXML root
        info.setRootNode(app, app.beginLine);
       
        //  package/class is derived from source name and location
        info.setClassName(source.getShortName());
        info.setPackageName(source.getRelativePath().replace('/','.'));

        //  superclass is derived from root node name

        // first, check to see if the base class is a local class
        String superClassName = info.getLocalClass(app.getNamespace(), app.getLocalPart());

        // otherwise, check the usual manifest mappings
        if (superClassName == null)
            superClassName = nameMappings.resolveClassName(app.getNamespace(), app.getLocalPart());

        if (superClassName != null)
        {
            info.setQualifiedSuperClassName(NameFormatter.toDot(superClassName), app.beginLine);
        }
        else
        {
            ThreadLocalToolkit.log(new AnalyzerAdapter.CouldNotResolveToComponent(app.image), source, app.beginLine);
            return null;
        }

        //  interfaces specified by "implements" attribute.
        //  TODO "implements" is language def, it should be in a list of language constants somewhere
        String interfaceNames = (String) app.getAttributeValue("implements");
        if (interfaceNames != null)
        {
            StringTokenizer t = new StringTokenizer(interfaceNames, ",");
            while (t.hasMoreTokens())
            {
                info.addInterfaceName(t.nextToken().trim(), app.getLineNumber("implements"));
            }
        }

        //  seed import name set with the unconditional imports present in all generated MXML classes
        if (mxmlConfiguration.getGenerateAbstractSyntaxTree())
        {
            info.addSplitImportNames(StandardDefs.splitImplicitImports);

            // See SDK-16946
            if (info.getVersion() >= 4)
            {
                info.removeSplitImportName(NameFormatter.toDotStar(StandardDefs.PACKAGE_FLASH_FILTERS));
                info.addSplitImportName(NameFormatter.toDotStar(StandardDefs.PACKAGE_MX_FILTERS),
                                        StandardDefs.splitPackageMxFilters);
            }

            if (mxmlConfiguration.getCompilingForAIR())
            {
                info.addSplitImportNames(StandardDefs.splitAirOnlyImplicitImports);
            }

            info.addSplitImportNames(standardDefs.getSplitStandardMxmlImports());
        }
        else
        {
            info.addImportNames(StandardDefs.implicitImports, app.beginLine);

            // See SDK-16946
            if (info.getVersion() >= 4)
            {
                info.removeImportName(NameFormatter.toDotStar(StandardDefs.PACKAGE_FLASH_FILTERS));
                info.addImportName(NameFormatter.toDotStar(StandardDefs.PACKAGE_MX_FILTERS), app.beginLine);
            }

            if (mxmlConfiguration.getCompilingForAIR())
            {
                info.addImportNames(StandardDefs.airOnlyImplicitImports, app.beginLine);
            }

            info.addImportNames(standardDefs.getStandardMxmlImports(), app.beginLine);
        }

        return info;
    }
View Full Code Here


    }

    DocumentNode app = (DocumentNode)unit.getSyntaxTree();
    assert app != null;

    DocumentInfo info = (DocumentInfo)unit.getContext().removeAttribute(MxmlCompiler.DOCUMENT_INFO);
    assert info != null;

    //  build MxmlDocument from MXML DOM
    MxmlDocument document = new MxmlDocument(unit, typeTable, info, mxmlConfiguration);
        DocumentBuilder builder = new DocumentBuilder(unit, typeTable, mxmlConfiguration, document);
View Full Code Here

        output = null;
        directory = null;
        mimeMappings = new MimeMappings();
        meter = null;
        resolver = null;
        cc = new CompilerControl();

        //data = null;
        cacheName = null;
        configurationReport = null;
        messages = new ArrayList<Message>();
View Full Code Here

        logger = null;
        output = null;
        mimeMappings = new MimeMappings();
        meter = null;
        resolver = null;
        cc = new CompilerControl();
        //isGeneratedTargetFile = false;

        //data = null;
        cacheName = null;
        configurationReport = null;
View Full Code Here

                        level = Message.ERROR;
                    else if (cps.equals(CompilerProblemSeverity.WARNING))
                        level = Message.WARNING;
                    else
                        break; // skip if IGNORE?
                    CompilerMessage msg = new CompilerMessage(level,
                                                    prob.getSourcePath(),
                                                    prob.getLine() + 1,
                                                    prob.getColumn());
                    try
                    {
                        String errText = (String) aClass.getField("DESCRIPTION").get(aClass);
                        while (errText.contains("${"))
                        {
                            int start = errText.indexOf("${");
                            int end = errText.indexOf("}", start);
                            String token = errText.substring(start + 2, end);
                            String value = (String) aClass.getField(token).get(prob);
                            token = "${" + token + "}";
                            errText = errText.replace(token, value);
                        }
                        msg.setMessage(errText);
                    }
                    catch (IllegalArgumentException e1)
                    {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
View Full Code Here

                        level = Message.ERROR;
                    else if (cps.equals(CompilerProblemSeverity.WARNING))
                        level = Message.WARNING;
                    else
                        break; // skip if IGNORE?
                    CompilerMessage msg = new CompilerMessage(level,
                                                    prob.getSourcePath(),
                                                    prob.getLine() + 1,
                                                    prob.getColumn());
                    try
                    {
                        String errText = (String) aClass.getField("DESCRIPTION").get(aClass);
                        while (errText.contains("${"))
                        {
                            int start = errText.indexOf("${");
                            int end = errText.indexOf("}", start);
                            String token = errText.substring(start + 2, end);
                            String value = (String) aClass.getField(token).get(prob);
                            token = "${" + token + "}";
                            errText = errText.replace(token, value);
                        }
                        msg.setMessage(errText);
                    }
                    catch (IllegalArgumentException e1)
                    {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
View Full Code Here

        oemConfiguration = null;
        logger = null;
        output = null;
        directory = null;
        mimeMappings = new MimeMappings();
        meter = null;
        resolver = null;
        cc = new CompilerControl();

        //data = null;
View Full Code Here

            this.files.add(files[i]);
        }
        oemConfiguration = null;
        logger = null;
        output = null;
        mimeMappings = new MimeMappings();
        meter = null;
        resolver = null;
        cc = new CompilerControl();
        //isGeneratedTargetFile = false;
View Full Code Here

                }
            }
           
        }
        ISWF swf = mxmlc.getSWFTarget();
        movie = new SimpleMovie(null);
        org.apache.flex.swf.types.Rect r = swf.getFrameSize();
        flash.swf.types.Rect fr = new flash.swf.types.Rect();
        fr.xMin = r.xMin();
        fr.yMin = r.yMin();
        fr.xMax = r.xMax();
View Full Code Here

          }
          else
          {
              if (verbose)
                System.out.println("new application");
              job = new AppJob(new Application(mainAppFile));
              apps.put(key, job);
          }
            job.app.setProgressMeter(progress);
             
            //compilations one at the time on the same project
View Full Code Here

TOP

Related Classes of flex2.compiler.mxml.rep.DocumentInfo

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.