Class JavaFormatterOptions

java.lang.Object
com.google.googlejavaformat.java.JavaFormatterOptions

@Immutable public abstract class JavaFormatterOptions extends Object
Options for a google-java-format invocation.

Like gofmt, the google-java-format CLI exposes no configuration options (aside from --aosp).

The goal of google-java-format is to provide consistent formatting, and to free developers from arguments over style choices. It is an explicit non-goal to support developers' individual preferences, and in fact it would work directly against our primary goals.

  • Constructor Details

    • JavaFormatterOptions

      public JavaFormatterOptions()
  • Method Details

    • indentationMultiplier

      public int indentationMultiplier()
      Returns the multiplier for the unit of indent.
    • formatJavadoc

      public abstract boolean formatJavadoc()
    • reorderModifiers

      public abstract boolean reorderModifiers()
    • style

      public abstract JavaFormatterOptions.Style style()
      Returns the code style.
    • defaultOptions

      public static JavaFormatterOptions defaultOptions()
      Returns the default formatting options.
    • builder

      public static JavaFormatterOptions.Builder builder()
      Returns a builder for JavaFormatterOptions.