1 package net.sf.openrocket.file.configuration;
3 import java.util.HashMap;
7 * A base simple XML element. A simple XML element can contain either other XML elements
8 * (XmlContainerElement) or textual content (XmlContentElement), but not both.
10 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
12 public abstract class XmlElement {
14 private final String name;
15 private final HashMap<String, String> attributes = new HashMap<String, String>();
19 public XmlElement(String name) {
24 public String getName() {
28 public void setAttribute(String key, String value) {
29 attributes.put(key, value);
32 public void removeAttribute(String key) {
33 attributes.remove(key);
36 public String getAttribute(String key) {
37 return attributes.get(key);
40 @SuppressWarnings("unchecked")
41 public Map<String, String> getAttributes() {
42 return (Map<String, String>) attributes.clone();