@Test public void testV2ParseDefaultSymbolizers() throws Throwable { final Style style = parseStyle("v2-style-default-symbolizers.json"); final List<FeatureTypeStyle> featureTypeStyles = style.featureTypeStyles(); assertEquals(1, featureTypeStyles.size()); final List<Rule> rules = featureTypeStyles.get(0).rules(); assertEquals(1, rules.size()); final Rule rule = rules.get(0); assertEquals(Filter.INCLUDE, rule.getFilter()); assertEquals(4, rule.symbolizers().size()); PointSymbolizer pointSymbolizer = (PointSymbolizer) rule.symbolizers().get(0); LineSymbolizer lineSymbolizer = (LineSymbolizer) rule.symbolizers().get(1); PolygonSymbolizer polygonSymbolizer = (PolygonSymbolizer) rule.symbolizers().get(2); TextSymbolizer textSymbolizer = (TextSymbolizer) rule.symbolizers().get(3); assertNotNull(pointSymbolizer); assertNotNull(lineSymbolizer); assertNotNull(polygonSymbolizer); assertNotNull(textSymbolizer); }
@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);  }