本文整理汇总了Java中com.puppycrawl.tools.checkstyle.api.Configuration.getChildren方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getChildren方法的具体用法?Java Configuration.getChildren怎么用?Java Configuration.getChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.puppycrawl.tools.checkstyle.api.Configuration
的用法示例。
在下文中一共展示了Configuration.getChildren方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getModuleConfigs
import com.puppycrawl.tools.checkstyle.api.Configuration; //导入方法依赖的package包/类
/**
* Returns a list of all {@link Configuration} instances for the given module name.
* This implementation uses {@link AbstractModuleTestSupport#getConfiguration()} method inside.
* @param moduleName module name.
* @return {@link Configuration} instance for the given module name.
* @throws CheckstyleException if exception occurs during configuration loading.
*/
protected static List<Configuration> getModuleConfigs(String moduleName)
throws CheckstyleException {
final List<Configuration> result = new ArrayList<Configuration>();
for (Configuration currentConfig : getConfiguration().getChildren()) {
if ("TreeWalker".equals(currentConfig.getName())) {
for (Configuration moduleConfig : currentConfig.getChildren()) {
if (moduleName.equals(moduleConfig.getName())) {
result.add(moduleConfig);
}
}
}
else if (moduleName.equals(currentConfig.getName())) {
result.add(currentConfig);
}
}
return result;
}
示例2: getModules
import com.puppycrawl.tools.checkstyle.api.Configuration; //导入方法依赖的package包/类
public static Set<Configuration> getModules(Configuration config) {
final Set<Configuration> result = new HashSet<Configuration>();
for (Configuration child : config.getChildren()) {
if ("TreeWalker".equals(child.getName())) {
result.addAll(getModules(child));
}
else {
result.add(child);
}
}
return result;
}
示例3: getChecks
import com.puppycrawl.tools.checkstyle.api.Configuration; //导入方法依赖的package包/类
public static Set<Configuration> getChecks(Configuration config) {
final Set<Configuration> result = new HashSet<Configuration>();
for (Configuration child : config.getChildren()) {
if ("TreeWalker".equals(child.getName())) {
result.addAll(getModules(child));
}
}
return result;
}
示例4: defineCharset
import com.puppycrawl.tools.checkstyle.api.Configuration; //导入方法依赖的package包/类
private void defineCharset(Configuration configuration) {
defineModuleCharset(configuration);
for (Configuration module : configuration.getChildren()) {
defineModuleCharset(module);
}
}