return tok.getText();
}
}
public static void setDescriptionString(LinkedListTree ast, String description) {
LinkedListToken doc = findDocCommentToken(ast);
LinkedListTree javadoc = null;
LinkedListTree desc = null;
if (doc != null) {
javadoc = parse(getCommentBody(doc));
trimEOF(javadoc);
desc = javadoc.getFirstChild();
}
if (description == null) {
if (desc != null) {
ASTUtils.deleteAllChildren(desc);
doc.setText("/**"+ASTUtils.stringifyNode(javadoc)+"*/");
}
return;
}
assertValidContent(description);
String newline = getNewlineText(ast, javadoc);
if (!description.startsWith("\n")) {
description = "\n" + description;
}
description = description.replaceAll("\n", newline);
LinkedListTree newDesc = parseDescription(description);
if (doc == null) {
String indent = ASTUtils.findIndent(ast);
doc = TokenBuilder.newMLComment("/**"+ASTUtils.stringifyNode(newDesc)+"\n"+indent+" */");
insertDocComment(ast, indent, doc);
} else {
newDesc.appendToken(new LinkedListToken(JavadocParser.NL, newline));
javadoc.setChildWithTokens(0, newDesc);
doc.setText("/**"+ASTUtils.stringifyNode(javadoc)+"*/");
}
}