Package org.stjs.generator.name

Examples of org.stjs.generator.name.DefaultJavaScriptNameProvider


      return new BridgeClass(dependencyResolver, clazz);
    }

    File inputFile = getInputFile(sourceFolder, className);
    File outputFile = getOutputFile(generationFolder.getAbsolutePath(), className);
    JavaScriptNameProvider names = new DefaultJavaScriptNameProvider();
    GenerationPlugins<Object> currentClassPlugins = plugins.forClass(clazz);

    GenerationContext<Object> context = new GenerationContext<Object>(inputFile, configuration, names, null, builtProjectClassLoader,
        cacheAnnotations, getJavaScriptBuilder());

    CompilationUnitTree cu = parseAndResolve(inputFile, context, builtProjectClassLoader, configuration.getSourceEncoding());

    // check the code
    Timers.start("check-java");
    currentClassPlugins.getCheckVisitor().scan(cu, (GenerationContext) context);
    context.getChecks().check();
    Timers.end("check-java");

    // generate the javascript code
    Timers.start("write-js-ast");
    Object javascriptRoot = currentClassPlugins.getWriterVisitor().scan(cu, context);
    // check for any error arriving during writing
    context.getChecks().check();
    Timers.end("write-js-ast");

    STJSClass stjsClass = new STJSClass(dependencyResolver, targetFolder, className);
    Set<String> resolvedClasses = new LinkedHashSet<String>(names.getResolvedTypes());
    resolvedClasses.remove(className);
    stjsClass.setDependencies(resolvedClasses);
    stjsClass.setGeneratedJavascriptFile(relative(generationFolder, className));

    // dump the ast to a file
View Full Code Here

TOP

Related Classes of org.stjs.generator.name.DefaultJavaScriptNameProvider

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.