All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spoon.reflect.visitor.PrettyPrinterCreator Maven / Gradle / Ivy

package spoon.reflect.visitor;

import static java.util.Arrays.asList;

import spoon.compiler.Environment;

public class PrettyPrinterCreator {

    private static DefaultJavaPrettyPrinter printer;
    
    public static PrettyPrinter createPrettyPrinter(final Environment environment) {
        if (printer == null) {
            printer = new DefaultJavaPrettyPrinter(environment);
            printer.setIgnoreImplicit(false);
            printer.setPreprocessors(asList(new ForceFullyQualifiedProcessor(), new RemoveAllImportsCleaner()));
        }
        return printer;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy