Package org.apache.juneau.bean.html5
Class HtmlElementContainer<SELF extends HtmlElementContainer<SELF>>
java.lang.Object
org.apache.juneau.bean.html5.HtmlElement<SELF>
org.apache.juneau.bean.html5.HtmlElementContainer<SELF>
- Type Parameters:
SELF- The self type for fluent setters.
- Direct Known Subclasses:
Colgroup,Datalist,Dl,Figure,Head,Html,Main,Map,Ol,Optgroup,Select,Table,Tbody,Tfoot,Thead,Tr,Ul
public abstract class HtmlElementContainer<SELF extends HtmlElementContainer<SELF>>
extends HtmlElement<SELF>
A subclass of HTML elements that contain only other elements, not text.
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a child element to this element.Adds one or more child elements to this element.getChild(int index) Returns the child node at the specified index.getChild(int... index) Returns the child node at the specified address.<T> TReturns the child node at the specified index.The children of this element.setChildren(List<Object> children) Sets the children for this container.Methods inherited from class org.apache.juneau.bean.html5.HtmlElement
accesskey, attr, attrUri, class_, contenteditable, deminimize, dir, getAttr, getAttr, getAttrs, hidden, id, lang, onabort, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, oncuechange, ondblclick, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting, self, setAttrs, spellcheck, style, tabindex, title, toString, translate
-
Constructor Details
-
HtmlElementContainer
public HtmlElementContainer()
-
-
Method Details
-
child
Adds a child element to this element.- Parameters:
value- The child to add as a child element. Can benull (anull entry is added to the children list).- Returns:
- This object.
-
children
Adds one or more child elements to this element.- Parameters:
value- The children to add as child elements. Must not benull .- Returns:
- This object.
-
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:
InvalidConversionException- If node is not the expected type.
-
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.
-
getChildren
@Xml(format=FREEFORM) @BeanProp(name="c") @MarshalledProp(dictionary=HtmlBeanDictionary.class) public List<Object> getChildren()The children of this element.- Returns:
- The children of this element, or
null if no children are set.
-
setChildren
Sets the children for this container.- Parameters:
children- The new children for this container. Can benull to clear all children.- Returns:
- This object.
-