java.lang.Object
com.google.googlejavaformat.java.Main
public final class Main extends Object
The main class for the Java formatter CLI.
-
Constructor Summary
Constructors Constructor Description Main(PrintWriter outWriter, PrintWriter errWriter, InputStream inStream) -
Method Summary
Modifier and Type Method Description intformat(String... args)The main entry point for the formatter, with some number of file names to format.static voidmain(String[] args)The main method for the formatter, with some number of file names to format.static com.google.googlejavaformat.java.CommandLineOptionsprocessArgs(String... args)Parses and validates command-line flags.
-
Constructor Details
-
Method Details
-
main
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
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.UsageExceptionParses and validates command-line flags.- Throws:
com.google.googlejavaformat.java.UsageException
-