java.lang.Object
com.google.googlejavaformat.java.Main

public final class Main extends Object
The main class for the Java formatter CLI.
  • Constructor Details

  • Method Details

    • main

      public static void main(String[] args)
      The main method for the formatter, with some number of file names to format. We process them in parallel, but we must be careful; if multiple file names refer to the same file (which is hard to determine), we must serialize their updates.
      Parameters:
      args - the command-line arguments
    • format

      public int format(String... args) throws com.google.googlejavaformat.java.UsageException
      The main entry point for the formatter, with some number of file names to format. We process them in parallel, but we must be careful; if multiple file names refer to the same file (which is hard to determine), we must serialize their update.
      Parameters:
      args - the command-line arguments
      Throws:
      com.google.googlejavaformat.java.UsageException
    • processArgs

      public static com.google.googlejavaformat.java.CommandLineOptions processArgs(String... args) throws com.google.googlejavaformat.java.UsageException
      Parses and validates command-line flags.
      Throws:
      com.google.googlejavaformat.java.UsageException