aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/xml/XmlElement.java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-09-26 17:33:13 +0100
committerMichael Williamson <mike@zwobble.org>2015-09-26 17:33:13 +0100
commitbe6fbc6f4e2f80552d3a7bab8677066d1fc858fc (patch)
tree365f33cb3c09e838ff7bfab33609c919b73508ac /src/main/java/org/zwobble/mammoth/xml/XmlElement.java
parent0cdeb56333f61fc5769749106496106cfd8ffbfe (diff)
Add simple XML parsing
Diffstat (limited to 'src/main/java/org/zwobble/mammoth/xml/XmlElement.java')
-rw-r--r--src/main/java/org/zwobble/mammoth/xml/XmlElement.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/org/zwobble/mammoth/xml/XmlElement.java b/src/main/java/org/zwobble/mammoth/xml/XmlElement.java
new file mode 100644
index 0000000..a49f5f8
--- /dev/null
+++ b/src/main/java/org/zwobble/mammoth/xml/XmlElement.java
@@ -0,0 +1,30 @@
+package org.zwobble.mammoth.xml;
+
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.ToString;
+
+@RequiredArgsConstructor
+@EqualsAndHashCode
+@ToString
+public class XmlElement implements XmlNode {
+ public XmlElement(String name) {
+ this(name, ImmutableMap.of());
+ }
+
+ public XmlElement(String name, Map<String, String> attributes) {
+ this(name, attributes, ImmutableList.of());
+ }
+
+ @Getter
+ private final String name;
+ private final Map<String, String> attributes;
+ private final List<XmlNode> children;
+}