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 Summary

      Fields 
      Modifier and Type Field Description
      private StaxSVGLoader loader  
      (package private) static java.util.logging.Logger LOGGER  
    • Constructor Summary

      Constructors 
      Constructor Description
      SVGLoader()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable SVGDocument load​(@NotNull XMLInput xmlInput, @Nullable java.net.URI xmlBase, @NotNull LoaderContext loaderContext)
      Load an SVG document from the given input stream.
      @Nullable SVGDocument load​(@NotNull java.io.InputStream inputStream, @Nullable java.net.URI xmlBase, @NotNull LoaderContext loaderContext)
      Load an SVG document from the given input stream.
      @Nullable SVGDocument load​(@NotNull java.net.URL xmlBase)  
      @Nullable SVGDocument load​(@NotNull java.net.URL xmlBase, @NotNull LoaderContext loaderContext)  
      • Methods inherited from class java.lang.Object

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

      • LOGGER

        static final java.util.logging.Logger LOGGER
    • 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 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.
      • load

        @Nullable
        public @Nullable SVGDocument load​(@NotNull
                                          @NotNull XMLInput xmlInput,
                                          @Nullable
                                          @Nullable java.net.URI xmlBase,
                                          @NotNull
                                          @NotNull LoaderContext loaderContext)
        Load an SVG document from the given input stream.
        Parameters:
        xmlInput - the supplier for the xml input events
        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.