Class HtmlParserConfig.Builder

java.lang.Object
org.openpdf.resource.HtmlParserConfig.Builder
Enclosing class:
HtmlParserConfig

public static final class HtmlParserConfig.Builder extends Object
Builder for creating HtmlParserConfig instances.
  • Method Details

    • reportErrors

      public HtmlParserConfig.Builder reportErrors(boolean reportErrors)
      Enable or disable error reporting during parsing.
      Parameters:
      reportErrors - true to enable error reporting
      Returns:
      this builder
    • allowSelfClosingTags

      public HtmlParserConfig.Builder allowSelfClosingTags(boolean allowSelfClosingTags)
      Enable or disable XHTML-style self-closing tags.
      Parameters:
      allowSelfClosingTags - true to allow self-closing tags
      Returns:
      this builder
    • allowSelfClosingIframe

      public HtmlParserConfig.Builder allowSelfClosingIframe(boolean allowSelfClosingIframe)
      Enable or disable self-closing iframe tags.
      Parameters:
      allowSelfClosingIframe - true to allow self-closing iframe
      Returns:
      this builder
    • parseNoScriptContent

      public HtmlParserConfig.Builder parseNoScriptContent(boolean parseNoScriptContent)
      Enable or disable parsing of noscript content as markup.
      Parameters:
      parseNoScriptContent - true to parse noscript as markup
      Returns:
      this builder
    • scriptStripCommentDelims

      public HtmlParserConfig.Builder scriptStripCommentDelims(boolean scriptStripCommentDelims)
      Enable or disable stripping of comment delimiters from script content.
      Parameters:
      scriptStripCommentDelims - true to strip comment delimiters
      Returns:
      this builder
    • styleStripCommentDelims

      public HtmlParserConfig.Builder styleStripCommentDelims(boolean styleStripCommentDelims)
      Enable or disable stripping of comment delimiters from style content.
      Parameters:
      styleStripCommentDelims - true to strip comment delimiters
      Returns:
      this builder
    • elementNameCase

      public HtmlParserConfig.Builder elementNameCase(@Nullable String elementNameCase)
      Set the element name case handling.
      Parameters:
      elementNameCase - one of "upper", "lower", "default", or null
      Returns:
      this builder
    • attributeNameCase

      public HtmlParserConfig.Builder attributeNameCase(@Nullable String attributeNameCase)
      Set the attribute name case handling.
      Parameters:
      attributeNameCase - one of "upper", "lower", "default", or null
      Returns:
      this builder
    • encoding

      public HtmlParserConfig.Builder encoding(@Nullable String encoding)
      Set the default character encoding.
      Parameters:
      encoding - the encoding name (e.g., "UTF-8")
      Returns:
      this builder
    • build

      public HtmlParserConfig build()
      Build the configuration.
      Returns:
      the configured HtmlParserConfig