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 Details

  • Method Details

    • child

      public SELF child(Object value)
      Adds a child element to this element.
      Parameters:
      value - The child to add as a child element. Can be a string or HtmlElement. Can also be a container of strings and elements. Can be null (a null entry is added to the children list).
      Returns:
      This object.
    • children

      public SELF children(Object... value)
      Adds one or more child elements to this element.
      Parameters:
      value - The children to add as child elements. Can be a mixture of strings and HtmlElement objects. Can also be containers of strings and elements. Must not be null.
      Returns:
      This object.
    • getChild

      public <T> T getChild(Class<T> type, int index)
      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

      public Object getChild(int index)
      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

      public Object getChild(int... index)
      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

      The children of this element.
      Returns:
      The children of this element, or null if no children are set.
    • setChildren

      @BeanProp("c") public SELF setChildren(List<Object> children)
      Sets the children of this element.
      Parameters:
      children - The new children of this element. Can be null to clear all children.
      Returns:
      This object.