public final class DetailNodeTreeStringPrinter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
JAVADOC_START
Symbols with which javadoc starts.
|
private static java.lang.String |
LINE_SEPARATOR
OS specific line separator.
|
Modifier | Constructor and Description |
---|---|
private |
DetailNodeTreeStringPrinter()
Prevent instances.
|
Modifier and Type | Method and Description |
---|---|
private static DetailAST |
createFakeBlockComment(java.lang.String content)
Creates DetailAST block comment to pass it to the Javadoc parser.
|
private static java.lang.String |
getIndentation(DetailNode node)
Get indentation for a node.
|
private static java.lang.String |
getParseErrorMessage(JavadocDetailNodeParser.ParseErrorMessage parseErrorMessage)
Builds error message base on ParseErrorMessage's message key, its arguments, etc.
|
private static DetailNode |
parseFile(java.io.File file)
Parse a file and return the parse tree.
|
static DetailNode |
parseJavadocAsDetailNode(DetailAST blockComment)
Parse block comment DetailAST as Javadoc DetailNode tree.
|
private static DetailNode |
parseJavadocAsDetailNode(java.lang.String javadocComment)
Parse javadoc comment to DetailNode tree.
|
static java.lang.String |
printFileAst(java.io.File file)
Parse a file and print the parse tree.
|
static java.lang.String |
printTree(DetailNode ast,
java.lang.String rootPrefix,
java.lang.String prefix)
Print AST.
|
private static final java.lang.String LINE_SEPARATOR
private static final java.lang.String JAVADOC_START
private DetailNodeTreeStringPrinter()
public static java.lang.String printFileAst(java.io.File file) throws java.io.IOException
file
- the file to print.java.io.IOException
- if the file could not be read.public static DetailNode parseJavadocAsDetailNode(DetailAST blockComment)
blockComment
- DetailASTprivate static DetailNode parseJavadocAsDetailNode(java.lang.String javadocComment)
javadocComment
- javadoc comment contentprivate static java.lang.String getParseErrorMessage(JavadocDetailNodeParser.ParseErrorMessage parseErrorMessage)
parseErrorMessage
- ParseErrorMessagepublic static java.lang.String printTree(DetailNode ast, java.lang.String rootPrefix, java.lang.String prefix)
ast
- the root AST node.rootPrefix
- prefix for the root nodeprefix
- prefix for other nodesprivate static java.lang.String getIndentation(DetailNode node)
node
- the DetailNode to get the indentation for.private static DetailNode parseFile(java.io.File file) throws java.io.IOException
file
- the file to parse.java.io.IOException
- if the file could not be read.private static DetailAST createFakeBlockComment(java.lang.String content)
content
- comment content.