本文整理汇总了Java中com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes.LEADING_ASTERISK属性的典型用法代码示例。如果您正苦于以下问题:Java JavadocTokenTypes.LEADING_ASTERISK属性的具体用法?Java JavadocTokenTypes.LEADING_ASTERISK怎么用?Java JavadocTokenTypes.LEADING_ASTERISK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes
的用法示例。
在下文中一共展示了JavadocTokenTypes.LEADING_ASTERISK属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startsWithInheritDoc
/**
* Checks if the node starts with an {@inheritDoc}.
* @param root The root node to examine.
* @return {@code true} if the javadoc starts with an {@inheritDoc}.
*/
private static boolean startsWithInheritDoc(DetailNode root) {
boolean found = false;
final DetailNode[] children = root.getChildren();
for (int i = 0; !found && i < children.length - 1; i++) {
final DetailNode child = children[i];
if (child.getType() == JavadocTokenTypes.JAVADOC_INLINE_TAG
&& child.getChildren()[1].getType() == JavadocTokenTypes.INHERIT_DOC_LITERAL) {
found = true;
}
else if (child.getType() != JavadocTokenTypes.LEADING_ASTERISK
&& !CommonUtils.isBlank(child.getText())) {
break;
}
}
return found;
}
示例2: isFirstParagraph
/**
* Determines whether or not the line with paragraph tag is first line in javadoc.
* @param paragraphTag paragraph tag.
* @return true, if line with paragraph tag is first line in javadoc.
*/
private static boolean isFirstParagraph(DetailNode paragraphTag) {
boolean result = true;
DetailNode previousNode = JavadocUtils.getPreviousSibling(paragraphTag);
while (previousNode != null) {
if (previousNode.getType() == JavadocTokenTypes.TEXT
&& !CommonUtils.isBlank(previousNode.getText())
|| previousNode.getType() != JavadocTokenTypes.LEADING_ASTERISK
&& previousNode.getType() != JavadocTokenTypes.NEWLINE
&& previousNode.getType() != JavadocTokenTypes.TEXT) {
result = false;
break;
}
previousNode = JavadocUtils.getPreviousSibling(previousNode);
}
return result;
}
示例3: getNearestNode
/**
* Returns nearest node.
* @param node DetailNode node.
* @return nearest node.
*/
private static DetailNode getNearestNode(DetailNode node) {
DetailNode tag = JavadocUtils.getNextSibling(node);
while (tag.getType() == JavadocTokenTypes.LEADING_ASTERISK
|| tag.getType() == JavadocTokenTypes.NEWLINE) {
tag = JavadocUtils.getNextSibling(tag);
}
return tag;
}
示例4: isEmptyLine
/**
* Determines whether or not the line is empty line.
* @param newLine NEWLINE node.
* @return true, if line is empty line.
*/
private static boolean isEmptyLine(DetailNode newLine) {
boolean result = false;
DetailNode previousSibling = JavadocUtils.getPreviousSibling(newLine);
if (previousSibling != null
&& previousSibling.getParent().getType() == JavadocTokenTypes.JAVADOC) {
if (previousSibling.getType() == JavadocTokenTypes.TEXT
&& CommonUtils.isBlank(previousSibling.getText())) {
previousSibling = JavadocUtils.getPreviousSibling(previousSibling);
}
result = previousSibling != null
&& previousSibling.getType() == JavadocTokenTypes.LEADING_ASTERISK;
}
return result;
}