aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/xml/XmlNodes.java
blob: cf548ab067fd254e123d1b149e145eba83a970a2 (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
25
26
27
28
29
package org.zwobble.mammoth.xml;

import java.util.List;
import java.util.Map;

import static org.zwobble.mammoth.util.MammothLists.list;
import static org.zwobble.mammoth.util.MammothMaps.map;

public class XmlNodes {
    public static XmlElement element(String name) {
        return element(name, list());
    }

    public static XmlElement element(String name, Map<String, String> attributes) {
        return element(name, attributes, list());
    }

    public static XmlElement element(String name, List<XmlNode> children) {
        return element(name, map(), children);
    }

    public static XmlElement element(String name, Map<String, String> attributes, List<XmlNode> children) {
        return new XmlElement(name, attributes, children);
    }

    public static XmlTextNode text(String value) {
        return new XmlTextNode(value);
    }
}