本文整理汇总了Java中com.puppycrawl.tools.checkstyle.api.TokenTypes.AT属性的典型用法代码示例。如果您正苦于以下问题:Java TokenTypes.AT属性的具体用法?Java TokenTypes.AT怎么用?Java TokenTypes.AT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.puppycrawl.tools.checkstyle.api.TokenTypes
的用法示例。
在下文中一共展示了TokenTypes.AT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDefaultTokens
@Override
public int[] getDefaultTokens() {
return new int[] {
TokenTypes.ARRAY_INIT,
TokenTypes.AT,
TokenTypes.INC,
TokenTypes.DEC,
TokenTypes.UNARY_MINUS,
TokenTypes.UNARY_PLUS,
TokenTypes.BNOT,
TokenTypes.LNOT,
TokenTypes.DOT,
TokenTypes.ARRAY_DECLARATOR,
TokenTypes.INDEX_OP,
};
}
示例2: getAcceptableTokens
@Override
public int[] getAcceptableTokens() {
return new int[] {
TokenTypes.ARRAY_INIT,
TokenTypes.AT,
TokenTypes.INC,
TokenTypes.DEC,
TokenTypes.UNARY_MINUS,
TokenTypes.UNARY_PLUS,
TokenTypes.BNOT,
TokenTypes.LNOT,
TokenTypes.DOT,
TokenTypes.TYPECAST,
TokenTypes.ARRAY_DECLARATOR,
TokenTypes.INDEX_OP,
TokenTypes.LITERAL_SYNCHRONIZED,
TokenTypes.METHOD_REF,
};
}
示例3: checkAnnotationIndentation
/**
* Checks line wrapping into annotations.
*
* @param atNode at-clause node.
* @param firstNodesOnLines map which contains
* first nodes as values and line numbers as keys.
* @param indentLevel line wrapping indentation.
*/
private void checkAnnotationIndentation(DetailAST atNode,
NavigableMap<Integer, DetailAST> firstNodesOnLines, int indentLevel) {
final int firstNodeIndent = getLineStart(atNode);
final int currentIndent = firstNodeIndent + indentLevel;
final Collection<DetailAST> values = firstNodesOnLines.values();
final DetailAST lastAnnotationNode = atNode.getParent().getLastChild();
final int lastAnnotationLine = lastAnnotationNode.getLineNo();
final Iterator<DetailAST> itr = values.iterator();
while (firstNodesOnLines.size() > 1) {
final DetailAST node = itr.next();
final DetailAST parentNode = node.getParent();
final boolean isCurrentNodeCloseAnnotationAloneInLine =
node.getLineNo() == lastAnnotationLine
&& isEndOfScope(lastAnnotationNode, node);
if (isCurrentNodeCloseAnnotationAloneInLine
|| node.getType() == TokenTypes.AT
&& (parentNode.getParent().getType() == TokenTypes.MODIFIERS
|| parentNode.getParent().getType() == TokenTypes.ANNOTATIONS)
|| node.getLineNo() == atNode.getLineNo()) {
logWarningMessage(node, firstNodeIndent);
}
else {
logWarningMessage(node, currentIndent);
}
itr.remove();
}
}
示例4: getAcceptableTokens
@Override
public int[] getAcceptableTokens() {
return new int[] {
TokenTypes.DOT,
TokenTypes.COMMA,
TokenTypes.SEMI,
TokenTypes.ELLIPSIS,
TokenTypes.AT,
TokenTypes.LPAREN,
TokenTypes.RPAREN,
TokenTypes.ARRAY_DECLARATOR,
TokenTypes.RBRACK,
TokenTypes.METHOD_REF,
};
}