Search in sources :

Example 1 with PrettyPrinterConfiguration

use of com.github.javaparser.printer.PrettyPrinterConfiguration in project javaparser by javaparser.

the class MetaModelGenerator method main.

public static void main(String[] args) throws IOException, NoSuchMethodException {
    if (args.length != 1) {
        throw new RuntimeException("Need 1 parameter: the JavaParser source checkout root directory.");
    }
    final Path root = Paths.get(args[0], "..", "javaparser-core", "src", "main", "java");
    final SourceRoot sourceRoot = new SourceRoot(root);
    sourceRoot.setPrinter(new PrettyPrinter(new PrettyPrinterConfiguration().setEndOfLineCharacter("\n"))::print);
    new MetaModelGenerator().run(sourceRoot);
    sourceRoot.saveAll();
}
Also used : Path(java.nio.file.Path) PrettyPrinter(com.github.javaparser.printer.PrettyPrinter) SourceRoot(com.github.javaparser.utils.SourceRoot) PrettyPrinterConfiguration(com.github.javaparser.printer.PrettyPrinterConfiguration)

Aggregations

PrettyPrinter (com.github.javaparser.printer.PrettyPrinter)1 PrettyPrinterConfiguration (com.github.javaparser.printer.PrettyPrinterConfiguration)1 SourceRoot (com.github.javaparser.utils.SourceRoot)1 Path (java.nio.file.Path)1