@Override public void configure(Configuration configuration) throws CheckstyleException { config = configuration; property = configuration.getAttribute("property"); }
/** * Implements the Configurable interface using bean introspection. * * <p>Subclasses are allowed to add behaviour. After the bean * based setup has completed first the method * {@link #finishLocalSetup finishLocalSetup} * is called to allow completion of the bean's local setup, * after that the method {@link #setupChild setupChild} * is called for each {@link Configuration#getChildren child Configuration} * of {@code configuration}. * * @see Configurable */ @Override public final void configure(Configuration config) throws CheckstyleException { configuration = config; final String[] attributes = config.getAttributeNames(); for (final String key : attributes) { final String value = config.getAttribute(key); tryCopyProperty(config.getName(), key, value, true); } finishLocalSetup(); final Configuration[] childConfigs = config.getChildren(); for (final Configuration childConfig : childConfigs) { setupChild(childConfig); } }
if (containsAttribute(recentModule, SEVERITY)) { try { final String severity = recentModule.getAttribute(SEVERITY); level = SeverityLevel.getInstance(severity);
/** * Implements the Configurable interface using bean introspection. * * <p>Subclasses are allowed to add behaviour. After the bean * based setup has completed first the method * {@link #finishLocalSetup finishLocalSetup} * is called to allow completion of the bean's local setup, * after that the method {@link #setupChild setupChild} * is called for each {@link Configuration#getChildren child Configuration} * of {@code configuration}. * * @see Configurable */ @Override public final void configure(Configuration config) throws CheckstyleException { configuration = config; final String[] attributes = config.getAttributeNames(); for (final String key : attributes) { final String value = config.getAttribute(key); tryCopyProperty(config.getName(), key, value, true); } finishLocalSetup(); final Configuration[] childConfigs = config.getChildren(); for (final Configuration childConfig : childConfigs) { setupChild(childConfig); } }
private void verifyWarns(Configuration config, String filePath, String... expected) throws Exception { final int tabWidth = Integer.parseInt(config.getAttribute("tabWidth")); final IndentComment[] linesWithWarn = getLinesWithWarnAndCheckComments(filePath, tabWidth); verify(config, filePath, expected, linesWithWarn); assertEquals("Expected warning count in UT does not match warn" + " comment count in input file", linesWithWarn.length, expected.length); }
configTokens.addAll(Arrays.asList(checkConfig.getAttribute("tokens").trim() .split(",\\s*")));
try ret = config.getAttribute( attributeName );
if (containsAttribute(recentModule, SEVERITY)) { try { final String severity = recentModule.getAttribute(SEVERITY); level = SeverityLevel.getInstance(severity);