package net.jaekl.cfb.xml;
+import java.io.PrintWriter;
import java.util.ArrayList;
import org.xml.sax.Attributes;
+import net.jaekl.qd.xml.MissingAttributeException;
import net.jaekl.qd.xml.ParseResult;
import net.jaekl.qd.xml.XmlParseException;
static final String CLASS_NAME = "classname";
String m_className;
- ArrayList<SourceLine> m_sourceLines;
+ ArrayList<SourceLine> m_lines;
public BugClass() {
super(TAG, INTERNAL, EXTERNAL);
m_className = "";
+ m_lines = new ArrayList<SourceLine>();
+ }
+
+ @Override
+ public void handleMainAttributes(Attributes attr) throws MissingAttributeException
+ {
+ m_className = getRequiredAttr(TAG, attr, CLASS_NAME);
}
@Override
- public void endContents(String uri, String localName, String qName, String chars, Attributes attr)
+ public void endContents(String uri, String localName, String qName, String chars)
throws XmlParseException
{
- m_className = getRequiredAttr(TAG, attr, CLASS_NAME);
}
@Override
ParseResult[] collected = collectParsedChildren(SourceLine.class);
for (ParseResult pr : collected) {
assert(pr instanceof SourceLine);
- m_sourceLines.add((SourceLine)pr);
+ m_lines.add((SourceLine)pr);
}
}
}
+
+ @Override
+ public void dump(PrintWriter pw, int indent)
+ {
+ super.dump(pw, indent);
+ String tab = String.format("%" + (indent + 2) + "s", "");
+
+ pw.println(tab + CLASS_NAME + "=" + m_className);
+ if (null != m_lines) {
+ for (SourceLine sl : m_lines) {
+ sl.dump(pw, indent + 2);
+ }
+ }
+ }
}