Package org.apache.juneau.bean.html5
Class HtmlElementMixed<SELF extends HtmlElementMixed<SELF>>
java.lang.Object
org.apache.juneau.bean.html5.HtmlElement<SELF>
org.apache.juneau.bean.html5.HtmlElementMixed<SELF>
- Type Parameters:
SELF- The self type for fluent setters.
- Direct Known Subclasses:
A,Abbr,Address,Article,Aside,Audio,B,Bdo,Blockquote,Body,Button,Canvas,Caption,Cite,Code,Data,Dd,Del,Dfn,Div,Dt,Em,Fieldset,Figcaption,Footer,Form,H1,H2,H3,H4,H5,H6,Header,I,Iframe,Ins,Kbd,Label,Legend,Li,Mark,Meter,Nav,Noscript,Object_,Output,P,Pre,Progress,Q,Rb,Rp,Rt,Rtc,Ruby,S,Samp,Section,Small,Span,Strong,Sub,Sup,Td,Template,Th,Time,U,Var,Video
public abstract class HtmlElementMixed<SELF extends HtmlElementMixed<SELF>>
extends HtmlElement<SELF>
A subclass of HTML elements that contain mixed content (elements and 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 of this element.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
-
HtmlElementMixed
public HtmlElementMixed()
-
-
Method Details
-
child
Adds a child element to this element.- Parameters:
value- The child to add as a child element. Can be a string orHtmlElement. Can also be a container of strings and elements. 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. Can be a mixture of strings andHtmlElementobjects. Can also be containers of strings and elements. Must not benull .- Returns:
- This object.
-
getChild
Returns the child node at the specified index.- Type Parameters:
T- he 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=MIXED) @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 of this element.- Parameters:
children- The new children of this element. Can benull to clear all children.- Returns:
- This object.
-