1 package net.jaekl.cfb.xml;
3 import java.io.PrintWriter;
5 import net.jaekl.qd.xml.MissingAttributeException;
6 import net.jaekl.qd.xml.ParseResult;
7 import net.jaekl.qd.xml.XmlParseException;
9 import org.xml.sax.Attributes;
11 public class SourceLine extends ParseResult {
13 static final String TAG = "SourceLine";
14 static final String[] INTERNAL = { };
15 static final Object[][] EXTERNAL = { };
17 static final String ATTR_CLASS_NAME = "classname";
18 static final String ATTR_START = "start";
19 static final String ATTR_END = "end";
26 super(TAG, INTERNAL, EXTERNAL);
28 m_start = m_end = (-1);
32 public void handleMainAttributes(Attributes attr) throws MissingAttributeException {
35 m_className = getRequiredAttr(TAG, attr, ATTR_CLASS_NAME);
37 scratch = getRequiredAttr(TAG, attr, ATTR_START);
38 m_start = Integer.parseInt(scratch);
40 scratch = getRequiredAttr(TAG, attr, ATTR_END);
41 m_end = Integer.parseInt(scratch);
45 public void endContents(String uri, String localName, String qName, String chars)
46 throws XmlParseException
52 public void endExternal(String uri, String localName, String qName)
53 throws XmlParseException
59 public void dump(PrintWriter pw, int indent)
61 super.dump(pw, indent);
62 String tab = String.format("%" + (indent + 2) + "s", "");
64 pw.println(tab + m_className + " (" + m_start + " .. " + m_end + ")");