From be6fbc6f4e2f80552d3a7bab8677066d1fc858fc Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 26 Sep 2015 17:33:13 +0100 Subject: Add simple XML parsing --- .../java/org/zwobble/mammoth/xml/XmlElement.java | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/main/java/org/zwobble/mammoth/xml/XmlElement.java (limited to 'src/main/java/org/zwobble/mammoth/xml/XmlElement.java') 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 attributes) { + this(name, attributes, ImmutableList.of()); + } + + @Getter + private final String name; + private final Map attributes; + private final List children; +} -- cgit v1.2.3