Class SVGLoader

java.lang.Object
com.github.weisj.jsvg.parser.SVGLoader

public final class SVGLoader extends 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 Details

  • Constructor Details

    • SVGLoader

      public SVGLoader()
  • Method Details

    • load

      @Nullable public @Nullable SVGDocument load(@NotNull @NotNull URL xmlBase)
    • load

      @Nullable public @Nullable SVGDocument load(@NotNull @NotNull URL xmlBase, @NotNull @NotNull LoaderContext loaderContext)
    • load

      @Nullable public @Nullable SVGDocument load(@NotNull @NotNull InputStream inputStream, @Nullable @Nullable 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 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.