public class Tag
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String[] |
blockTags |
private boolean |
canContainInline |
private boolean |
empty |
private static java.lang.String[] |
emptyTags |
private boolean |
formatAsBlock |
private static java.lang.String[] |
formatAsInlineTags |
private boolean |
formList |
private static java.lang.String[] |
formListedTags |
private boolean |
formSubmit |
private static java.lang.String[] |
formSubmitTags |
private static java.lang.String[] |
inlineTags |
private boolean |
isBlock |
private java.lang.String |
normalName |
private boolean |
preserveWhitespace |
private static java.lang.String[] |
preserveWhitespaceTags |
private boolean |
selfClosing |
private java.lang.String |
tagName |
private static java.util.Map<java.lang.String,Tag> |
tags |
Modifier | Constructor and Description |
---|---|
private |
Tag(java.lang.String tagName) |
Modifier and Type | Method and Description |
---|---|
boolean |
canContainBlock()
Deprecated.
No longer used, and no different result than {
isBlock() } |
boolean |
equals(java.lang.Object o) |
boolean |
formatAsBlock()
Gets if this tag should be formatted as a block (or as inline)
|
java.lang.String |
getName()
Get this tag's name.
|
int |
hashCode() |
boolean |
isBlock()
Gets if this is a block tag.
|
boolean |
isData()
Gets if this tag is a data only tag.
|
boolean |
isEmpty()
Get if this is an empty tag
|
boolean |
isFormListed()
Get if this tag represents a control associated with a form.
|
boolean |
isFormSubmittable()
Get if this tag represents an element that should be submitted with a form.
|
boolean |
isInline()
Gets if this tag is an inline tag.
|
boolean |
isKnownTag()
Get if this is a pre-defined tag, or was auto created on parsing.
|
static boolean |
isKnownTag(java.lang.String tagName)
Check if this tagname is a known tag.
|
boolean |
isSelfClosing()
Get if this tag is self closing.
|
java.lang.String |
normalName()
Get this tag's normalized (lowercased) name.
|
boolean |
preserveWhitespace()
Get if this tag should preserve whitespace within child text nodes.
|
private static void |
register(Tag tag) |
(package private) Tag |
setSelfClosing() |
java.lang.String |
toString() |
static Tag |
valueOf(java.lang.String tagName)
Get a Tag by name.
|
static Tag |
valueOf(java.lang.String tagName,
ParseSettings settings)
Get a Tag by name.
|
private static final java.util.Map<java.lang.String,Tag> tags
private java.lang.String tagName
private java.lang.String normalName
private boolean isBlock
private boolean formatAsBlock
private boolean canContainInline
private boolean empty
private boolean selfClosing
private boolean preserveWhitespace
private boolean formList
private boolean formSubmit
private static final java.lang.String[] blockTags
private static final java.lang.String[] inlineTags
private static final java.lang.String[] emptyTags
private static final java.lang.String[] formatAsInlineTags
private static final java.lang.String[] preserveWhitespaceTags
private static final java.lang.String[] formListedTags
private static final java.lang.String[] formSubmitTags
public java.lang.String getName()
public java.lang.String normalName()
public static Tag valueOf(java.lang.String tagName, ParseSettings settings)
Pre-defined tags (P, DIV etc) will be ==, but unknown tags are not registered and will only .equals().
tagName
- Name of tag, e.g. "p". Case insensitive.settings
- used to control tag name sensitivitypublic static Tag valueOf(java.lang.String tagName)
Pre-defined tags (P, DIV etc) will be ==, but unknown tags are not registered and will only .equals().
tagName
- Name of tag, e.g. "p". Case sensitive.public boolean isBlock()
public boolean formatAsBlock()
public boolean canContainBlock()
isBlock()
}public boolean isInline()
public boolean isData()
public boolean isEmpty()
public boolean isSelfClosing()
public boolean isKnownTag()
public static boolean isKnownTag(java.lang.String tagName)
tagName
- name of tagpublic boolean preserveWhitespace()
public boolean isFormListed()
public boolean isFormSubmittable()
Tag setSelfClosing()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
private static void register(Tag tag)