本文整理汇总了Java中com.puppycrawl.tools.checkstyle.api.TokenTypes.CHAR_LITERAL属性的典型用法代码示例。如果您正苦于以下问题:Java TokenTypes.CHAR_LITERAL属性的具体用法?Java TokenTypes.CHAR_LITERAL怎么用?Java TokenTypes.CHAR_LITERAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.puppycrawl.tools.checkstyle.api.TokenTypes
的用法示例。
在下文中一共展示了TokenTypes.CHAR_LITERAL属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAcceptableTokens
@Override
public int[] getAcceptableTokens() {
return new int[] {
TokenTypes.NUM_DOUBLE,
TokenTypes.NUM_FLOAT,
TokenTypes.NUM_INT,
TokenTypes.NUM_LONG,
TokenTypes.IDENT,
TokenTypes.COMMENT_CONTENT,
TokenTypes.STRING_LITERAL,
TokenTypes.CHAR_LITERAL,
};
}
示例2: testGetRequiredTokens
@Test
public void testGetRequiredTokens() {
final AvoidEscapedUnicodeCharactersCheck checkObj =
new AvoidEscapedUnicodeCharactersCheck();
final int[] expected = {
TokenTypes.STRING_LITERAL,
TokenTypes.CHAR_LITERAL,
};
assertArrayEquals("Required tokens differ from expected",
expected, checkObj.getRequiredTokens());
}
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:11,代码来源:AvoidEscapedUnicodeCharactersCheckTest.java
示例3: testGetAcceptableTokens
@Test
public void testGetAcceptableTokens() {
final AvoidEscapedUnicodeCharactersCheck check = new AvoidEscapedUnicodeCharactersCheck();
final int[] actual = check.getAcceptableTokens();
final int[] expected = {TokenTypes.STRING_LITERAL, TokenTypes.CHAR_LITERAL };
assertArrayEquals("Acceptable tokens differ from expected",
expected, actual);
}
示例4: isZeroChar
/**
* Examine char literal for initializing to default value.
* @param exprStart expression
* @return true is literal is initialized by zero symbol
*/
private static boolean isZeroChar(DetailAST exprStart) {
return isZero(exprStart)
|| exprStart.getType() == TokenTypes.CHAR_LITERAL
&& "'\\0'".equals(exprStart.getText());
}
示例5: getRequiredTokens
@Override
public int[] getRequiredTokens() {
return new int[] {TokenTypes.STRING_LITERAL, TokenTypes.CHAR_LITERAL};
}