1 package net.jaekl.cfb.xml;
3 import java.io.PrintWriter;
4 import java.util.ArrayList;
5 import java.util.Collections;
8 import net.jaekl.qd.xml.ParseResult;
9 import net.jaekl.qd.xml.XmlParseException;
11 public class BugCollection extends ParseResult {
13 static final String TAG = "BugCollection";
14 static final String[] INTERNAL = { };
15 static final Object[][] EXTERNAL = { { BugInstance.TAG, BugInstance.class} };
17 ArrayList<BugInstance> m_bugs;
19 public BugCollection() {
20 super(TAG, INTERNAL, EXTERNAL);
21 m_bugs = new ArrayList<BugInstance>();
24 public List<BugInstance> getBugs() { return Collections.unmodifiableList(m_bugs); }
25 public void add(BugInstance bug) { m_bugs.add(bug); }
28 public void endContents(String uri, String localName, String qName, String chars)
29 throws XmlParseException
35 public void endExternal(String uri, String localName, String qName)
36 throws XmlParseException
38 if (BugInstance.TAG.equals(localName)) {
39 ParseResult[] collected = collectParsedChildren(BugInstance.class);
40 for (ParseResult pr : collected) {
41 assert(pr instanceof BugInstance);
42 m_bugs.add((BugInstance) pr);
48 public void dump(PrintWriter pw, int indent) {
49 super.dump(pw, indent);
50 for (BugInstance bug : m_bugs) {
51 bug.dump(pw, indent + 2);