com.github.javaparser.javadoc.description.JavadocDescriptionElement Java Examples
The following examples show how to use
com.github.javaparser.javadoc.description.JavadocDescriptionElement.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AutoDoc.java From joyqueue with Apache License 2.0 | 5 votes |
/** * JavadocDescription toString **/ private void toString(JavadocDescription description, StringBuilder content) { for (JavadocDescriptionElement e : description.getElements()) { content.append(e.toText()).append(","); } if (content.length() > 0) { content.deleteCharAt(content.length() - 1); } }
Example #2
Source File: CommentHelper.java From apigcc with MIT License | 5 votes |
/** * 获取注释完整字符串 * * @param description * @return */ public static String getDescription(JavadocDescription description) { return description.getElements() .stream() .filter(e -> !(e instanceof JavadocInlineTag)) .map(JavadocDescriptionElement::toText).collect(Collectors.joining()); }
Example #3
Source File: JavaDocParser.java From quarkus with Apache License 2.0 | 5 votes |
private String htmlJavadocToAsciidoc(JavadocDescription javadocDescription) { StringBuilder sb = new StringBuilder(); for (JavadocDescriptionElement javadocDescriptionElement : javadocDescription.getElements()) { if (javadocDescriptionElement instanceof JavadocInlineTag) { JavadocInlineTag inlineTag = (JavadocInlineTag) javadocDescriptionElement; String content = inlineTag.getContent().trim(); switch (inlineTag.getType()) { case CODE: case VALUE: case LITERAL: case SYSTEM_PROPERTY: sb.append('`'); appendEscapedAsciiDoc(sb, content); sb.append('`'); break; case LINK: case LINKPLAIN: if (content.startsWith(HASH)) { content = hyphenate(content.substring(1)); } sb.append('`'); appendEscapedAsciiDoc(sb, content); sb.append('`'); break; default: sb.append(content); break; } } else { appendHtml(sb, Jsoup.parseBodyFragment(javadocDescriptionElement.toText())); } } return sb.toString().trim(); }