Class ParseSettings

java.lang.Object
org.jsoup.parser.ParseSettings

public class ParseSettings extends Object
Controls parser case settings, to optionally preserve tag and/or attribute name case. Case conversion uses ASCII rules. Programmatic name normalization also trims surrounding ASCII whitespace.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ParseSettings
    HTML defaults: lower-case tag and attribute names.
    static final ParseSettings
    Preserve both tag and attribute case.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ParseSettings(boolean tag, boolean attribute)
    Define parse settings.
  • Method Summary

    Modifier and Type
    Method
    Description
    String
    normalizeAttribute(String name)
    Normalizes an attribute name according to these settings.
    String
    normalizeTag(String name)
    Normalizes a tag name according to these settings.
    boolean
    Returns true if preserving attribute case.
    boolean
    Returns true if preserving tag name case.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • htmlDefault

      public static final ParseSettings htmlDefault
      HTML defaults: lower-case tag and attribute names.
    • preserveCase

      public static final ParseSettings preserveCase
      Preserve both tag and attribute case.
  • Constructor Details

    • ParseSettings

      public ParseSettings(boolean tag, boolean attribute)
      Define parse settings.
      Parameters:
      tag - preserve tag case?
      attribute - preserve attribute name case?
  • Method Details

    • preserveTagCase

      public boolean preserveTagCase()
      Returns true if preserving tag name case.
    • preserveAttributeCase

      public boolean preserveAttributeCase()
      Returns true if preserving attribute case.
    • normalizeTag

      public String normalizeTag(String name)
      Normalizes a tag name according to these settings.
    • normalizeAttribute

      public String normalizeAttribute(String name)
      Normalizes an attribute name according to these settings.