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


Java CommonUtils.relativizeAndNormalizePath方法代码示例

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


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

示例1: fireErrors

import com.puppycrawl.tools.checkstyle.utils.CommonUtils; //导入方法依赖的package包/类
/**
 * Notify all listeners about the errors in a file.
 *
 * @param fileName the audited file
 * @param errors the audit errors from the file
 */
@Override
public void fireErrors(String fileName, SortedSet<LocalizedMessage> errors) {
    final String stripped = CommonUtils.relativizeAndNormalizePath(basedir, fileName);
    boolean hasNonFilteredViolations = false;
    for (final LocalizedMessage element : errors) {
        final AuditEvent event = new AuditEvent(this, stripped, element);
        if (filters.accept(event)) {
            hasNonFilteredViolations = true;
            for (final AuditListener listener : listeners) {
                listener.addError(event);
            }
        }
    }
    if (hasNonFilteredViolations && cache != null) {
        cache.remove(fileName);
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:24,代码来源:Checker.java

示例2: fireFileStarted

import com.puppycrawl.tools.checkstyle.utils.CommonUtils; //导入方法依赖的package包/类
/**
 * Notify all listeners about the beginning of a file audit.
 *
 * @param fileName
 *            the file to be audited
 */
@Override
public void fireFileStarted(String fileName) {
    final String stripped = CommonUtils.relativizeAndNormalizePath(basedir, fileName);
    final AuditEvent event = new AuditEvent(this, stripped);
    for (final AuditListener listener : listeners) {
        listener.fileStarted(event);
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:15,代码来源:Checker.java

示例3: fireFileFinished

import com.puppycrawl.tools.checkstyle.utils.CommonUtils; //导入方法依赖的package包/类
/**
 * Notify all listeners about the end of a file audit.
 *
 * @param fileName
 *            the audited file
 */
@Override
public void fireFileFinished(String fileName) {
    final String stripped = CommonUtils.relativizeAndNormalizePath(basedir, fileName);
    final AuditEvent event = new AuditEvent(this, stripped);
    for (final AuditListener listener : listeners) {
        listener.fileFinished(event);
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:15,代码来源:Checker.java

示例4: acceptFileStarted

import com.puppycrawl.tools.checkstyle.utils.CommonUtils; //导入方法依赖的package包/类
/**
 * Check if all before execution file filters accept starting the file.
 *
 * @param fileName
 *            the file to be audited
 * @return {@code true} if the file is accepted.
 */
private boolean acceptFileStarted(String fileName) {
    final String stripped = CommonUtils.relativizeAndNormalizePath(basedir, fileName);
    return beforeExecutionFileFilters.accept(stripped);
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:12,代码来源:Checker.java


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