Package org.jsoup.parser
Class TagSet
java.lang.Object
org.jsoup.parser.TagSet
A TagSet controls the
Tag configuration for a Document's parse, and its serialization. It contains the initial
defaults, and after the parse, any additionally discovered tags.- Since:
- 1.20.1
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInsert a tag into this TagSet.boolean@Nullable TagGet an existing Tag from this TagSet by tagName and namespace.inthashCode()static TagSetHtml()Returns a mutable copy of the default HTML tag set.Get a Tag by name from this TagSet.valueOf(String tagName, String namespace, ParseSettings settings) Get a Tag by name from this TagSet.
-
Constructor Details
-
TagSet
public TagSet() -
TagSet
-
-
Method Details
-
Html
Returns a mutable copy of the default HTML tag set. -
add
Insert a tag into this TagSet. If the tag already exists, it is replaced.Tags explicitly added like this are considered to be known tags (vs those that are dynamically created via .valueOf() if not already in the set.
- Parameters:
tag- the tag to add- Returns:
- this TagSet
-
get
Get an existing Tag from this TagSet by tagName and namespace. The tag name is not normalized, to support mixed instances.- Parameters:
tagName- the case-sensitive tag namenamespace- the namespace- Returns:
- the tag, or null if not found
-
valueOf
Get a Tag by name from this TagSet. If not previously defined (unknown), returns a new tag.New tags will be added to this TagSet.
- Parameters:
tagName- Name of tag, e.g. "p".namespace- the namespace for the tag.settings- used to control tag name sensitivity- Returns:
- The tag, either defined or new generic.
-
valueOf
Get a Tag by name from this TagSet. If not previously defined (unknown), returns a new tag.New tags will be added to this TagSet.
- Parameters:
tagName- Name of tag, e.g. "p". Case-sensitive.namespace- the namespace for the tag.- Returns:
- The tag, either defined or new generic.
- See Also:
-
equals
-
hashCode
-