package net.jaekl.cfb.xml;
-import org.xml.sax.Attributes;
+import java.io.PrintWriter;
+import java.util.ArrayList;
import net.jaekl.qd.xml.ParseResult;
import net.jaekl.qd.xml.XmlParseException;
static final String[] INTERNAL = { };
static final Object[][] EXTERNAL = { { BugInstance.TAG, BugInstance.class} };
+ ArrayList<BugInstance> m_bugs;
+
public BugCollection() {
super(TAG, INTERNAL, EXTERNAL);
+ m_bugs = new ArrayList<BugInstance>();
}
@Override
- public void endContents(String uri, String localName, String qName,
- String chars, Attributes attr) throws XmlParseException {
- // TODO Auto-generated method stub
-
+ public void endContents(String uri, String localName, String qName, String chars)
+ throws XmlParseException
+ {
+ // no-op
}
@Override
public void endExternal(String uri, String localName, String qName)
- throws XmlParseException {
- // TODO Auto-generated method stub
-
+ throws XmlParseException
+ {
+ if (BugInstance.TAG.equals(localName)) {
+ ParseResult[] collected = collectParsedChildren(BugInstance.class);
+ for (ParseResult pr : collected) {
+ assert(pr instanceof BugInstance);
+ m_bugs.add((BugInstance) pr);
+ }
+ }
+ }
+
+ @Override
+ public void dump(PrintWriter pw, int indent) {
+ super.dump(pw, indent);
+ for (BugInstance bug : m_bugs) {
+ bug.dump(pw, indent + 2);
+ }
}
}