aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/html/HtmlSelfClosingElement.java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-02-14 11:03:34 +0000
committerMichael Williamson <mike@zwobble.org>2016-02-14 11:03:34 +0000
commit006ee096741fd267d9b37f92dfec33f6de5077a9 (patch)
tree21cf17f5b6258df7c69e013f136557b6e4e1276e /src/main/java/org/zwobble/mammoth/html/HtmlSelfClosingElement.java
parent230e4684a68de74223f275ab083391c562a3f65a (diff)
Add self-closing elements
Diffstat (limited to 'src/main/java/org/zwobble/mammoth/html/HtmlSelfClosingElement.java')
-rw-r--r--src/main/java/org/zwobble/mammoth/html/HtmlSelfClosingElement.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/org/zwobble/mammoth/html/HtmlSelfClosingElement.java b/src/main/java/org/zwobble/mammoth/html/HtmlSelfClosingElement.java
new file mode 100644
index 0000000..f3ef3f8
--- /dev/null
+++ b/src/main/java/org/zwobble/mammoth/html/HtmlSelfClosingElement.java
@@ -0,0 +1,16 @@
+package org.zwobble.mammoth.html;
+
+public class HtmlSelfClosingElement implements HtmlNode {
+ private final String tagName;
+
+ public HtmlSelfClosingElement(String tagName) {
+ this.tagName = tagName;
+ }
+
+ @Override
+ public void write(StringBuilder builder) {
+ builder.append("<")
+ .append(tagName)
+ .append(" />");
+ }
+}