X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=prod%2Fnet%2Fjaekl%2Fcfb%2Fxml%2FBugClass.java;h=eb2c5929347c5c108331286f6362e76d3097a3c1;hp=34e02a242de215902d60fd284af1f4964e20caa6;hb=a938b67bf3d3bd86f8dd7b1f958e81007bf6f2fe;hpb=08a530ef53cc4756f5e632b69c78830872ebd9f4 diff --git a/prod/net/jaekl/cfb/xml/BugClass.java b/prod/net/jaekl/cfb/xml/BugClass.java index 34e02a2..eb2c592 100644 --- a/prod/net/jaekl/cfb/xml/BugClass.java +++ b/prod/net/jaekl/cfb/xml/BugClass.java @@ -1,5 +1,7 @@ package net.jaekl.cfb.xml; +import java.util.ArrayList; + import org.xml.sax.Attributes; import net.jaekl.qd.xml.ParseResult; @@ -7,26 +9,37 @@ import net.jaekl.qd.xml.XmlParseException; public class BugClass extends ParseResult { - static final String ROOT_TAG = "Class"; + static final String TAG = "Class"; static final String[] INTERNAL = { }; - static final Object[][] EXTERNAL = { { SourceLine.ROOT_TAG, SourceLine.class} }; + static final Object[][] EXTERNAL = { { SourceLine.TAG, SourceLine.class} }; + static final String CLASS_NAME = "classname"; + + String m_className; + ArrayList m_sourceLines; + public BugClass() { - super(ROOT_TAG, INTERNAL, EXTERNAL); + super(TAG, INTERNAL, EXTERNAL); + m_className = ""; } @Override - public void endContents(String uri, String localName, String qName, - String chars, Attributes attr) throws XmlParseException { - // TODO Auto-generated method stub - - } - - @Override - public void endExternal(String uri, String localName, String qName) - throws XmlParseException { - // TODO Auto-generated method stub - + public void endContents(String uri, String localName, String qName, String chars, Attributes attr) + throws XmlParseException + { + m_className = getRequiredAttr(TAG, attr, CLASS_NAME); } + @Override + public void endExternal(String uri, String localName, String qName) + throws XmlParseException + { + if (SourceLine.TAG.equals(localName)) { + ParseResult[] collected = collectParsedChildren(SourceLine.class); + for (ParseResult pr : collected) { + assert(pr instanceof SourceLine); + m_sourceLines.add((SourceLine)pr); + } + } + } }