Package org.jvnet.sorcerer.util

Examples of org.jvnet.sorcerer.util.TabExpandingFileManager


    /**
     * Creates a configured {@link JavacTask}.
     */
    protected JavacTask configure(DiagnosticListener<? super JavaFileObject> errorListener) throws IOException {
        JavaCompiler javac = JavacTool.create();
        StandardJavaFileManager fileManager = new TabExpandingFileManager(
            javac.getStandardFileManager(errorListener, locale, encoding),encoding,tabWidth);

        fileManager.setLocation( StandardLocation.CLASS_PATH, classpath );

        // annotation processing appears to cause the source files to be reparsed
        // (even though I couldn't find exactly where it's done), which causes
        // Tree symbols created by the original JavacTask.parse() call to be thrown away,
        // which breaks later processing.
        // So for now, don't perform annotation processing
        List<String> options = Arrays.asList("-proc:none");

        Iterable<? extends JavaFileObject> files = fileManager.getJavaFileObjectsFromFiles(sourceFiles);
        CompilationTask task = javac.getTask(null, fileManager, errorListener, options, null, files);
        return (JavacTask)task;
    }
View Full Code Here

TOP

Related Classes of org.jvnet.sorcerer.util.TabExpandingFileManager

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.