Package com.google.googlejavaformat.java
Class SnippetFormatter
java.lang.Object
com.google.googlejavaformat.java.SnippetFormatter
Formats a subset of a compilation unit.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe kind of snippet to format. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateIndentationString(int indentationLevel) com.google.common.collect.ImmutableList<Replacement>format(SnippetFormatter.SnippetKind kind, String source, List<com.google.common.collect.Range<Integer>> ranges, int initialIndent, boolean includeComments) Runs the Google Java formatter on the given source, with only the given ranges specified.
-
Constructor Details
-
SnippetFormatter
public SnippetFormatter()
-
-
Method Details
-
createIndentationString
-
format
public com.google.common.collect.ImmutableList<Replacement> format(SnippetFormatter.SnippetKind kind, String source, List<com.google.common.collect.Range<Integer>> ranges, int initialIndent, boolean includeComments) throws FormatterException Runs the Google Java formatter on the given source, with only the given ranges specified.- Throws:
FormatterException
-