Package org.jsoup.parser
Class TagSet
java.lang.Object
org.jsoup.parser.TagSet
public class TagSet extends Object
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
equals
(Object o) @Nullable Tag
get
(String tagName, String namespace) Get an existing Tag from this TagSet by tagName and namespace.int
hashCode()
static TagSet
Html()
Returns a mutable copy of the default HTML tag set.valueOf
(String tagName, String namespace) Get a Tag by name from this TagSet.valueOf
(String tagName, String namespace, ParseSettings settings) Get a Tag by name from this TagSet.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
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 name -
namespace
- 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
public boolean equals(Object o) - Overrides:
-
equals
in classObject
-
hashCode
public int hashCode()- Overrides:
-
hashCode
in classObject
-