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 Summary
Modifier and TypeMethodDescriptionAdd an integer attribute to the object.Add a string attribute to the object.The class attribute of the element.Specifies the base direction of directionally neutral text and the directionality of tables.Changes the draggable attribute to one ofElement.DRAGGABLE_AUTO,Element.DRAGGABLE_FALSE, orElement.DRAGGABLE_TRUE.voidend()End the current element without checking its type.voidEnd the current element after checking that its tag is the specified tagName.voidEnd the current element.voidendArea()End the current element.voidendAudio()End the current element.voidendBase()End the current element.voidEnd the current element.voidendBody()End the current element.voidendBR()End the current element.voidEnd the current element.voidEnd the current element.voidendCol()End the current element.voidEnd the current element.voidendDiv()End the current element.voidendDList()End the current element.voidEnd the current element.voidendForm()End the current element.voidendFrame()End the current element.voidEnd the current element.voidendH1()End the current element.voidendH2()End the current element.voidendH3()End the current element.voidendH4()End the current element.voidendH5()End the current element.voidendH6()End the current element.voidendHead()End the current element.voidendHR()End the current element.voidEnd the current element.voidendImage()End the current element.voidendInput()End the current element.voidendLabel()End the current element.voidEnd the current element.voidendLI()End the current element.voidendLink()End the current element.voidendMap()End the current element.voidendMeta()End the current element.voidendOList()End the current element.voidEnd the current element.voidEnd the current element.voidEnd the current element.voidendParam()End the current element.voidendPre()End the current element.voidendQuote()End the current element.voidEnd the current element.voidEnd the current element.voidEnd the current element.voidendSpan()End the current element.voidendStyle()End the current element.voidendTable()End the current element.voidEnd the current element.voidendTBody()End the current element.voidendTD()End the current element.voidEnd the current element.voidendTFoot()End the current element.voidendTH()End the current element.voidendTHead()End the current element.voidendTR()End the current element.voidendUList()End the current element.voidendVideo()End the current element.finish()Return the built DOM as anElement.intgetDepth()Get the element depth of the current builder.Append html within the node.Set the id.booleanCheck if child elements are supported.booleanCheck if an end tag is forbidden for this element.Language code defined in RFC 1766.Append a anchor element.Append a area element.Append a audio element.Append a base element.Append a block quote element.Append a body element.startBR()Append a br element.Append an <input type='button'> element.Append a canvas element.Append an <input type='check'> element.startCol()Append a tablecol element.Append a tablecol element.startDiv()Append a div element.Append a dlist element.Append a fieldset element.Append an <input type='file'> element.Append a form element.Append a frame element.Append a frameset element.startH1()Append a heading element.startH2()Append a heading element.startH3()Append a heading element.startH4()Append a heading element.startH5()Append a heading element.startH6()Append a heading element.Append a head element.Append an <input type='hidden'> element.startHR()Append a hr element.Append a iframe element.Append a image element.Append an <input type='image'> element.Append a label element.Append a legend element.startLI()Append a li element.Append a link element.startMap()Append a map element.Append a meta element.Append a olist element.Append a optgroup element.Append an option element.Append a paragraph element.Append a param element.Append an <input type='password'> element.startPre()Append a pre element.Append a button element with type "button".Append a quote element.startRadioInput(String name) Append an <input type='radio'> element.Append a button element with type "reset".Append an <input type='reset'> element.Append a script element.Append a select element.Append a source element.Append a span element.Append a style element.Append a button element with type "submit".Append an <input type='submit'> element.Append a table element.Append a table caption element.Append a tbody element.startTD()Append a td element.Append a textarea element.Append an <input type='text'> element.Append a tfoot element.startTH()Append a th element.Append a thead element.startTR()Append a tablerow element.Append a ulist element.Append a video element.style()Start theStylesBuilderused to add style properties to the style attribute of the current element.tabIndex(int tabIndex) Set the tab index.Append text within the node.The element's advisory title.trustedStart(String tagName) Append a new element with the specified trusted tag name.
-
Method Details
-
attribute
-
attribute
-
className
-
dir
-
draggable
Changes the draggable attribute to one ofElement.DRAGGABLE_AUTO,Element.DRAGGABLE_FALSE, orElement.DRAGGABLE_TRUE.- Parameters:
draggable- a String constant- Returns:
- this builder
-
end
void end()End the current element without checking its type. -
end
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 anElement.Any lingering open elements are automatically closed. Once you call
finish(), you can not longer call any other methods in this class.- Returns:
- the
Elementthat was built - Throws:
IllegalStateException- if called twice
-
getDepth
int getDepth()Get the element depth of the current builder. -
id
-
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 anUnsupportedOperationException.- Returns:
- true if forbidden, false if not
-
lang
-
startAnchor
-
startArea
-
startAudio
-
startBase
-
startBlockQuote
QuoteBuilder startBlockQuote()Append a block quote element.- Returns:
- the builder for the new element
-
startBody
-
startBR
-
startButtonInput
InputBuilder startButtonInput()Append an <input type='button'> element.- Returns:
- the builder for the new element
-
startCanvas
-
startCheckboxInput
InputBuilder startCheckboxInput()Append an <input type='check'> element.- Returns:
- the builder for the new element
-
startCol
-
startColGroup
-
startDiv
-
startDList
-
startFieldSet
-
startFileInput
InputBuilder startFileInput()Append an <input type='file'> element.- Returns:
- the builder for the new element
-
startForm
-
startFrame
-
startFrameSet
-
startH1
-
startH2
-
startH3
-
startH4
-
startH5
-
startH6
-
startHead
-
startHiddenInput
InputBuilder startHiddenInput()Append an <input type='hidden'> element.- Returns:
- the builder for the new element
-
startHR
-
startIFrame
-
startImage
-
startImageInput
InputBuilder startImageInput()Append an <input type='image'> element.- Returns:
- the builder for the new element
-
startLabel
-
startLegend
-
startLI
-
startLink
-
startMap
-
startMeta
-
startOList
-
startOptGroup
-
startOption
-
startParagraph
ParagraphBuilder startParagraph()Append a paragraph element.- Returns:
- the builder for the new element
-
startParam
-
startPasswordInput
InputBuilder startPasswordInput()Append an <input type='password'> element.- Returns:
- the builder for the new element
-
startPre
-
startPushButton
ButtonBuilder startPushButton()Append a button element with type "button".- Returns:
- the builder for the new element
-
startQuote
-
startRadioInput
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
-
startSelect
-
startSource
-
startSpan
-
startStyle
-
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
-
startTableCaption
TableCaptionBuilder startTableCaption()Append a table caption element.- Returns:
- the builder for the new element
-
startTBody
-
startTD
-
startTextArea
-
startTextInput
InputBuilder startTextInput()Append an <input type='text'> element.- Returns:
- the builder for the new element
-
startTFoot
-
startTH
-
startTHead
-
startTR
-
startUList
-
startVideo
-
style
StylesBuilder style()Start theStylesBuilderused to add style properties to the style attribute of the current element.- Returns:
- the
StylesBuilder
-
tabIndex
Set the tab index.- Parameters:
tabIndex- the tab index- Returns:
- this builder
-
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
-
trustedStart
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
ElementBuilderfor the new element
-