private String getConfigAttribute ( Configuration config , ChainedItem < Configuration > parentConfiguration , String attributeName , String defaultValue ) { String ret ; try { ret = config . getAttribute ( attributeName ) ; } catch ( CheckstyleException e ) { // Try to find the attribute in a parent, if there are any if ( parentConfiguration != null ) { ret = getConfigAttribute ( parentConfiguration . value , parentConfiguration . parent , attributeName , defaultValue ) ; } else { ret = defaultValue ; } } return ret ; }
Get the value of the specified attribute from the Checkstyle configuration . If parentConfigurations is non - null and non - empty the parent configurations are searched if the attribute cannot be found in the current configuration . If the attribute is still not found the specified default value will be returned .