@Test public void testVersion1StyleParser() throws Throwable { PJsonObject layerJson = parseJSONObjectFromFile(MapfishStyleParserPluginTest.class, "bug_cant_transform_to_xml.json"); Optional<Style> style = parser.parseStyle( null, new TestHttpClientFactory(), layerJson.getString("style")); assertTrue(style.isPresent()); transformer.transform(style.get()); }
@Override public Optional<Style> parseStyle( @Nullable final Configuration configuration, @Nonnull final ClientHttpRequestFactory clientHttpRequestFactory, @Nonnull final String styleString) { final Optional<Style> styleOptional = tryParse( configuration, styleString, clientHttpRequestFactory); if (styleOptional.isPresent()) { return styleOptional; } return ParserPluginUtils.loadStyleAsURI( clientHttpRequestFactory, styleString, (final byte[] input) -> { try { return tryParse( configuration, new String(input, Constants.DEFAULT_CHARSET), clientHttpRequestFactory); } catch (Throwable e) { throw ExceptionUtils.getRuntimeException(e); } }); }
MapfishStyleParserPlugin implements StyleParserPlugin { @Override public Optional<Style> parseStyle( @Nullable final Configuration configuration, @Nonnull final ClientHttpRequestFactory clientHttpRequestFactory, @Nonnull final String styleString) { final Optional<Style> styleOptional = tryParse( configuration, styleString, clientHttpRequestFactory); if (styleOptional.isPresent()) { return styleOptional; } return ParserPluginUtils.loadStyleAsURI( clientHttpRequestFactory, styleString, (final byte[] input) -> { try { return tryParse( configuration, new String(input, Constants.DEFAULT_CHARSET), clientHttpRequestFactory); } catch (Throwable e) { throw ExceptionUtils.getRuntimeException(e); } }); } }
MapfishStyleParserPlugin implements StyleParserPlugin { @Override public Optional<Style> parseStyle( @Nullable final Configuration configuration, @Nonnull final ClientHttpRequestFactory clientHttpRequestFactory, @Nonnull final String styleString) { final Optional<Style> styleOptional = tryParse( configuration, styleString, clientHttpRequestFactory); if (styleOptional.isPresent()) { return styleOptional; } return ParserPluginUtils.loadStyleAsURI( clientHttpRequestFactory, styleString, (final byte[] input) -> { try { return tryParse( configuration, new String(input, Constants.DEFAULT_CHARSET), clientHttpRequestFactory); } catch (Throwable e) { throw ExceptionUtils.getRuntimeException(e); } }); }  }
MapfishStyleParserPlugin implements StyleParserPlugin { @Override public Optional<Style> parseStyle( @Nullable final Configuration configuration, @Nonnull final ClientHttpRequestFactory clientHttpRequestFactory, @Nonnull final String styleString) { final Optional<Style> styleOptional = tryParse( configuration, styleString, clientHttpRequestFactory); if (styleOptional.isPresent()) { return styleOptional; } return ParserPluginUtils.loadStyleAsURI( clientHttpRequestFactory, styleString, (final byte[] input) -> { try { return tryParse( configuration, new String(input, Constants.DEFAULT_CHARSET), clientHttpRequestFactory); } catch (Throwable e) { throw ExceptionUtils.getRuntimeException(e); } }); }  @Override Optional<Style> parseStyle(
            @Nullable final Configuration configuration,
            @Nonnull final ClientHttpRequestFactory clientHttpRequestFactory,
            @Nonnull final String styleString); }
MapfishStyleParserPlugin implements StyleParserPlugin { @Override public Optional<Style> parseStyle( @Nullable final Configuration configuration, @Nonnull final ClientHttpRequestFactory clientHttpRequestFactory, @Nonnull final String styleString) { final Optional<Style> styleOptional = tryParse( configuration, styleString, clientHttpRequestFactory); if (styleOptional.isPresent()) { return styleOptional; } return ParserPluginUtils.loadStyleAsURI( clientHttpRequestFactory, styleString, (final byte[] input) -> { try { return tryParse( configuration, new String(input, Constants.DEFAULT_CHARSET), clientHttpRequestFactory); } catch (Throwable e) { throw ExceptionUtils.getRuntimeException(e); } }); }  @Override Optional<Style> parseStyle(
            @Nullable final Configuration configuration,
            @Nonnull final ClientHttpRequestFactory clientHttpRequestFactory,
            @Nonnull final String styleString);  }