blob: f8bea1de438f2fcea121557f0a22522bf35c1ba9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package org.zwobble.mammoth.html;
import java.util.Map;
public class HtmlSelfClosingElement implements HtmlNode {
private final String tagName;
private final Map<String, String> attributes;
public HtmlSelfClosingElement(String tagName, Map<String, String> attributes) {
this.tagName = tagName;
this.attributes = attributes;
}
public Map<String, String> getAttributes() {
return attributes;
}
@Override
public void write(StringBuilder builder) {
builder.append("<").append(tagName);
HtmlWriter.generateAttributes(attributes, builder);
builder.append(" />");
}
}
|