com.puppycrawl.tools.checkstyle.DefaultContext Java Examples

The following examples show how to use com.puppycrawl.tools.checkstyle.DefaultContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SpringChecks.java    From spring-javaformat with Apache License 2.0 5 votes vote down vote up
@Override
public void finishLocalSetup() {
	ModuleFactory moduleFactory = new FilteredModuleFactory(this.moduleFactory, this.excludes);
	DefaultContext context = new DefaultContext();
	context.add("classLoader", this.classLoader);
	context.add("severity", getSeverity());
	context.add("tabWidth", String.valueOf(getTabWidth()));
	context.add("moduleFactory", moduleFactory);
	Properties properties = new Properties();
	put(properties, "headerType", this.headerType);
	put(properties, "headerCopyrightPattern", this.headerCopyrightPattern);
	put(properties, "headerFile", this.headerFile);
	put(properties, "projectRootPackage", this.projectRootPackage);
	this.checks = new SpringConfigurationLoader(context, moduleFactory).load(new PropertiesExpander(properties));
}
 
Example #2
Source File: CheckFilter.java    From spring-javaformat with Apache License 2.0 5 votes vote down vote up
@Override
public void finishLocalSetup() {
	DefaultContext context = new DefaultContext();
	context.add("severity", getSeverity());
	context.add("tabWidth", String.valueOf(getTabWidth()));
	this.childContext = context;
}
 
Example #3
Source File: SpringConfigurationLoaderTests.java    From spring-javaformat with Apache License 2.0 5 votes vote down vote up
private Collection<FileSetCheck> load(Set<String> excludes) {
	DefaultContext context = new DefaultContext();
	ModuleFactory moduleFactory = new PackageObjectFactory(getClass().getPackage().getName(),
			getClass().getClassLoader());
	moduleFactory = new FilteredModuleFactory(moduleFactory, excludes);
	context.add("moduleFactory", moduleFactory);
	Collection<FileSetCheck> checks = new SpringConfigurationLoader(context, moduleFactory)
			.load(getPropertyResolver());
	return checks;
}
 
Example #4
Source File: ClassFileSetCheck.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
/** @see com.puppycrawl.tools.checkstyle.api.Configurable */
public void finishLocalSetup()
{
    DefaultContext checkContext = new DefaultContext();
    checkContext.add("classLoader", mClassLoader);
    checkContext.add("messageMap", mMessageMap);
    checkContext.add("severity", getSeverity());

    mChildContext = checkContext;
}
 
Example #5
Source File: ClassFileSetCheck.java    From contribution with GNU Lesser General Public License v2.1 5 votes vote down vote up
/** @see com.puppycrawl.tools.checkstyle.api.Configurable */
public void finishLocalSetup()
{
    DefaultContext checkContext = new DefaultContext();
    checkContext.add("classLoader", mClassLoader);
    checkContext.add("messageMap", mMessageMap);
    checkContext.add("severity", getSeverity());

    mChildContext = checkContext;
}