use of org.geotools.styling.StyleFactory in project hale by halestudio.
the class SLDStyleReader method execute.
/**
* @see AbstractIOProvider#execute(ProgressIndicator, IOReporter)
*/
@Override
protected IOReport execute(ProgressIndicator progress, IOReporter reporter) throws IOProviderConfigurationException, IOException {
progress.begin("Load styles from SLD", ProgressIndicator.UNKNOWN);
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null);
InputStream in = getSource().getInput();
try {
SLDParser stylereader = new SLDParser(styleFactory, in);
styles = stylereader.readXML();
reporter.setSuccess(true);
} catch (Exception e) {
reporter.error(new IOMessageImpl("Loading styles from SLD failed.", e));
reporter.setSuccess(false);
} finally {
in.close();
progress.end();
}
return reporter;
}
Aggregations