Class SVGLoader
java.lang.Object
com.github.weisj.jsvg.parser.SVGLoader
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
FieldsModifier and TypeFieldDescriptionprivate final StaxSVGLoader(package private) static final Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable SVGDocumentload(@NotNull XMLInput xmlInput, @Nullable URI xmlBase, @NotNull LoaderContext loaderContext) Load an SVG document from the given input stream.@Nullable SVGDocumentload(@NotNull InputStream inputStream, @Nullable URI xmlBase, @NotNull LoaderContext loaderContext) Load an SVG document from the given input stream.@Nullable SVGDocument@Nullable SVGDocumentload(@NotNull URL xmlBase, @NotNull LoaderContext loaderContext)
-
Field Details
-
LOGGER
-
loader
-
-
Constructor Details
-
SVGLoader
public SVGLoader()
-
-
Method Details
-
load
-
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 fromxmlBase- 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 eventsxmlBase- 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.
-