Class SVGLoader


  • public final class SVGLoader
    extends java.lang.Object
    Class for loading svg files as an SVGDocument. Note that this class isn't guaranteed to be thread safe and hence shouldn't be used across multiple threads.
    • Field Detail

      • LOGGER

        static final java.util.logging.Logger LOGGER
      • NODE_SUPPLIER

        @NotNull
        private static final @NotNull NodeSupplier NODE_SUPPLIER
    • Constructor Detail

      • SVGLoader

        public SVGLoader()
    • Method Detail

      • load

        @Nullable
        public @Nullable SVGDocument load​(@NotNull
                                          @NotNull java.net.URL xmlBase)
      • load

        @Nullable
        public @Nullable SVGDocument load​(@NotNull
                                          @NotNull java.net.URL xmlBase,
                                          @NotNull
                                          @NotNull ParserProvider parserProvider)
      • load

        @Nullable
        public @Nullable SVGDocument load​(@NotNull
                                          @NotNull java.net.URL xmlBase,
                                          @NotNull
                                          @NotNull LoaderContext loaderContext)
      • load

        @Nullable
        public @Nullable SVGDocument load​(@NotNull
                                          @NotNull java.io.InputStream inputStream,
                                          @Nullable
                                          @Nullable java.net.URI xmlBase,
                                          @NotNull
                                          @NotNull LoaderContext loaderContext)
        Load an SVG document from the given input stream.
        Parameters:
        inputStream - the input stream to read the SVG document from
        xmlBase - The uri of the document. This is used to resolve external documents (if enabled).
        loaderContext - The loader context to use for loading the document.
        Returns:
        The loaded SVG document or null if an error occurred.
      • createDocumentInputStream

        @Nullable
        static @Nullable java.io.InputStream createDocumentInputStream​(@NotNull
                                                                       @NotNull java.io.InputStream is)