Package com.google.googlejavaformat.java
Class Main
java.lang.Object
com.google.googlejavaformat.java.Main
The main class for the Java formatter CLI.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PrintWriterprivate final InputStreamprivate static final intprivate final PrintWriterprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThe main entry point for the formatter, with some number of file names to format.private intformatFiles(CommandLineOptions parameters, JavaFormatterOptions options) private intformatStdin(CommandLineOptions parameters, JavaFormatterOptions options) (package private) static intmain(InputStream in, PrintStream out, PrintStream err, String... args) Package-private main entry point used by theToolimplementation in the same package as this Main class.(package private) static intmain(InputStream in, PrintWriter out, PrintWriter err, String... args) Package-private main entry point used by theToolProviderimplementation in the same package as this Main class.static voidThe main method for the formatter, with some number of file names to format.static CommandLineOptionsprocessArgs(String... args) Parses and validates command-line flags.(package private) static String
-
Field Details
-
MAX_THREADS
private static final int MAX_THREADS- See Also:
-
STDIN_FILENAME
- See Also:
-
outWriter
-
errWriter
-
inStream
-
-
Constructor Details
-
Main
-
-
Method Details
-
versionString
-
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
-
main
Package-private main entry point used by theToolimplementation in the same package as this Main class. -
main
Package-private main entry point used by theToolProviderimplementation in the same package as this Main class. -
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:
UsageException
-
formatFiles
-
formatStdin
-
processArgs
Parses and validates command-line flags.- Throws:
UsageException
-