本文整理汇总了Java中com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes.HTML_ELEMENT属性的典型用法代码示例。如果您正苦于以下问题:Java JavadocTokenTypes.HTML_ELEMENT属性的具体用法?Java JavadocTokenTypes.HTML_ELEMENT怎么用?Java JavadocTokenTypes.HTML_ELEMENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes
的用法示例。
在下文中一共展示了JavadocTokenTypes.HTML_ELEMENT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSummarySentence
/**
* Checks if period is at the end of sentence.
* @param ast Javadoc root node.
* @return error string
*/
private static String getSummarySentence(DetailNode ast) {
boolean flag = true;
final StringBuilder result = new StringBuilder(256);
for (DetailNode child : ast.getChildren()) {
if (ALLOWED_TYPES.contains(child.getType())) {
result.append(child.getText());
}
else if (child.getType() == JavadocTokenTypes.HTML_ELEMENT
&& CommonUtils.isBlank(result.toString().trim())) {
result.append(getStringInsideTag(result.toString(),
child.getChildren()[0].getChildren()[0]));
}
else if (child.getType() == JavadocTokenTypes.JAVADOC_TAG) {
flag = false;
}
if (!flag) {
break;
}
}
return result.toString().trim();
}
示例2: getDefaultJavadocTokens
@Override
public int[] getDefaultJavadocTokens() {
return new int[] {
JavadocTokenTypes.NEWLINE,
JavadocTokenTypes.HTML_ELEMENT,
};
}
示例3: visitJavadocToken
@Override
public void visitJavadocToken(DetailNode ast) {
if (ast.getType() == JavadocTokenTypes.NEWLINE && isEmptyLine(ast)) {
checkEmptyLine(ast);
}
else if (ast.getType() == JavadocTokenTypes.HTML_ELEMENT
&& JavadocUtils.getFirstChild(ast).getType() == JavadocTokenTypes.P_TAG_START) {
checkParagraphTag(ast);
}
}
示例4: isLastEmptyLine
/**
* Tests if NEWLINE node is a last node in javadoc.
* @param newLine NEWLINE node.
* @return true, if NEWLINE node is a last node in javadoc.
*/
private static boolean isLastEmptyLine(DetailNode newLine) {
boolean result = true;
DetailNode nextNode = JavadocUtils.getNextSibling(newLine);
while (nextNode != null && nextNode.getType() != JavadocTokenTypes.JAVADOC_TAG) {
if (nextNode.getType() == JavadocTokenTypes.TEXT
&& !CommonUtils.isBlank(nextNode.getText())
|| nextNode.getType() == JavadocTokenTypes.HTML_ELEMENT) {
result = false;
break;
}
nextNode = JavadocUtils.getNextSibling(nextNode);
}
return result;
}