Package com.google.googlejavaformat.java
Class CommandLineOptions
- java.lang.Object
-
- com.google.googlejavaformat.java.CommandLineOptions
-
final class CommandLineOptions extends java.lang.ObjectCommand 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 Modifier and Type Class Description (package private) static classCommandLineOptions.Builder
-
Field Summary
Fields Modifier and Type Field Description private booleanaospprivate java.util.Optional<java.lang.String>assumeFilenameprivate booleandryRunprivate com.google.common.collect.ImmutableList<java.lang.String>filesprivate booleanfixImportsOnlyprivate booleanformatJavadocprivate booleanhelpprivate booleaninPlaceprivate com.google.common.collect.ImmutableList<java.lang.Integer>lengthsprivate com.google.common.collect.ImmutableRangeSet<java.lang.Integer>linesprivate com.google.common.collect.ImmutableList<java.lang.Integer>offsetsprivate booleanreflowLongStringsprivate booleanremoveUnusedImportsprivate booleansetExitIfChangedprivate booleansortImportsprivate booleanstdinprivate booleanversion
-
Constructor Summary
Constructors Constructor Description CommandLineOptions(com.google.common.collect.ImmutableList<java.lang.String> files, boolean inPlace, com.google.common.collect.ImmutableRangeSet<java.lang.Integer> lines, com.google.common.collect.ImmutableList<java.lang.Integer> offsets, com.google.common.collect.ImmutableList<java.lang.Integer> lengths, boolean aosp, boolean version, boolean help, boolean stdin, boolean fixImportsOnly, boolean sortImports, boolean removeUnusedImports, boolean dryRun, boolean setExitIfChanged, java.util.Optional<java.lang.String> assumeFilename, boolean reflowLongStrings, boolean formatJavadoc)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) booleanaosp()Use AOSP style instead of Google Style (4-space indentation).(package private) java.util.Optional<java.lang.String>assumeFilename()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<java.lang.String>files()The files to format.(package private) booleanfixImportsOnly()Fix imports, but do no formatting.(package private) booleanformatJavadoc()(package private) booleanhelp()Print usage information.(package private) booleaninPlace()Format files in place.(package private) booleanisSelection()Returns true if partial formatting was selected.(package private) com.google.common.collect.ImmutableList<java.lang.Integer>lengths()Partial formatting region lengths, paired withoffsets.(package private) com.google.common.collect.ImmutableRangeSet<java.lang.Integer>lines()Line ranges to format.(package private) com.google.common.collect.ImmutableList<java.lang.Integer>offsets()Character offsets for partial formatting, paired withlengths.(package private) booleanreflowLongStrings()(package private) booleanremoveUnusedImports()Remove unused imports.(package private) booleansetExitIfChanged()Return exit code 1 if there are any formatting changes.(package private) booleansortImports()Sort imports.(package private) booleanstdin()Format input from stdin.(package private) booleanversion()Print the version.
-
-
-
Field Detail
-
files
private final com.google.common.collect.ImmutableList<java.lang.String> files
-
inPlace
private final boolean inPlace
-
lines
private final com.google.common.collect.ImmutableRangeSet<java.lang.Integer> lines
-
offsets
private final com.google.common.collect.ImmutableList<java.lang.Integer> offsets
-
lengths
private final com.google.common.collect.ImmutableList<java.lang.Integer> 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
private final java.util.Optional<java.lang.String> assumeFilename
-
reflowLongStrings
private final boolean reflowLongStrings
-
formatJavadoc
private final boolean formatJavadoc
-
-
Constructor Detail
-
CommandLineOptions
CommandLineOptions(com.google.common.collect.ImmutableList<java.lang.String> files, boolean inPlace, com.google.common.collect.ImmutableRangeSet<java.lang.Integer> lines, com.google.common.collect.ImmutableList<java.lang.Integer> offsets, com.google.common.collect.ImmutableList<java.lang.Integer> lengths, boolean aosp, boolean version, boolean help, boolean stdin, boolean fixImportsOnly, boolean sortImports, boolean removeUnusedImports, boolean dryRun, boolean setExitIfChanged, java.util.Optional<java.lang.String> assumeFilename, boolean reflowLongStrings, boolean formatJavadoc)
-
-
Method Detail
-
files
com.google.common.collect.ImmutableList<java.lang.String> files()
The files to format.
-
inPlace
boolean inPlace()
Format files in place.
-
lines
com.google.common.collect.ImmutableRangeSet<java.lang.Integer> lines()
Line ranges to format.
-
offsets
com.google.common.collect.ImmutableList<java.lang.Integer> offsets()
Character offsets for partial formatting, paired withlengths.
-
lengths
com.google.common.collect.ImmutableList<java.lang.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
java.util.Optional<java.lang.String> 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
static CommandLineOptions.Builder builder()
-
-