1 package net.jaekl.cfb.xml;
3 import org.xml.sax.Attributes;
5 import net.jaekl.qd.xml.MissingAttributeException;
6 import net.jaekl.qd.xml.ParseResult;
7 import net.jaekl.qd.xml.XmlParseException;
9 public class SourceLine extends ParseResult {
11 static final String ROOT_TAG = "SourceLine";
12 static final String[] INTERNAL = { };
13 static final Object[][] EXTERNAL = { };
15 static final String ATTR_CLASS_NAME = "classname";
16 static final String ATTR_START = "start";
17 static final String ATTR_END = "end";
24 super(ROOT_TAG, INTERNAL, EXTERNAL);
26 m_start = m_end = (-1);
30 public void endContents(String uri, String localName, String qName, String chars, Attributes attr)
31 throws XmlParseException
35 m_className = getRequiredAttr(localName, attr, ATTR_CLASS_NAME);
37 scratch = getRequiredAttr(localName, attr, ATTR_START);
38 m_start = Integer.parseInt(scratch);
40 scratch = getRequiredAttr(localName, attr, ATTR_END);
41 m_end = Integer.parseInt(scratch);
44 String getRequiredAttr(String tagName, Attributes attr, String attrName)
45 throws MissingAttributeException
47 String result = attr.getValue(attrName);
49 throw new MissingAttributeException(tagName, attrName);
55 public void endExternal(String uri, String localName, String qName)
56 throws XmlParseException