Interface HTMLBuilder
-
- All Known Implementing Classes:
HTMLBuilderImpl
public interface HTMLBuilderSimple builder interface for managing the creation of compliant HTML, and ensuring that escaping is done correctly.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAttribute(java.lang.String attr, java.lang.String value)voidaddText(java.lang.String text)voidaddUnescapedText(java.lang.String text)voidendTag()java.lang.StringgetCurrentOpenTag()java.lang.StringgetCurrentOpenTagAttribute(java.lang.String name)voidsetCurrentOpenTag(java.lang.String tag)voidstartTag(java.lang.String tag)Pushes a new open tag onto the contextHTMLBuilderwithParentTag()HTMLBuilderwithRootTag()
-
-
-
Method Detail
-
startTag
void startTag(java.lang.String tag)
Pushes a new open tag onto the context- Parameters:
tag- xhtml tag to push.
-
addAttribute
void addAttribute(java.lang.String attr, java.lang.String value)
-
addText
void addText(java.lang.String text)
-
addUnescapedText
void addUnescapedText(java.lang.String text)
-
endTag
void endTag()
-
getCurrentOpenTag
java.lang.String getCurrentOpenTag()
-
setCurrentOpenTag
void setCurrentOpenTag(java.lang.String tag)
-
getCurrentOpenTagAttribute
java.lang.String getCurrentOpenTagAttribute(java.lang.String name)
-
withParentTag
HTMLBuilder withParentTag()
- Returns:
- an HTML builder for the parent tag, allowing you to modify already created HTML elements.
-
withRootTag
HTMLBuilder withRootTag()
- Returns:
- the HTML builder for the root (i.e. <html>) tag at the start of the document.
-
-