public class HtmlElementWriter extends Object
Simple writer for html elements. Used by the HtmlDocumentBuilder
.
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
attributes |
protected boolean |
isSelfClosing
selfClosing means that the element should not be rendered as a
start + end tag pair but as a single tag using "/" to close the tag
inline
|
protected String |
tagName |
protected String |
textContent |
Constructor and Description |
---|
HtmlElementWriter(String tagName) |
HtmlElementWriter(String tagName,
boolean isSelfClosing) |
Modifier and Type | Method and Description |
---|---|
HtmlElementWriter |
attribute(String name,
String value) |
protected String |
escapeQuotes(String attributeValue) |
HtmlElementWriter |
textContent(String text) |
protected void |
writeAttributes(HtmlDocumentBuilder.HtmlWriteContext context) |
void |
writeContent(HtmlDocumentBuilder.HtmlWriteContext context) |
protected void |
writeEndLine(HtmlDocumentBuilder.HtmlWriteContext context) |
void |
writeEndTag(HtmlDocumentBuilder.HtmlWriteContext context) |
protected void |
writeEndTagElement(HtmlDocumentBuilder.HtmlWriteContext context) |
protected void |
writeLeadingWhitespace(HtmlDocumentBuilder.HtmlWriteContext context) |
void |
writeStartTag(HtmlDocumentBuilder.HtmlWriteContext context) |
protected void |
writeStartTagClose(HtmlDocumentBuilder.HtmlWriteContext context) |
protected void |
writeStartTagOpen(HtmlDocumentBuilder.HtmlWriteContext context) |
protected void |
writeTextContent(HtmlDocumentBuilder.HtmlWriteContext context) |
protected String tagName
protected boolean isSelfClosing
protected String textContent
public HtmlElementWriter(String tagName)
public HtmlElementWriter(String tagName, boolean isSelfClosing)
public void writeStartTag(HtmlDocumentBuilder.HtmlWriteContext context)
public void writeContent(HtmlDocumentBuilder.HtmlWriteContext context)
public void writeEndTag(HtmlDocumentBuilder.HtmlWriteContext context)
protected void writeEndTagElement(HtmlDocumentBuilder.HtmlWriteContext context)
protected void writeTextContent(HtmlDocumentBuilder.HtmlWriteContext context)
protected void writeStartTagOpen(HtmlDocumentBuilder.HtmlWriteContext context)
protected void writeAttributes(HtmlDocumentBuilder.HtmlWriteContext context)
protected void writeEndLine(HtmlDocumentBuilder.HtmlWriteContext context)
protected void writeStartTagClose(HtmlDocumentBuilder.HtmlWriteContext context)
protected void writeLeadingWhitespace(HtmlDocumentBuilder.HtmlWriteContext context)
public HtmlElementWriter attribute(String name, String value)
public HtmlElementWriter textContent(String text)
Copyright © 2019. All rights reserved.