1 package net.jaekl.cfb.xml;
3 import java.io.PrintWriter;
4 import java.util.ArrayList;
6 import org.xml.sax.Attributes;
8 import net.jaekl.qd.xml.MissingAttributeException;
9 import net.jaekl.qd.xml.ParseResult;
10 import net.jaekl.qd.xml.XmlParseException;
12 public class BugClass extends ParseResult {
14 static final String TAG = "Class";
15 static final String[] INTERNAL = { };
16 static final Object[][] EXTERNAL = { { SourceLine.TAG, SourceLine.class} };
18 static final String CLASS_NAME = "classname";
21 ArrayList<SourceLine> m_lines;
24 super(TAG, INTERNAL, EXTERNAL);
26 m_lines = new ArrayList<SourceLine>();
30 public void handleMainAttributes(Attributes attr) throws MissingAttributeException
32 m_className = getRequiredAttr(TAG, attr, CLASS_NAME);
36 public void endContents(String uri, String localName, String qName, String chars)
37 throws XmlParseException
42 public void endExternal(String uri, String localName, String qName)
43 throws XmlParseException
45 if (SourceLine.TAG.equals(localName)) {
46 ParseResult[] collected = collectParsedChildren(SourceLine.class);
47 for (ParseResult pr : collected) {
48 assert(pr instanceof SourceLine);
49 m_lines.add((SourceLine)pr);
55 public void dump(PrintWriter pw, int indent)
57 super.dump(pw, indent);
58 String tab = String.format("%" + (indent + 2) + "s", "");
60 pw.println(tab + CLASS_NAME + "=" + m_className);
61 if (null != m_lines) {
62 for (SourceLine sl : m_lines) {
63 sl.dump(pw, indent + 2);