Class Ysld


  • public class Ysld
    extends Object
    Parses, encodes, and transforms Ysld.
    • Field Detail

      • OPTION_PREFIX

        public static String OPTION_PREFIX
    • Constructor Detail

      • Ysld

        public Ysld()
    • Method Detail

      • xmlReader

        public static XMLStreamReader xmlReader​(Object input)
                                         throws IOException
        Creates an XML reader from an input object.
        Parameters:
        input - THe input object, see reader(Object) for details.
        Throws:
        IOException
      • parse

        public static StyledLayerDescriptor parse​(Object ysld,
                                                  @Nullable
                                                  List<ZoomContextFinder> zCtxtFinders,
                                                  @Nullable
                                                  ResourceLocator locator)
                                           throws IOException
        Parses a Ysld stream into GeoTools style objects.
        Parameters:
        ysld - The Ysld content, anything accepted by reader(Object).
        locator - Resource locator for resolving relative URIs.
        Returns:
        The GeoTools SLD object.
        Throws:
        IOException
      • parse

        public static StyledLayerDescriptor parse​(Object ysld,
                                                  @Nullable
                                                  List<ZoomContextFinder> zCtxtFinders,
                                                  @Nullable
                                                  ResourceLocator locator,
                                                  @Nullable
                                                  UomMapper uomMapper)
                                           throws IOException
        Parses a Ysld stream into GeoTools style objects.
        Parameters:
        ysld - The Ysld content, anything accepted by reader(Object).
        locator - Resource locator for resolving relative URIs.
        Returns:
        The GeoTools SLD object.
        Throws:
        IOException
      • parse

        public static StyledLayerDescriptor parse​(Object ysld)
                                           throws IOException
        Parses a Ysld stream into GeoTools style objects.
        Parameters:
        ysld - The Ysld content, anything accepted by reader(Object).
        Returns:
        The GeoTools SLD object.
        Throws:
        IOException
      • encode

        public static void encode​(StyledLayerDescriptor sld,
                                  Object output)
                           throws IOException
        Encodes a GeoTools style object as Ysld.
        Parameters:
        sld - The sld to encode.
        output - The output object, anything accepted by writer(Object)
        Throws:
        IOException
      • encode

        public static void encode​(StyledLayerDescriptor sld,
                                  Object output,
                                  UomMapper uomMapper)
                           throws IOException
        Encodes a GeoTools style object as Ysld.
        Parameters:
        sld - The sld to encode.
        output - The output object, anything accepted by writer(Object)
        Throws:
        IOException
      • transform

        public static void transform​(XMLStreamReader sld,
                                     Writer ysld)
                              throws IOException
        Transforms an SLD stream to Ysld.
        Parameters:
        sld - SLD xml reader.
        ysld - Ysld writer.
        Throws:
        IOException
      • transform

        public static void transform​(InputStream sld,
                                     Writer ysld)
                              throws IOException
        Transforms an SLD stream to Ysld.
        Parameters:
        sld - SLD xml reader.
        ysld - Ysld writer.
        Throws:
        IOException
      • validate

        public static List<MarkedYAMLException> validate​(Object ysld)
                                                  throws IOException
        Validates a Ysld stream.
        Parameters:
        ysld - The Ysld.
        Returns:
        List of marked exceptions corresponding to validation errors.
        Throws:
        IOException
      • validate

        public static List<MarkedYAMLException> validate​(Object ysld,
                                                         List<ZoomContextFinder> zContextFinders,
                                                         UomMapper uomMapper)
                                                  throws IOException
        Validates a Ysld stream.
        Parameters:
        ysld - The Ysld.
        zContextFinders - additional zoom context finders in order of priority.
        Returns:
        List of marked exceptions corresponding to validation errors.
        Throws:
        IOException