java.lang.Object
com.google.googlejavaformat.java.SnippetFormatter
public class SnippetFormatter extends Object
Formats a subset of a compilation unit.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSnippetFormatter.SnippetKindThe kind of snippet to format. -
Constructor Summary
Constructors Constructor Description SnippetFormatter() -
Method Summary
Modifier and Type Method Description StringcreateIndentationString(int indentationLevel)ImmutableList<Replacement>format(SnippetFormatter.SnippetKind kind, String source, List<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 ImmutableList<Replacement> format(SnippetFormatter.SnippetKind kind, String source, List<Range<Integer>> ranges, int initialIndent, boolean includeComments) throws FormatterExceptionRuns the Google Java formatter on the given source, with only the given ranges specified.- Throws:
FormatterException
-