1 package net.jaekl.cfb.xml;
3 import java.util.ArrayList;
5 import org.xml.sax.Attributes;
7 import net.jaekl.qd.xml.ParseResult;
8 import net.jaekl.qd.xml.XmlParseException;
10 public class BugMethod extends ParseResult {
12 static final String TAG = "Method";
13 static final String[] INTERNAL = { };
14 static final Object[][] EXTERNAL = { { SourceLine.TAG, SourceLine.class} };
16 static final String CLASS_NAME = "classname";
17 static final String METHOD_NAME = "name";
18 static final String SIGNATURE = "signature";
19 static final String IS_STATIC = "isStatic";
20 static final String ROLE = "role";
22 static final String TRUE = "true"; // yes value for isStatic
28 String m_role; // optional
29 ArrayList<SourceLine> m_sourceLines;
32 super(TAG, INTERNAL, EXTERNAL);
33 m_className = m_methodName = m_signature = m_role = null;
35 m_sourceLines = new ArrayList<SourceLine>();
39 public void endContents(String uri, String localName, String qName, String chars, Attributes attr)
40 throws XmlParseException
42 m_className = getRequiredAttr(TAG, attr, CLASS_NAME);
43 m_methodName = getRequiredAttr(TAG, attr, METHOD_NAME);
44 m_signature = getRequiredAttr(TAG, attr, SIGNATURE);
45 m_isStatic = getRequiredAttr(TAG, attr, IS_STATIC).equals(TRUE);
46 m_role = getOptionalAttr(attr, ROLE, null);
50 public void endExternal(String uri, String localName, String qName)
51 throws XmlParseException
53 if (SourceLine.TAG.equals(localName)) {
54 ParseResult[] collected = collectParsedChildren(SourceLine.class);
55 for (ParseResult pr : collected) {
56 assert(pr instanceof SourceLine);
57 m_sourceLines.add((SourceLine)pr);