627667a161ac4e3902c6170412e5f32badf2c6b8
[cfb.git] / prod / net / jaekl / cfb / xml / SourceLine.java
1 package net.jaekl.cfb.xml;
2
3 import net.jaekl.qd.xml.ParseResult;
4 import net.jaekl.qd.xml.XmlParseException;
5
6 import org.xml.sax.Attributes;
7
8 public class SourceLine extends ParseResult {
9
10         static final String TAG = "SourceLine";
11         static final String[] INTERNAL = { };
12         static final Object[][] EXTERNAL = { };
13         
14         static final String ATTR_CLASS_NAME = "classname";
15         static final String ATTR_START = "start";
16         static final String ATTR_END = "end";
17         
18         String m_className;
19         int m_start;
20         int m_end;
21
22         public SourceLine() {
23                 super(TAG, INTERNAL, EXTERNAL);
24                 m_className = null;
25                 m_start = m_end = (-1);
26         }       
27         
28         @Override
29         public void endContents(String uri, String localName, String qName,     String chars, Attributes attr) 
30                 throws XmlParseException 
31         {
32                 String scratch;
33                 
34                 m_className = getRequiredAttr(localName, attr, ATTR_CLASS_NAME);
35                 
36                 scratch = getRequiredAttr(localName, attr, ATTR_START);
37                 m_start = Integer.parseInt(scratch);
38                 
39                 scratch = getRequiredAttr(localName, attr, ATTR_END);
40                 m_end = Integer.parseInt(scratch);
41         }
42         
43         @Override
44         public void endExternal(String uri, String localName, String qName)
45                 throws XmlParseException 
46         {
47                 // no-op
48         }
49 }