Package org.openpdf.resource
Class HtmlParserConfig.Builder
java.lang.Object
org.openpdf.resource.HtmlParserConfig.Builder
- Enclosing class:
HtmlParserConfig
Builder for creating HtmlParserConfig instances.
-
Method Summary
Modifier and TypeMethodDescriptionallowSelfClosingIframe(boolean allowSelfClosingIframe) Enable or disable self-closing iframe tags.allowSelfClosingTags(boolean allowSelfClosingTags) Enable or disable XHTML-style self-closing tags.attributeNameCase(@Nullable String attributeNameCase) Set the attribute name case handling.build()Build the configuration.elementNameCase(@Nullable String elementNameCase) Set the element name case handling.Set the default character encoding.parseNoScriptContent(boolean parseNoScriptContent) Enable or disable parsing of noscript content as markup.reportErrors(boolean reportErrors) Enable or disable error reporting during parsing.scriptStripCommentDelims(boolean scriptStripCommentDelims) Enable or disable stripping of comment delimiters from script content.styleStripCommentDelims(boolean styleStripCommentDelims) Enable or disable stripping of comment delimiters from style content.
-
Method Details
-
reportErrors
Enable or disable error reporting during parsing.- Parameters:
reportErrors- true to enable error reporting- Returns:
- this builder
-
allowSelfClosingTags
Enable or disable XHTML-style self-closing tags.- Parameters:
allowSelfClosingTags- true to allow self-closing tags- Returns:
- this builder
-
allowSelfClosingIframe
Enable or disable self-closing iframe tags.- Parameters:
allowSelfClosingIframe- true to allow self-closing iframe- Returns:
- this builder
-
parseNoScriptContent
Enable or disable parsing of noscript content as markup.- Parameters:
parseNoScriptContent- true to parse noscript as markup- Returns:
- this builder
-
scriptStripCommentDelims
Enable or disable stripping of comment delimiters from script content.- Parameters:
scriptStripCommentDelims- true to strip comment delimiters- Returns:
- this builder
-
styleStripCommentDelims
Enable or disable stripping of comment delimiters from style content.- Parameters:
styleStripCommentDelims- true to strip comment delimiters- Returns:
- this builder
-
elementNameCase
Set the element name case handling.- Parameters:
elementNameCase- one of "upper", "lower", "default", or null- Returns:
- this builder
-
attributeNameCase
Set the attribute name case handling.- Parameters:
attributeNameCase- one of "upper", "lower", "default", or null- Returns:
- this builder
-
encoding
Set the default character encoding.- Parameters:
encoding- the encoding name (e.g., "UTF-8")- Returns:
- this builder
-
build
Build the configuration.- Returns:
- the configured HtmlParserConfig
-