use of net.sf.eclipsecs.core.config.ConfigurationReader.AdditionalConfigData in project eclipse-cs by checkstyle.
the class CheckerFactory method getAdditionalData.
/**
* Determines the additional data for a given configuration file.
*
* @param config
* the check configuration
* @param project
* the project to create the checker for
* @return the checker for the given configuration file
* @throws CheckstylePluginException
* the configuration could not be read
*/
public static ConfigurationReader.AdditionalConfigData getAdditionalData(ICheckConfiguration config, IProject project) throws CheckstylePluginException {
String cacheKey = getCacheKey(config, project);
AdditionalConfigData additionalData = sAdditionalDataMap.get(cacheKey);
// no cache hit - create the additional data
if (additionalData == null) {
CheckstyleConfigurationFile configFileData = config.getCheckstyleConfiguration();
InputSource in = null;
try {
in = configFileData.getCheckConfigFileInputSource();
additionalData = ConfigurationReader.getAdditionalConfigData(in);
} finally {
Closeables.closeQuietly(in.getByteStream());
}
sAdditionalDataMap.put(cacheKey, additionalData);
}
return additionalData;
}
Aggregations