Class JavadocFormatter
java.lang.Object
com.google.googlejavaformat.java.javadoc.JavadocFormatter
Entry point for formatting Javadoc.
This stateless class reads tokens from the stateful lexer and translates them to "requests" and "writes" to the stateful writer. It also munges tokens into "standardized" forms. Finally, it performs postprocessing to convert the written Javadoc to a one-liner if possible or to leave a single blank line if it's empty.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatJavadoc(String input, int blockIndent) Formats the given Javadoc comment, which must start with ∕✱✱ and end with ✱∕.private static StringmakeSingleLineIfPossible(int blockIndent, String input) Returns the given string or a one-line version of it (e.g., "∕✱✱ Tests for foos.private static booleanoneLineJavadoc(String line, int blockIndent) private static Stringprivate static Tokenstandardize(Token token, Token standardToken) private static TokenstandardizeBrToken(Token token) private static TokenstandardizePToken(Token token)
-
Field Details
-
MAX_LINE_LENGTH
static final int MAX_LINE_LENGTH- See Also:
-
STANDARD_BR_TOKEN
-
STANDARD_P_TOKEN
-
SIMPLE_TAG_PATTERN
-
ONE_CONTENT_LINE_PATTERN
-
-
Constructor Details
-
JavadocFormatter
private JavadocFormatter()
-
-
Method Details
-
formatJavadoc
Formats the given Javadoc comment, which must start with ∕✱✱ and end with ✱∕. The output will start and end with the same characters. -
render
-
standardizeBrToken
-
standardizePToken
-
standardize
-
makeSingleLineIfPossible
Returns the given string or a one-line version of it (e.g., "∕✱✱ Tests for foos. ✱∕") if it fits on one line. -
oneLineJavadoc
-