Interface ElementBuilderBase<T extends ElementBuilderBase<?>>

Type Parameters:
T - the builder type returns from build methods
All Known Subinterfaces:
AnchorBuilder, AreaBuilder, AudioBuilder, BaseBuilder, BodyBuilder, BRBuilder, ButtonBuilder, CanvasBuilder, DivBuilder, DListBuilder, ElementBuilder, FieldSetBuilder, FormBuilder, FrameBuilder, FrameSetBuilder, HeadBuilder, HeadingBuilder, HRBuilder, IFrameBuilder, ImageBuilder, InputBuilder, LabelBuilder, LegendBuilder, LIBuilder, LinkBuilder, MapBuilder, MediaBuilder<T>, MetaBuilder, ModBuilder, OListBuilder, OptGroupBuilder, OptionBuilder, ParagraphBuilder, ParamBuilder, PreBuilder, QuoteBuilder, ScriptBuilder, SelectBuilder, SourceBuilder, SpanBuilder, StyleBuilder, TableBuilder, TableCaptionBuilder, TableCellBuilder, TableColBuilder, TableRowBuilder, TableSectionBuilder, TextAreaBuilder, TitleBuilder, UListBuilder, VideoBuilder
All Known Implementing Classes:
AbstractElementBuilderBase, DomAnchorBuilder, DomAreaBuilder, DomAudioBuilder, DomBaseBuilder, DomBodyBuilder, DomBRBuilder, DomButtonBuilder, DomCanvasBuilder, DomDivBuilder, DomDListBuilder, DomElementBuilder, DomElementBuilderBase, DomFieldSetBuilder, DomFormBuilder, DomFrameBuilder, DomFrameSetBuilder, DomHeadBuilder, DomHeadingBuilder, DomHRBuilder, DomIFrameBuilder, DomImageBuilder, DomInputBuilder, DomLabelBuilder, DomLegendBuilder, DomLIBuilder, DomLinkBuilder, DomMapBuilder, DomMediaBuilderBase, DomMetaBuilder, DomModBuilder, DomOListBuilder, DomOptGroupBuilder, DomOptionBuilder, DomParagraphBuilder, DomParamBuilder, DomPreBuilder, DomQuoteBuilder, DomScriptBuilder, DomSelectBuilder, DomSourceBuilder, DomSpanBuilder, DomStyleBuilder, DomTableBuilder, DomTableCaptionBuilder, DomTableCellBuilder, DomTableColBuilder, DomTableRowBuilder, DomTableSectionBuilder, DomTextAreaBuilder, DomUListBuilder, DomVideoBuilder, HtmlAnchorBuilder, HtmlAreaBuilder, HtmlAudioBuilder, HtmlBaseBuilder, HtmlBodyBuilder, HtmlBRBuilder, HtmlButtonBuilder, HtmlCanvasBuilder, HtmlDivBuilder, HtmlDListBuilder, HtmlElementBuilder, HtmlElementBuilderBase, HtmlFieldSetBuilder, HtmlFormBuilder, HtmlFrameBuilder, HtmlFrameSetBuilder, HtmlHeadBuilder, HtmlHeadingBuilder, HtmlHRBuilder, HtmlIFrameBuilder, HtmlImageBuilder, HtmlInputBuilder, HtmlLabelBuilder, HtmlLegendBuilder, HtmlLIBuilder, HtmlLinkBuilder, HtmlMapBuilder, HtmlMediaBuilderBase, HtmlMetaBuilder, HtmlOListBuilder, HtmlOnlyTableSectionBuilder, HtmlOptGroupBuilder, HtmlOptionBuilder, HtmlParagraphBuilder, HtmlParamBuilder, HtmlPreBuilder, HtmlQuoteBuilder, HtmlScriptBuilder, HtmlSelectBuilder, HtmlSourceBuilder, HtmlSpanBuilder, HtmlStyleBuilder, HtmlTableBuilder, HtmlTableCaptionBuilder, HtmlTableCellBuilder, HtmlTableColBuilder, HtmlTableRowBuilder, HtmlTableSectionBuilder, HtmlTextAreaBuilder, HtmlTitleBuilder, HtmlUListBuilder, HtmlVideoBuilder

public interface ElementBuilderBase<T extends ElementBuilderBase<?>>
Base class for element builders used to builder DOM elements.
  • Method Details

    • attribute

      T attribute(String name, int value)
      Add an integer attribute to the object.
      Returns:
      this builder
    • attribute

      T attribute(String name, String value)
      Add a string attribute to the object.
      Returns:
      this builder
    • className

      T className(String className)
      The class attribute of the element. This attribute has been renamed due to conflicts with the "class" keyword exposed by many languages.
      Returns:
      this builder
      See Also:
    • dir

      T dir(String dir)
      Specifies the base direction of directionally neutral text and the directionality of tables.
      Returns:
      this builder
    • draggable

      T draggable(String draggable)
      Changes the draggable attribute to one of Element.DRAGGABLE_AUTO, Element.DRAGGABLE_FALSE, or Element.DRAGGABLE_TRUE.
      Parameters:
      draggable - a String constant
      Returns:
      this builder
    • end

      void end()
      End the current element without checking its type.
    • end

      void end(String tagName)
      End the current element after checking that its tag is the specified tagName.
      Parameters:
      tagName - the expected tagName of the current element
      See Also:
    • endAnchor

      void endAnchor()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endArea

      void endArea()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endAudio

      void endAudio()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endBase

      void endBase()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endBlockQuote

      void endBlockQuote()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endBody

      void endBody()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endBR

      void endBR()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endButton

      void endButton()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endCanvas

      void endCanvas()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endCol

      void endCol()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endColGroup

      void endColGroup()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endDiv

      void endDiv()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endDList

      void endDList()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endFieldSet

      void endFieldSet()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endForm

      void endForm()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endFrame

      void endFrame()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endFrameSet

      void endFrameSet()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endH1

      void endH1()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endH2

      void endH2()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endH3

      void endH3()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endH4

      void endH4()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endH5

      void endH5()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endH6

      void endH6()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endHead

      void endHead()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endHR

      void endHR()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endIFrame

      void endIFrame()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endImage

      void endImage()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endInput

      void endInput()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endLabel

      void endLabel()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endLegend

      void endLegend()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endLI

      void endLI()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endLink

      void endLink()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endMap

      void endMap()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endMeta

      void endMeta()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endOList

      void endOList()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endOptGroup

      void endOptGroup()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endOption

      void endOption()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endParagraph

      void endParagraph()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endParam

      void endParam()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endPre

      void endPre()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endQuote

      void endQuote()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endScript

      void endScript()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endSelect

      void endSelect()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endSource

      void endSource()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endSpan

      void endSpan()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endStyle

      void endStyle()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endTable

      void endTable()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endTableCaption

      void endTableCaption()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endTBody

      void endTBody()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endTD

      void endTD()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endTextArea

      void endTextArea()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endTFoot

      void endTFoot()
      End the current element. . *
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endTH

      void endTH()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endTHead

      void endTHead()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endTR

      void endTR()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endUList

      void endUList()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • endVideo

      void endVideo()
      End the current element.
      Throws:
      IllegalStateException - if the current element has the wrong tag
      See Also:
    • finish

      Element finish()
      Return the built DOM as an Element.

      Any lingering open elements are automatically closed. Once you call finish(), you can not longer call any other methods in this class.

      Returns:
      the Element that was built
      Throws:
      IllegalStateException - if called twice
    • getDepth

      int getDepth()
      Get the element depth of the current builder.
    • html

      T html(SafeHtml html)
      Append html within the node.

      Once you append HTML to the element, you can no longer set attributes.

      Parameters:
      html - the HTML to append
      Returns:
      this builder
    • id

      T id(String id)
      Set the id.
      Parameters:
      id - the id
      Returns:
      this builder
    • isChildElementSupported

      boolean isChildElementSupported()
      Check if child elements are supported.
      Returns:
      true if supported, false if not.
    • isEndTagForbidden

      boolean isEndTagForbidden()
      Check if an end tag is forbidden for this element. If the end tag is forbidden, then setting inner html or text or appending an element will trigger an UnsupportedOperationException.
      Returns:
      true if forbidden, false if not
    • lang

      T lang(String lang)
      Language code defined in RFC 1766.
      Returns:
      this builder
    • startAnchor

      AnchorBuilder startAnchor()
      Append a anchor element.
      Returns:
      the builder for the new element
    • startArea

      AreaBuilder startArea()
      Append a area element.
      Returns:
      the builder for the new element
    • startAudio

      AudioBuilder startAudio()
      Append a audio element.
      Returns:
      the builder for the new element
    • startBase

      BaseBuilder startBase()
      Append a base element.
      Returns:
      the builder for the new element
    • startBlockQuote

      QuoteBuilder startBlockQuote()
      Append a block quote element.
      Returns:
      the builder for the new element
    • startBody

      BodyBuilder startBody()
      Append a body element.
      Returns:
      the builder for the new element
    • startBR

      BRBuilder startBR()
      Append a br element.
      Returns:
      the builder for the new element
    • startButtonInput

      InputBuilder startButtonInput()
      Append an <input type='button'> element.
      Returns:
      the builder for the new element
    • startCanvas

      CanvasBuilder startCanvas()
      Append a canvas element.
      Returns:
      the builder for the new element
    • startCheckboxInput

      InputBuilder startCheckboxInput()
      Append an <input type='check'> element.
      Returns:
      the builder for the new element
    • startCol

      TableColBuilder startCol()
      Append a tablecol element.
      Returns:
      the builder for the new element
    • startColGroup

      TableColBuilder startColGroup()
      Append a tablecol element.
      Returns:
      the builder for the new element
    • startDiv

      DivBuilder startDiv()
      Append a div element.
      Returns:
      the builder for the new element
    • startDList

      DListBuilder startDList()
      Append a dlist element.
      Returns:
      the builder for the new element
    • startFieldSet

      FieldSetBuilder startFieldSet()
      Append a fieldset element.
      Returns:
      the builder for the new element
    • startFileInput

      InputBuilder startFileInput()
      Append an <input type='file'> element.
      Returns:
      the builder for the new element
    • startForm

      FormBuilder startForm()
      Append a form element.
      Returns:
      the builder for the new element
    • startFrame

      FrameBuilder startFrame()
      Append a frame element.
      Returns:
      the builder for the new element
    • startFrameSet

      FrameSetBuilder startFrameSet()
      Append a frameset element.
      Returns:
      the builder for the new element
    • startH1

      HeadingBuilder startH1()
      Append a heading element.
      Returns:
      the builder for the new element
    • startH2

      HeadingBuilder startH2()
      Append a heading element.
      Returns:
      the builder for the new element
    • startH3

      HeadingBuilder startH3()
      Append a heading element.
      Returns:
      the builder for the new element
    • startH4

      HeadingBuilder startH4()
      Append a heading element.
      Returns:
      the builder for the new element
    • startH5

      HeadingBuilder startH5()
      Append a heading element.
      Returns:
      the builder for the new element
    • startH6

      HeadingBuilder startH6()
      Append a heading element.
      Returns:
      the builder for the new element
    • startHead

      HeadBuilder startHead()
      Append a head element.
      Returns:
      the builder for the new element
    • startHiddenInput

      InputBuilder startHiddenInput()
      Append an <input type='hidden'> element.
      Returns:
      the builder for the new element
    • startHR

      HRBuilder startHR()
      Append a hr element.
      Returns:
      the builder for the new element
    • startIFrame

      IFrameBuilder startIFrame()
      Append a iframe element.
      Returns:
      the builder for the new element
    • startImage

      ImageBuilder startImage()
      Append a image element.
      Returns:
      the builder for the new element
    • startImageInput

      InputBuilder startImageInput()
      Append an <input type='image'> element.
      Returns:
      the builder for the new element
    • startLabel

      LabelBuilder startLabel()
      Append a label element.
      Returns:
      the builder for the new element
    • startLegend

      LegendBuilder startLegend()
      Append a legend element.
      Returns:
      the builder for the new element
    • startLI

      LIBuilder startLI()
      Append a li element.
      Returns:
      the builder for the new element
    • startLink

      LinkBuilder startLink()
      Append a link element.
      Returns:
      the builder for the new element
    • startMap

      MapBuilder startMap()
      Append a map element.
      Returns:
      the builder for the new element
    • startMeta

      MetaBuilder startMeta()
      Append a meta element.
      Returns:
      the builder for the new element
    • startOList

      OListBuilder startOList()
      Append a olist element.
      Returns:
      the builder for the new element
    • startOptGroup

      OptGroupBuilder startOptGroup()
      Append a optgroup element.
      Returns:
      the builder for the new element
    • startOption

      OptionBuilder startOption()
      Append an option element.
      Returns:
      the builder for the new element
    • startParagraph

      ParagraphBuilder startParagraph()
      Append a paragraph element.
      Returns:
      the builder for the new element
    • startParam

      ParamBuilder startParam()
      Append a param element.
      Returns:
      the builder for the new element
    • startPasswordInput

      InputBuilder startPasswordInput()
      Append an <input type='password'> element.
      Returns:
      the builder for the new element
    • startPre

      PreBuilder startPre()
      Append a pre element.
      Returns:
      the builder for the new element
    • startPushButton

      ButtonBuilder startPushButton()
      Append a button element with type "button".
      Returns:
      the builder for the new element
    • startQuote

      QuoteBuilder startQuote()
      Append a quote element.
      Returns:
      the builder for the new element
    • startRadioInput

      InputBuilder startRadioInput(String name)
      Append an <input type='radio'> element.
      Parameters:
      name - name the name of the radio input (used for grouping)
      Returns:
      the builder for the new element
    • startResetButton

      ButtonBuilder startResetButton()
      Append a button element with type "reset".
      Returns:
      the builder for the new element
    • startResetInput

      InputBuilder startResetInput()
      Append an <input type='reset'> element.
      Returns:
      the builder for the new element
    • startScript

      ScriptBuilder startScript()
      Append a script element.
      Returns:
      the builder for the new element
    • startSelect

      SelectBuilder startSelect()
      Append a select element.
      Returns:
      the builder for the new element
    • startSource

      SourceBuilder startSource()
      Append a source element.
      Returns:
      the builder for the new element
    • startSpan

      SpanBuilder startSpan()
      Append a span element.
      Returns:
      the builder for the new element
    • startStyle

      StyleBuilder startStyle()
      Append a style element.
      Returns:
      the builder for the new element
    • startSubmitButton

      ButtonBuilder startSubmitButton()
      Append a button element with type "submit".
      Returns:
      the builder for the new element
    • startSubmitInput

      InputBuilder startSubmitInput()
      Append an <input type='submit'> element.
      Returns:
      the builder for the new element
    • startTable

      TableBuilder startTable()
      Append a table element.
      Returns:
      the builder for the new element
    • startTableCaption

      TableCaptionBuilder startTableCaption()
      Append a table caption element.
      Returns:
      the builder for the new element
    • startTBody

      TableSectionBuilder startTBody()
      Append a tbody element.
      Returns:
      the builder for the new element
    • startTD

      TableCellBuilder startTD()
      Append a td element.
      Returns:
      the builder for the new element
    • startTextArea

      TextAreaBuilder startTextArea()
      Append a textarea element.
      Returns:
      the builder for the new element
    • startTextInput

      InputBuilder startTextInput()
      Append an <input type='text'> element.
      Returns:
      the builder for the new element
    • startTFoot

      TableSectionBuilder startTFoot()
      Append a tfoot element.
      Returns:
      the builder for the new element
    • startTH

      TableCellBuilder startTH()
      Append a th element.
      Returns:
      the builder for the new element
    • startTHead

      TableSectionBuilder startTHead()
      Append a thead element.
      Returns:
      the builder for the new element
    • startTR

      TableRowBuilder startTR()
      Append a tablerow element.
      Returns:
      the builder for the new element
    • startUList

      UListBuilder startUList()
      Append a ulist element.
      Returns:
      the builder for the new element
    • startVideo

      VideoBuilder startVideo()
      Append a video element.
      Returns:
      the builder for the new element
    • style

      StylesBuilder style()
      Start the StylesBuilder used to add style properties to the style attribute of the current element.
      Returns:
      the StylesBuilder
    • tabIndex

      T tabIndex(int tabIndex)
      Set the tab index.
      Parameters:
      tabIndex - the tab index
      Returns:
      this builder
    • text

      T text(String text)
      Append text within the node.

      Once you append text to the element, you can no longer set attributes.

      A string-based implementation will escape the text to prevent HTML/javascript code from executing. DOM based implementations are not required to escape the text if they directly set the innerText of an element.

      Parameters:
      text - the text to append
      Returns:
      this builder
    • title

      T title(String title)
      The element's advisory title.
      Returns:
      this builder
    • trustedStart

      ElementBuilder trustedStart(String tagName)
      Append a new element with the specified trusted tag name. The tag name will will not be checked or escaped. The calling code should be carefully reviewed to ensure that the provided tag name will not cause a security issue if including in an HTML document. In general, this means limiting the code to HTML tagName constants supported by the HTML specification.
      Parameters:
      tagName - the tag name
      Returns:
      the ElementBuilder for the new element