1 // Copyright (C) 2004, 2014 Christian Jaekl
3 package net.jaekl.qd.xml;
5 import java.util.ArrayList;
7 public class MissingInfoException extends XmlParseException
9 private static final long serialVersionUID = 1L;
12 ArrayList<String> m_missingAttributes;
13 ArrayList<String> m_missingChildTags;
15 public MissingInfoException(String tagName) {
18 m_missingAttributes = new ArrayList<String>();
19 m_missingChildTags = new ArrayList<String>();
22 public void addMissingAttribute(String name) {
23 m_missingAttributes.add(name);
26 public void addMissingChild(String name) {
27 m_missingChildTags.add(name);
30 public String getTagName() { return m_tagName; }
33 public String getMessage() {
34 StringBuilder sb = new StringBuilder();
36 sb.append("Tag: \"" + getTagName() + "\"");
38 for (String attr : m_missingAttributes) {
39 sb.append("\n Attribute: \"" + attr + "\"");
42 for (String child : m_missingChildTags) {
43 sb.append("\n Child tag: \"" + child + "\"");