本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}