当前位置: 首页>>代码示例>>Java>>正文


Java DetailAST.toString方法代码示例

本文整理汇总了Java中com.puppycrawl.tools.checkstyle.api.DetailAST.toString方法的典型用法代码示例。如果您正苦于以下问题:Java DetailAST.toString方法的具体用法?Java DetailAST.toString怎么用?Java DetailAST.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.puppycrawl.tools.checkstyle.api.DetailAST的用法示例。


在下文中一共展示了DetailAST.toString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitToken

import com.puppycrawl.tools.checkstyle.api.DetailAST; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST ast) {
    switch (ast.getType()) {
        case TokenTypes.CTOR_DEF:
        case TokenTypes.METHOD_DEF:
        case TokenTypes.INSTANCE_INIT:
        case TokenTypes.STATIC_INIT:
            visitMemberDef(ast);
            break;
        case TokenTypes.SLIST:
            visitSlist(ast);
            break;
        default:
            throw new IllegalStateException(ast.toString());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:17,代码来源:ExecutableStatementCountCheck.java

示例2: leaveToken

import com.puppycrawl.tools.checkstyle.api.DetailAST; //导入方法依赖的package包/类
@Override
public void leaveToken(DetailAST ast) {
    switch (ast.getType()) {
        case TokenTypes.CTOR_DEF:
        case TokenTypes.METHOD_DEF:
        case TokenTypes.INSTANCE_INIT:
        case TokenTypes.STATIC_INIT:
            leaveMemberDef(ast);
            break;
        case TokenTypes.SLIST:
            // Do nothing
            break;
        default:
            throw new IllegalStateException(ast.toString());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:17,代码来源:ExecutableStatementCountCheck.java

示例3: visitToken

import com.puppycrawl.tools.checkstyle.api.DetailAST; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST ast) {
    switch (ast.getType()) {
        case TokenTypes.METHOD_DEF:
            if (isVerifiable(ast)) {
                visitMethodDef(ast);
            }
            break;
        case TokenTypes.VARIABLE_DEF:
            if (isVerifiable(ast)) {
                visitVariableDef(ast);
            }
            break;
        case TokenTypes.PARAMETER_DEF:
            visitParameterDef(ast);
            break;
        case TokenTypes.IMPORT:
            visitImport(ast);
            break;
        default:
            throw new IllegalStateException(ast.toString());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:24,代码来源:IllegalTypeCheck.java

示例4: visitToken

import com.puppycrawl.tools.checkstyle.api.DetailAST; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST ast) {
    switch (ast.getType()) {
        case TokenTypes.CTOR_DEF:
        case TokenTypes.METHOD_DEF:
            visitMethodDef(ast);
            break;
        case TokenTypes.LAMBDA:
            visitLambda();
            break;
        case TokenTypes.LITERAL_RETURN:
            visitReturn(ast);
            break;
        default:
            throw new IllegalStateException(ast.toString());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:18,代码来源:ReturnCountCheck.java

示例5: visitToken

import com.puppycrawl.tools.checkstyle.api.DetailAST; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST ast) {

    switch (ast.getType()) {
        case TokenTypes.PACKAGE_DEF:
            visitPackageDef(ast);
            break;
        case TokenTypes.CLASS_DEF:
            visitClassDef(ast);
            break;
        case TokenTypes.METHOD_DEF:
            visitMethodDef(ast);
            break;
        default:
            throw new IllegalStateException(ast.toString());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:18,代码来源:UncommentedMainCheck.java

示例6: visitToken

import com.puppycrawl.tools.checkstyle.api.DetailAST; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST ast) {
    switch (ast.getType()) {
        case TokenTypes.CTOR_DEF:
        case TokenTypes.METHOD_DEF:
            visitMethodDef(ast);
            break;
        case TokenTypes.ASSIGN:
        case TokenTypes.PLUS_ASSIGN:
        case TokenTypes.MINUS_ASSIGN:
        case TokenTypes.STAR_ASSIGN:
        case TokenTypes.DIV_ASSIGN:
        case TokenTypes.MOD_ASSIGN:
        case TokenTypes.SR_ASSIGN:
        case TokenTypes.BSR_ASSIGN:
        case TokenTypes.SL_ASSIGN:
        case TokenTypes.BAND_ASSIGN:
        case TokenTypes.BXOR_ASSIGN:
        case TokenTypes.BOR_ASSIGN:
            visitAssign(ast);
            break;
        case TokenTypes.INC:
        case TokenTypes.POST_INC:
        case TokenTypes.DEC:
        case TokenTypes.POST_DEC:
            visitIncDec(ast);
            break;
        default:
            throw new IllegalStateException(ast.toString());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:32,代码来源:ParameterAssignmentCheck.java

示例7: leaveToken

import com.puppycrawl.tools.checkstyle.api.DetailAST; //导入方法依赖的package包/类
@Override
public void leaveToken(DetailAST ast) {
    switch (ast.getType()) {
        case TokenTypes.CTOR_DEF:
        case TokenTypes.METHOD_DEF:
            leaveMethodDef();
            break;
        case TokenTypes.ASSIGN:
        case TokenTypes.PLUS_ASSIGN:
        case TokenTypes.MINUS_ASSIGN:
        case TokenTypes.STAR_ASSIGN:
        case TokenTypes.DIV_ASSIGN:
        case TokenTypes.MOD_ASSIGN:
        case TokenTypes.SR_ASSIGN:
        case TokenTypes.BSR_ASSIGN:
        case TokenTypes.SL_ASSIGN:
        case TokenTypes.BAND_ASSIGN:
        case TokenTypes.BXOR_ASSIGN:
        case TokenTypes.BOR_ASSIGN:
        case TokenTypes.INC:
        case TokenTypes.POST_INC:
        case TokenTypes.DEC:
        case TokenTypes.POST_DEC:
            // Do nothing
            break;
        default:
            throw new IllegalStateException(ast.toString());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:30,代码来源:ParameterAssignmentCheck.java

示例8: leaveToken

import com.puppycrawl.tools.checkstyle.api.DetailAST; //导入方法依赖的package包/类
@Override
public void leaveToken(DetailAST ast) {
    switch (ast.getType()) {
        case TokenTypes.CTOR_DEF:
        case TokenTypes.METHOD_DEF:
        case TokenTypes.LAMBDA:
            leave(ast);
            break;
        case TokenTypes.LITERAL_RETURN:
            // Do nothing
            break;
        default:
            throw new IllegalStateException(ast.toString());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:16,代码来源:ReturnCountCheck.java

示例9: visitToken

import com.puppycrawl.tools.checkstyle.api.DetailAST; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST ast) {
    if (ast.getType() == TokenTypes.LITERAL_THROWS) {
        visitLiteralThrows(ast);
    }
    else {
        throw new IllegalStateException(ast.toString());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:10,代码来源:ThrowsCountCheck.java

示例10: visitToken

import com.puppycrawl.tools.checkstyle.api.DetailAST; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST ast) {
    switch (ast.getType()) {
        case TokenTypes.CLASS_DEF:
            visitClassDef(ast);
            break;
        case TokenTypes.VARIABLE_DEF:
            visitVariableDef(ast);
            break;
        default:
            throw new IllegalStateException(ast.toString());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:14,代码来源:MutableExceptionCheck.java

示例11: visitToken

import com.puppycrawl.tools.checkstyle.api.DetailAST; //导入方法依赖的package包/类
@Override
public void visitToken(DetailAST ast) {
    final DetailAST modifiers = ast.findFirstToken(TokenTypes.MODIFIERS);

    switch (ast.getType()) {

        case TokenTypes.PACKAGE_DEF:
            packageName = extractQualifiedName(ast);
            break;

        case TokenTypes.CLASS_DEF:
            registerNestedSubclassToOuterSuperClasses(ast);

            final boolean isFinal = modifiers.findFirstToken(TokenTypes.FINAL) != null;
            final boolean isAbstract = modifiers.findFirstToken(TokenTypes.ABSTRACT) != null;

            final String qualifiedClassName = getQualifiedClassName(ast);
            classes.push(new ClassDesc(qualifiedClassName, isFinal, isAbstract));
            break;

        case TokenTypes.CTOR_DEF:
            if (!ScopeUtils.isInEnumBlock(ast)) {
                final ClassDesc desc = classes.peek();
                if (modifiers.findFirstToken(TokenTypes.LITERAL_PRIVATE) == null) {
                    desc.registerNonPrivateCtor();
                }
                else {
                    desc.registerPrivateCtor();
                }
            }
            break;

        default:
            throw new IllegalStateException(ast.toString());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:37,代码来源:FinalClassCheck.java


注:本文中的com.puppycrawl.tools.checkstyle.api.DetailAST.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。