use of org.infernus.idea.checkstyle.util.CheckStyleEntityResolver in project checkstyle-idea by jshiell.
the class ConfigurationLocation method extractProperties.
private List<String> extractProperties(@Nullable final InputStream inputStream, @NotNull final ClassLoader checkstyleClassLoader) {
if (inputStream != null) {
try {
final SAXBuilder saxBuilder = new SAXBuilder();
saxBuilder.setEntityResolver(new CheckStyleEntityResolver(this, checkstyleClassLoader));
final Document configDoc = saxBuilder.build(inputStream);
return extractProperties(configDoc.getRootElement());
} catch (Exception e) {
LOG.warn("CheckStyle file could not be parsed for properties.", e);
}
}
return new ArrayList<>();
}
use of org.infernus.idea.checkstyle.util.CheckStyleEntityResolver in project checkstyle-idea by jshiell.
the class ConfigurationLocation method extractProperties.
/**
* Extract all settable properties from the given configuration file.
*
* @param inputStream the configuration file.
* @return the property names.
*/
private List<String> extractProperties(final InputStream inputStream) {
if (inputStream != null) {
try {
final SAXBuilder saxBuilder = new SAXBuilder();
saxBuilder.setEntityResolver(new CheckStyleEntityResolver(this));
final Document configDoc = saxBuilder.build(inputStream);
return extractProperties(configDoc.getRootElement());
} catch (Exception e) {
LOG.warn("CheckStyle file could not be parsed for properties.", e);
}
}
return new ArrayList<>();
}
Aggregations