Interface ElementBuilderBase<T extends ElementBuilderBase<?>>

    • Method Detail

      • attribute

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

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

        T className​(java.lang.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:
        W3C HTML Specification
      • dir

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

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

        void end​(java.lang.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:
        end()
      • endAnchor

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        void endVideo()
        End the current element.
        Throws:
        java.lang.IllegalStateException - if the current element has the wrong tag
        See Also:
        end()
      • 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:
        java.lang.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​(java.lang.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​(java.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​(java.lang.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
      • tabIndex

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

        T text​(java.lang.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​(java.lang.String title)
        The element's advisory title.
        Returns:
        this builder
      • trustedStart

        ElementBuilder trustedStart​(java.lang.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