Class SLDParserPlugin

  • All Implemented Interfaces:
    StyleParserPlugin

    public class SLDParserPlugin
    extends java.lang.Object
    implements StyleParserPlugin
    Basic implementation for loading and parsing an SLD style.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SLDParserPlugin.ErrorHandler
      A default error handler to avoid that error messages like "[Fatal Error] :1:1: Content is not allowed in prolog." are directly printed to STDERR.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String STYLE_INDEX_REF_SEPARATOR
      The separator between the path or url segment for loading the sld and an index of the style to obtain.
    • Constructor Summary

      Constructors 
      Constructor Description
      SLDParserPlugin()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<org.geotools.api.style.Style> parseStyle​(Configuration configuration, org.springframework.http.client.ClientHttpRequestFactory clientHttpRequestFactory, java.lang.String styleString)
      Using the string load a style.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • STYLE_INDEX_REF_SEPARATOR

        public static final java.lang.String STYLE_INDEX_REF_SEPARATOR
        The separator between the path or url segment for loading the sld and an index of the style to obtain.

        SLDs can contains multiple styles. Because of this there needs to be a way to indicate which style is referred to. That is the purpose of the style index.

        See Also:
        Constant Field Values
    • Constructor Detail

      • SLDParserPlugin

        public SLDParserPlugin()
    • Method Detail

      • parseStyle

        public final java.util.Optional<org.geotools.api.style.Style> parseStyle​(@Nullable
                                                                                 Configuration configuration,
                                                                                 @Nonnull
                                                                                 org.springframework.http.client.ClientHttpRequestFactory clientHttpRequestFactory,
                                                                                 @Nonnull
                                                                                 java.lang.String styleString)
        Description copied from interface: StyleParserPlugin
        Using the string load a style. The string can be from a URL, xml, css, whatever. If the string references a file it MUST be within a subdirectory of the configuration directory.
        Specified by:
        parseStyle in interface StyleParserPlugin
        Parameters:
        configuration - the configuration being used for the current print.
        clientHttpRequestFactory - an factory for making http requests.
        styleString - the string that provides the information for loading the style.
        Returns:
        if this plugin can create a style form the string then return the style otherwise Optional.absent().