public class HtmlElementType extends Object
See HtmlElement.getElementType()
.
The properties of this object are mainly used in rendering.
Modifier and Type | Field and Description |
---|---|
String |
name
The name of this element, for example "div".
|
boolean |
isVoid
Whether this is a "void" element, one that cannot contain children.
|
boolean |
isBlock
Whether this is a block element.
|
boolean |
isPre
Whether spaces should be preserved inside this element.
|
Constructor and Description |
---|
HtmlElementType(String name,
boolean isVoid,
boolean isBlock,
boolean isPre)
Create an HtmlElementType.
|
public final String name
public final boolean isVoid
For example, <img> is a void element.
A void element must not have an end tag. Don't use self-closing (e.g. <img ... />) either.
public final boolean isBlock
For example, <div> is a block element.
It is safe to introduce spaces around block elements.
See HtmlPiece.isBlock()
.
An element is either a block or an inline element.
public final boolean isPre
For example, <pre> <script> <style> <textarea>
are "pre" elements.
public HtmlElementType(String name, boolean isVoid, boolean isBlock, boolean isPre)
Example usage: new HtmlElementType("div", false, true, false)