eb2c5929347c5c108331286f6362e76d3097a3c1
[cfb.git] / prod / net / jaekl / cfb / xml / BugClass.java
1 package net.jaekl.cfb.xml;
2
3 import java.util.ArrayList;
4
5 import org.xml.sax.Attributes;
6
7 import net.jaekl.qd.xml.ParseResult;
8 import net.jaekl.qd.xml.XmlParseException;
9
10 public class BugClass extends ParseResult {
11         
12         static final String TAG = "Class";
13         static final String[] INTERNAL = { };
14         static final Object[][] EXTERNAL = { { SourceLine.TAG, SourceLine.class} };
15
16         static final String CLASS_NAME = "classname";
17         
18         String m_className;
19         ArrayList<SourceLine> m_sourceLines;
20         
21         public BugClass() {
22                 super(TAG, INTERNAL, EXTERNAL);
23                 m_className = "";
24         }
25         
26         @Override
27         public void endContents(String uri, String localName, String qName,     String chars, Attributes attr) 
28                 throws XmlParseException 
29         {
30                  m_className = getRequiredAttr(TAG, attr, CLASS_NAME);
31         }
32
33     @Override
34     public void endExternal(String uri, String localName, String qName) 
35         throws XmlParseException
36     {
37                 if (SourceLine.TAG.equals(localName)) {
38                         ParseResult[] collected = collectParsedChildren(SourceLine.class);
39                         for (ParseResult pr : collected) {
40                                 assert(pr instanceof SourceLine);
41                                 m_sourceLines.add((SourceLine)pr);
42                         }
43                 }
44     }
45 }