Package com.google.googlejavaformat.java
Class CommandLineOptions
java.lang.Object
com.google.googlejavaformat.java.CommandLineOptions
Command line options for google-java-format.
google-java-format doesn't depend on AutoValue, to allow AutoValue to depend on google-java-format.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final booleanprivate final com.google.common.collect.ImmutableList<String> private final booleanprivate final booleanprivate final booleanprivate final booleanprivate final com.google.common.collect.ImmutableList<Integer> private final com.google.common.collect.ImmutableRangeSet<Integer> private final com.google.common.collect.ImmutableList<Integer> private final booleanprivate final booleanprivate final booleanprivate final booleanprivate final booleanprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionCommandLineOptions(com.google.common.collect.ImmutableList<String> files, boolean inPlace, com.google.common.collect.ImmutableRangeSet<Integer> lines, com.google.common.collect.ImmutableList<Integer> offsets, com.google.common.collect.ImmutableList<Integer> lengths, boolean aosp, boolean version, boolean help, boolean stdin, boolean fixImportsOnly, boolean sortImports, boolean removeUnusedImports, boolean dryRun, boolean setExitIfChanged, Optional<String> assumeFilename, boolean reflowLongStrings, boolean formatJavadoc) -
Method Summary
Modifier and TypeMethodDescription(package private) booleanaosp()Use AOSP style instead of Google Style (4-space indentation).Return the name to use for diagnostics when formatting standard input.(package private) static CommandLineOptions.Builderbuilder()(package private) booleandryRun()Print the paths of the files whose contents would change if the formatter were run normally.(package private) com.google.common.collect.ImmutableList<String> files()The files to format.(package private) booleanFix imports, but do no formatting.(package private) boolean(package private) booleanhelp()Print usage information.(package private) booleaninPlace()Format files in place.(package private) booleanReturns true if partial formatting was selected.(package private) com.google.common.collect.ImmutableList<Integer> lengths()Partial formatting region lengths, paired withoffsets.(package private) com.google.common.collect.ImmutableRangeSet<Integer> lines()Line ranges to format.(package private) com.google.common.collect.ImmutableList<Integer> offsets()Character offsets for partial formatting, paired withlengths.(package private) boolean(package private) booleanRemove unused imports.(package private) booleanReturn exit code 1 if there are any formatting changes.(package private) booleanSort imports.(package private) booleanstdin()Format input from stdin.(package private) booleanversion()Print the version.
-
Field Details
-
files
-
inPlace
private final boolean inPlace -
lines
-
offsets
-
lengths
-
aosp
private final boolean aosp -
version
private final boolean version -
help
private final boolean help -
stdin
private final boolean stdin -
fixImportsOnly
private final boolean fixImportsOnly -
sortImports
private final boolean sortImports -
removeUnusedImports
private final boolean removeUnusedImports -
dryRun
private final boolean dryRun -
setExitIfChanged
private final boolean setExitIfChanged -
assumeFilename
-
reflowLongStrings
private final boolean reflowLongStrings -
formatJavadoc
private final boolean formatJavadoc
-
-
Constructor Details
-
CommandLineOptions
CommandLineOptions(com.google.common.collect.ImmutableList<String> files, boolean inPlace, com.google.common.collect.ImmutableRangeSet<Integer> lines, com.google.common.collect.ImmutableList<Integer> offsets, com.google.common.collect.ImmutableList<Integer> lengths, boolean aosp, boolean version, boolean help, boolean stdin, boolean fixImportsOnly, boolean sortImports, boolean removeUnusedImports, boolean dryRun, boolean setExitIfChanged, Optional<String> assumeFilename, boolean reflowLongStrings, boolean formatJavadoc)
-
-
Method Details
-
files
com.google.common.collect.ImmutableList<String> files()The files to format. -
inPlace
boolean inPlace()Format files in place. -
lines
com.google.common.collect.ImmutableRangeSet<Integer> lines()Line ranges to format. -
offsets
com.google.common.collect.ImmutableList<Integer> offsets()Character offsets for partial formatting, paired withlengths. -
lengths
com.google.common.collect.ImmutableList<Integer> lengths()Partial formatting region lengths, paired withoffsets. -
aosp
boolean aosp()Use AOSP style instead of Google Style (4-space indentation). -
version
boolean version()Print the version. -
help
boolean help()Print usage information. -
stdin
boolean stdin()Format input from stdin. -
fixImportsOnly
boolean fixImportsOnly()Fix imports, but do no formatting. -
sortImports
boolean sortImports()Sort imports. -
removeUnusedImports
boolean removeUnusedImports()Remove unused imports. -
dryRun
boolean dryRun()Print the paths of the files whose contents would change if the formatter were run normally. -
setExitIfChanged
boolean setExitIfChanged()Return exit code 1 if there are any formatting changes. -
assumeFilename
Return the name to use for diagnostics when formatting standard input. -
reflowLongStrings
boolean reflowLongStrings() -
isSelection
boolean isSelection()Returns true if partial formatting was selected. -
formatJavadoc
boolean formatJavadoc() -
builder
-