Package com.github.weisj.jsvg.parser
Class SVGDocumentBuilder
- java.lang.Object
-
- com.github.weisj.jsvg.parser.SVGDocumentBuilder
-
public final class SVGDocumentBuilder extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private @NotNull java.util.Deque<@NotNull ParsedElement>
currentNodeStack
private @NotNull LoadHelper
loadHelper
private static int
MAX_USE_NESTING_DEPTH
private @NotNull NodeSupplier
nodeSupplier
private @NotNull ParsedDocument
parsedDocument
private @NotNull ParserProvider
parserProvider
private ParsedElement
rootNode
private @NotNull java.util.List<@NotNull Style>
styleElements
private @NotNull java.util.List<@NotNull StyleSheet>
styleSheets
private @NotNull java.util.List<@NotNull Use>
useElements
-
Constructor Summary
Constructors Constructor Description SVGDocumentBuilder(@NotNull ParserProvider parserProvider, @NotNull ResourceLoader resourceLoader, @NotNull NodeSupplier nodeSupplier)
Deprecated.SVGDocumentBuilder(@Nullable java.net.URI rootURI, @NotNull LoaderContext loaderContext, @NotNull NodeSupplier nodeSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTextContent(char @NotNull [] characterData, int startOffset, int endOffset)
@NotNull SVGDocument
build()
private void
checkNestingDepth(@NotNull SVGNode node, int allowed_depth)
void
endDocument()
void
endElement(@NotNull java.lang.String tagName)
private void
flushText(@NotNull ParsedElement element, boolean segmentBreak)
(package private) @NotNull ParsedDocument
parsedDocument()
(package private) void
postProcess()
(package private) void
preProcess(@Nullable java.net.URI documentUri)
private void
processStyleSheets()
void
startDocument()
boolean
startElement(@NotNull java.lang.String tagName, @NotNull java.util.Map<java.lang.String,java.lang.String> attributes)
private void
validateUseElements()
-
-
-
Field Detail
-
MAX_USE_NESTING_DEPTH
private static final int MAX_USE_NESTING_DEPTH
- See Also:
- Constant Field Values
-
parsedDocument
@NotNull private final @NotNull ParsedDocument parsedDocument
-
useElements
@NotNull private final @NotNull java.util.List<@NotNull Use> useElements
-
styleElements
@NotNull private final @NotNull java.util.List<@NotNull Style> styleElements
-
styleSheets
@NotNull private final @NotNull java.util.List<@NotNull StyleSheet> styleSheets
-
currentNodeStack
@NotNull private final @NotNull java.util.Deque<@NotNull ParsedElement> currentNodeStack
-
parserProvider
@NotNull private final @NotNull ParserProvider parserProvider
-
loadHelper
@NotNull private final @NotNull LoadHelper loadHelper
-
nodeSupplier
@NotNull private final @NotNull NodeSupplier nodeSupplier
-
rootNode
private ParsedElement rootNode
-
-
Constructor Detail
-
SVGDocumentBuilder
@Deprecated public SVGDocumentBuilder(@NotNull @NotNull ParserProvider parserProvider, @NotNull @NotNull ResourceLoader resourceLoader, @NotNull @NotNull NodeSupplier nodeSupplier)
Deprecated.
-
SVGDocumentBuilder
public SVGDocumentBuilder(@Nullable @Nullable java.net.URI rootURI, @NotNull @NotNull LoaderContext loaderContext, @NotNull @NotNull NodeSupplier nodeSupplier)
-
-
Method Detail
-
parsedDocument
@Internal @NotNull @NotNull ParsedDocument parsedDocument()
-
startDocument
public void startDocument()
-
endDocument
public void endDocument()
-
startElement
public boolean startElement(@NotNull @NotNull java.lang.String tagName, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.String> attributes)
-
addTextContent
public void addTextContent(char @NotNull [] characterData, int startOffset, int endOffset)
-
endElement
public void endElement(@NotNull @NotNull java.lang.String tagName)
-
flushText
private void flushText(@NotNull @NotNull ParsedElement element, boolean segmentBreak)
-
preProcess
void preProcess(@Nullable @Nullable java.net.URI documentUri)
-
postProcess
void postProcess()
-
build
@NotNull public @NotNull SVGDocument build()
-
processStyleSheets
private void processStyleSheets()
-
validateUseElements
private void validateUseElements()
-
checkNestingDepth
private void checkNestingDepth(@NotNull @NotNull SVGNode node, int allowed_depth)
-
-