Class HtmlElementContainer
- Direct Known Subclasses:
Colgroup
,Datalist
,Dl
,Figure
,Head
,Html
,Main
,Map
,Ol
,Optgroup
,Select
,Table
,Tbody
,Tfoot
,Thead
,Tr
,Ul
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclass attribute.accesskey attribute.Adds a child element to this element.Adds one or more child elements to this element.contenteditable
(Object value) contenteditable attribute.dir attribute.getChild
(int index) Returns the child node at the specified index.getChild
(int... index) Returns the child node at the specified address.<T> T
Returns the child node at the specified index.The children of this element.hidden attribute.id attribute.lang attribute.onabort attribute.onblur attribute.oncancel attribute.oncanplay attribute.oncanplaythrough
(String value) oncanplaythrough attribute.onchange attribute.onclick attribute.oncuechange
(String value) oncuechange attribute.ondblclick
(String value) ondblclick attribute.ondurationchange
(String value) ondurationchange attribute.onemptied attribute.onended attribute.onerror attribute.onfocus attribute.oninput attribute.oninvalid attribute.onkeydown attribute.onkeypress
(String value) onkeypress attribute.onkeyup attribute.onload attribute.onloadeddata
(String value) onloadeddata attribute.onloadedmetadata
(String value) onloadedmetadata attribute.onloadstart
(String value) onloadstart attribute.onmousedown
(String value) onmousedown attribute.onmouseenter
(String value) onmouseenter attribute.onmouseleave
(String value) onmouseleave attribute.onmousemove
(String value) onmousemove attribute.onmouseout
(String value) onmouseout attribute.onmouseover
(String value) onmouseover attribute.onmouseup attribute.onmousewheel
(String value) onmousewheel attribute.onpause attribute.onplay attribute.onplaying attribute.onprogress
(String value) onprogress attribute.onratechange
(String value) onratechange attribute.onreset attribute.onresize attribute.onscroll attribute.onseeked attribute.onseeking attribute.onselect attribute.onshow attribute.onstalled attribute.onsubmit attribute.onsuspend attribute.ontimeupdate
(String value) ontimeupdate attribute.ontoggle attribute.onvolumechange
(String value) onvolumechange attribute.onwaiting attribute.setChildren
(List<Object> children) Sets the children for this container.spellcheck
(Object value) spellcheck attribute.style attribute.tabindex attribute.title attribute.translate attribute.Methods inherited from class org.apache.juneau.bean.html5.HtmlElement
attr, attrUri, deminimize, getAttr, getAttr, getAttrs, setAttrs, toString
-
Constructor Details
-
HtmlElementContainer
public HtmlElementContainer()
-
-
Method Details
-
getChildren
@Xml(format=ELEMENTS) @Beanp(dictionary=HtmlBeanDictionary.class, name="c") public List<Object> getChildren()The children of this element.- Returns:
- The children of this element.
-
setChildren
Sets the children for this container.- Parameters:
children
- The new children for this container.- Returns:
- This object.
-
getChild
Returns the child node at the specified index.- Parameters:
index
- The index of the node in the list of children.- Returns:
- The child node, or
null if it doesn't exist.
-
getChild
Returns the child node at the specified address.Indexes are zero-indexed.
For example, calling
getChild(1,2,3); will return the 4th child of the 3rd child of the 2nd child.- Parameters:
index
- The child indexes.- Returns:
- The child node, or
null if it doesn't point to a valid child.
-
getChild
Returns the child node at the specified index.- Type Parameters:
T
- The class type of the node.- Parameters:
type
- The class type of the node.index
- The index of the node in the list of children.- Returns:
- The child node, or
null if it doesn't exist. - Throws:
InvalidDataConversionException
- If node is not the expected type.
-
children
Adds one or more child elements to this element.- Parameters:
children
- The children to add as child elements.- Returns:
- This object.
-
child
Adds a child element to this element.- Parameters:
child
- The child to add as a child element.- Returns:
- This object.
-
_class
Description copied from class:HtmlElement
class attribute.Specifies one or more CSS class names for the element, separated by spaces. These classes can be used for styling and JavaScript selection.
- Overrides:
_class
in classHtmlElement
- Returns:
- This object.
-
accesskey
Description copied from class:HtmlElement
accesskey attribute.Defines a keyboard shortcut to activate or focus an element. The value should be a single character that, when pressed with a modifier key (usually Alt), activates the element.
- Overrides:
accesskey
in classHtmlElement
- Returns:
- This object.
-
contenteditable
Description copied from class:HtmlElement
contenteditable attribute.Indicates whether the element's content is editable by the user.
Possible values:
"true" or empty string - Element content is editable"false" - Element content is not editable"plaintext-only" - Element content is editable, but rich text formatting is disabled
- Overrides:
contenteditable
in classHtmlElement
- Returns:
- This object.
-
dir
Description copied from class:HtmlElement
dir attribute.Specifies the text direction of the element's content.
Possible values:
"ltr" - Left-to-right text direction"rtl" - Right-to-left text direction"auto" - Browser determines direction based on content
- Overrides:
dir
in classHtmlElement
- Returns:
- This object.
-
id
Description copied from class:HtmlElement
id attribute.Specifies a unique identifier for the element. The ID must be unique within the document and can be used for CSS styling, JavaScript selection, and anchor links.
- Overrides:
id
in classHtmlElement
- Returns:
- This object.
-
lang
Description copied from class:HtmlElement
lang attribute.Specifies the primary language of the element's content using a language tag. This helps with accessibility, search engines, and browser features like spell checking.
- Overrides:
lang
in classHtmlElement
- Returns:
- This object.
-
onabort
Description copied from class:HtmlElement
onabort attribute.Event handler for when an operation is aborted (e.g., image loading is cancelled).
- Overrides:
onabort
in classHtmlElement
- Returns:
- This object.
-
onblur
Description copied from class:HtmlElement
onblur attribute.Event handler for when the element loses focus.
Note:
If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:
- If using single quotes for attributes:
onblur( "validate(\"email\")" ) - If using double quotes for attributes:
onblur( "validate('email')" )
- Overrides:
onblur
in classHtmlElement
- Returns:
- This object.
- If using single quotes for attributes:
-
oncancel
Description copied from class:HtmlElement
oncancel attribute.Event handler for when a dialog is cancelled.
- Overrides:
oncancel
in classHtmlElement
- Returns:
- This object.
-
oncanplay
Description copied from class:HtmlElement
oncanplay attribute.Event handler for when the media can start playing (enough data has been buffered).
- Overrides:
oncanplay
in classHtmlElement
- Returns:
- This object.
-
oncanplaythrough
Description copied from class:HtmlElement
oncanplaythrough attribute.Event handler for when the media can play through to the end without buffering.
- Overrides:
oncanplaythrough
in classHtmlElement
- Returns:
- This object.
-
onchange
Description copied from class:HtmlElement
onchange attribute.Event handler for when the value of a form element changes and loses focus.
Note:
If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:
- If using single quotes for attributes:
onchange( "validate(\"field\")" ) - If using double quotes for attributes:
onchange( "validate('field')" )
- Overrides:
onchange
in classHtmlElement
- Returns:
- This object.
- If using single quotes for attributes:
-
onclick
Description copied from class:HtmlElement
onclick attribute.Event handler for when the element is clicked.
Note:
If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:
- If using single quotes for attributes:
onclick( "alert(\"Hello\")" ) - If using double quotes for attributes:
onclick( "alert('Hello')" )
- Overrides:
onclick
in classHtmlElement
- Returns:
- This object.
- If using single quotes for attributes:
-
oncuechange
Description copied from class:HtmlElement
oncuechange attribute.Event handler for when a text track cue changes.
- Overrides:
oncuechange
in classHtmlElement
- Returns:
- This object.
-
ondblclick
Description copied from class:HtmlElement
ondblclick attribute.Event handler for when the element is double-clicked.
- Overrides:
ondblclick
in classHtmlElement
- Returns:
- This object.
-
ondurationchange
Description copied from class:HtmlElement
ondurationchange attribute.Event handler for when the duration of the media changes.
- Overrides:
ondurationchange
in classHtmlElement
- Returns:
- This object.
-
onemptied
Description copied from class:HtmlElement
onemptied attribute.Event handler for when the media element becomes empty (e.g., network error).
- Overrides:
onemptied
in classHtmlElement
- Returns:
- This object.
-
onended
Description copied from class:HtmlElement
onended attribute.Event handler for when the media playback reaches the end.
- Overrides:
onended
in classHtmlElement
- Returns:
- This object.
-
onerror
Description copied from class:HtmlElement
onerror attribute.Event handler for when an error occurs (e.g., failed resource loading).
- Overrides:
onerror
in classHtmlElement
- Returns:
- This object.
-
onfocus
Description copied from class:HtmlElement
onfocus attribute.Event handler for when the element receives focus.
Note:
If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:
- If using single quotes for attributes:
onfocus( "highlight(\"field\")" ) - If using double quotes for attributes:
onfocus( "highlight('field')" )
- Overrides:
onfocus
in classHtmlElement
- Returns:
- This object.
- If using single quotes for attributes:
-
oninput
Description copied from class:HtmlElement
oninput attribute.Event handler for when the value of an input element changes (fires on every keystroke).
- Overrides:
oninput
in classHtmlElement
- Returns:
- This object.
-
oninvalid
Description copied from class:HtmlElement
oninvalid attribute.Event handler for when form validation fails.
- Overrides:
oninvalid
in classHtmlElement
- Returns:
- This object.
-
onkeydown
Description copied from class:HtmlElement
onkeydown attribute.Event handler for when a key is pressed down.
- Overrides:
onkeydown
in classHtmlElement
- Returns:
- This object.
-
onkeypress
Description copied from class:HtmlElement
onkeypress attribute.Event handler for when a key is pressed (deprecated, use onkeydown instead).
- Overrides:
onkeypress
in classHtmlElement
- Returns:
- This object.
-
onkeyup
Description copied from class:HtmlElement
onkeyup attribute.Event handler for when a key is released.
- Overrides:
onkeyup
in classHtmlElement
- Returns:
- This object.
-
onload
Description copied from class:HtmlElement
onload attribute.Event handler for when the element and its resources have finished loading.
Note:
If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:
- If using single quotes for attributes:
onload( "init(\"config\")" ) - If using double quotes for attributes:
onload( "init('config')" )
- Overrides:
onload
in classHtmlElement
- Returns:
- This object.
- If using single quotes for attributes:
-
onloadeddata
Description copied from class:HtmlElement
onloadeddata attribute.Event handler for when the first frame of media has finished loading.
- Overrides:
onloadeddata
in classHtmlElement
- Returns:
- This object.
-
onloadedmetadata
Description copied from class:HtmlElement
onloadedmetadata attribute.Event handler for when metadata (duration, dimensions, etc.) has been loaded.
- Overrides:
onloadedmetadata
in classHtmlElement
- Returns:
- This object.
-
onloadstart
Description copied from class:HtmlElement
onloadstart attribute.Event handler for when the browser starts loading the media.
- Overrides:
onloadstart
in classHtmlElement
- Returns:
- This object.
-
onmousedown
Description copied from class:HtmlElement
onmousedown attribute.Event handler for when a mouse button is pressed down on the element.
- Overrides:
onmousedown
in classHtmlElement
- Returns:
- This object.
-
onmouseenter
Description copied from class:HtmlElement
onmouseenter attribute.Event handler for when the mouse pointer enters the element (does not bubble).
- Overrides:
onmouseenter
in classHtmlElement
- Returns:
- This object.
-
onmouseleave
Description copied from class:HtmlElement
onmouseleave attribute.Event handler for when the mouse pointer leaves the element (does not bubble).
- Overrides:
onmouseleave
in classHtmlElement
- Returns:
- This object.
-
onmousemove
Description copied from class:HtmlElement
onmousemove attribute.Event handler for when the mouse pointer moves over the element.
- Overrides:
onmousemove
in classHtmlElement
- Returns:
- This object.
-
onmouseout
Description copied from class:HtmlElement
onmouseout attribute.Event handler for when the mouse pointer moves out of the element (bubbles).
- Overrides:
onmouseout
in classHtmlElement
- Returns:
- This object.
-
onmouseover
Description copied from class:HtmlElement
onmouseover attribute.Event handler for when the mouse pointer moves over the element (bubbles).
Note:
If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:
- If using single quotes for attributes:
onmouseover( "showTooltip(\"info\")" ) - If using double quotes for attributes:
onmouseover( "showTooltip('info')" )
- Overrides:
onmouseover
in classHtmlElement
- Returns:
- This object.
- If using single quotes for attributes:
-
onmouseup
Description copied from class:HtmlElement
onmouseup attribute.Event handler for when a mouse button is released over the element.
- Overrides:
onmouseup
in classHtmlElement
- Returns:
- This object.
-
onmousewheel
Description copied from class:HtmlElement
onmousewheel attribute.Event handler for when the mouse wheel is rotated over the element (deprecated, use onwheel).
- Overrides:
onmousewheel
in classHtmlElement
- Returns:
- This object.
-
onpause
Description copied from class:HtmlElement
onpause attribute.Event handler for when media playback is paused.
- Overrides:
onpause
in classHtmlElement
- Returns:
- This object.
-
onplay
Description copied from class:HtmlElement
onplay attribute.Event handler for when media playback starts.
- Overrides:
onplay
in classHtmlElement
- Returns:
- This object.
-
onplaying
Description copied from class:HtmlElement
onplaying attribute.Event handler for when media playback starts after being paused or delayed.
- Overrides:
onplaying
in classHtmlElement
- Returns:
- This object.
-
onprogress
Description copied from class:HtmlElement
onprogress attribute.Event handler for when the browser is downloading media data.
- Overrides:
onprogress
in classHtmlElement
- Returns:
- This object.
-
onratechange
Description copied from class:HtmlElement
onratechange attribute.Event handler for when the playback rate of media changes.
- Overrides:
onratechange
in classHtmlElement
- Returns:
- This object.
-
onreset
Description copied from class:HtmlElement
onreset attribute.Event handler for when a form is reset.
- Overrides:
onreset
in classHtmlElement
- Returns:
- This object.
-
onresize
Description copied from class:HtmlElement
onresize attribute.Event handler for when the element is resized.
- Overrides:
onresize
in classHtmlElement
- Returns:
- This object.
-
onscroll
Description copied from class:HtmlElement
onscroll attribute.Event handler for when the element's scrollbar is scrolled.
- Overrides:
onscroll
in classHtmlElement
- Returns:
- This object.
-
onseeked
Description copied from class:HtmlElement
onseeked attribute.Event handler for when a seek operation completes.
- Overrides:
onseeked
in classHtmlElement
- Returns:
- This object.
-
onseeking
Description copied from class:HtmlElement
onseeking attribute.Event handler for when a seek operation begins.
- Overrides:
onseeking
in classHtmlElement
- Returns:
- This object.
-
onselect
Description copied from class:HtmlElement
onselect attribute.Event handler for when text is selected in the element.
- Overrides:
onselect
in classHtmlElement
- Returns:
- This object.
-
onshow
Description copied from class:HtmlElement
onshow attribute.Event handler for when a context menu is shown.
- Overrides:
onshow
in classHtmlElement
- Returns:
- This object.
-
onstalled
Description copied from class:HtmlElement
onstalled attribute.Event handler for when media loading is stalled.
- Overrides:
onstalled
in classHtmlElement
- Returns:
- This object.
-
onsubmit
Description copied from class:HtmlElement
onsubmit attribute.Event handler for when a form is submitted.
Note:
If your HTML serializer is configured to use single quotes for attribute values, you should use double quotes in your JavaScript code, and vice versa. Otherwise, the quotes will be converted to HTML entities. For example:
- If using single quotes for attributes:
onsubmit( "return validate(\"form\")" ) - If using double quotes for attributes:
onsubmit( "return validate('form')" )
- Overrides:
onsubmit
in classHtmlElement
- Returns:
- This object.
- If using single quotes for attributes:
-
onsuspend
Description copied from class:HtmlElement
onsuspend attribute.Event handler for when media loading is suspended.
- Overrides:
onsuspend
in classHtmlElement
- Returns:
- This object.
-
ontimeupdate
Description copied from class:HtmlElement
ontimeupdate attribute.Event handler for when the current playback position changes.
- Overrides:
ontimeupdate
in classHtmlElement
- Returns:
- This object.
-
ontoggle
Description copied from class:HtmlElement
ontoggle attribute.Event handler for when a details element is opened or closed.
- Overrides:
ontoggle
in classHtmlElement
- Returns:
- This object.
-
onvolumechange
Description copied from class:HtmlElement
onvolumechange attribute.Event handler for when the volume of media changes.
- Overrides:
onvolumechange
in classHtmlElement
- Returns:
- This object.
-
onwaiting
Description copied from class:HtmlElement
onwaiting attribute.Event handler for when media playback stops to buffer more data.
- Overrides:
onwaiting
in classHtmlElement
- Returns:
- This object.
-
spellcheck
Description copied from class:HtmlElement
spellcheck attribute.Indicates whether the element should have its spelling and grammar checked.
Possible values:
"true" - Enable spell checking for this element"false" - Disable spell checking for this element
- Overrides:
spellcheck
in classHtmlElement
- Returns:
- This object.
-
style
Description copied from class:HtmlElement
style attribute.Specifies inline CSS styles for the element. The value should be valid CSS property-value pairs separated by semicolons.
- Overrides:
style
in classHtmlElement
- Returns:
- This object.
-
tabindex
Description copied from class:HtmlElement
tabindex attribute.Specifies the tab order of the element when navigating with the keyboard.
Possible values:
- Positive integer - Element is focusable and participates in tab order
"0" - Element is focusable but not in tab order- Negative integer - Element is not focusable
- Overrides:
tabindex
in classHtmlElement
- Returns:
- This object.
-
title
Description copied from class:HtmlElement
title attribute.Specifies additional information about the element, typically displayed as a tooltip when the user hovers over the element.
- Overrides:
title
in classHtmlElement
- Returns:
- This object.
-
translate
Description copied from class:HtmlElement
translate attribute.Specifies whether the element's content should be translated when the page is localized.
Possible values:
"yes" - Content should be translated (default)"no" - Content should not be translated
- Overrides:
translate
in classHtmlElement
- Returns:
- This object.
-