try {
Optional<? extends Style> style = plugin.parseStyle(configuration, clientHttpRequestFactory, styleString, mapContext);
if (style.isPresent()) {
if (LOGGER.isDebugEnabled()) {
try {
final SLDTransformer transformer = new SLDTransformer();
final StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory();
final UserLayer userLayer = styleFactory.createUserLayer();
userLayer.addUserStyle(style.get());
final StyledLayerDescriptor sld = styleFactory.createStyledLayerDescriptor();
sld.addStyledLayer(userLayer);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Loaded style from: \n\n '" + styleString + "': \n\n" + transformer.transform(sld));
}
} catch (Exception e) {
LOGGER.debug("Loaded style from: \n\n '" + styleString + "' \n\n<Unable to transform it to xml>: " + e, e);
}
}