b75733b162d14e39ccc16e835b4873b502119412
[cfb.git] / prod / net / jaekl / cfb / xml / messages / BugPattern.java
1 package net.jaekl.cfb.xml.messages;
2
3 import net.jaekl.qd.xml.MissingAttributeException;
4 import net.jaekl.qd.xml.ParseResult;
5 import net.jaekl.qd.xml.XmlParseException;
6
7 import org.xml.sax.Attributes;
8
9 public class BugPattern extends ParseResult {
10         static final String TYPE = "type";
11         static final String SHORT = "ShortDescription";
12         static final String LONG = "LongDescription";
13         static final String DETAILS = "Details";
14
15         static final String TAG = "BugPattern";
16         static final String[] INTERNAL = { SHORT, LONG, DETAILS };
17         static final Object[][] EXTERNAL = {  };
18         
19         String m_type;
20         String m_short;
21         String m_long;
22         String m_details;
23         
24         public BugPattern() 
25         {
26                 super(TAG, INTERNAL, EXTERNAL);
27                 m_type = m_short = m_long = m_details = "";
28         }
29         
30         public String getType() { return m_type; }
31         public String getShort() { return m_short; }
32         public String getLong() { return m_long; }
33         public String getDetails() { return m_details; }
34
35         @Override
36         public void endContents(String uri, String localName, String qName, String chars) throws XmlParseException 
37         {
38                 if (SHORT.equals(localName)) {
39                         m_short = chars;
40                 }
41                 else if (LONG.equals(localName)) {
42                         m_long = chars;
43                 }
44                 else if (DETAILS.equals(localName)) {
45                         m_details = chars;
46                 }
47         }
48
49         @Override
50         public void endExternal(String uri, String localName, String qName) throws XmlParseException 
51         {
52                 // nothing to do
53         }
54
55         // Called once for this tag itself
56         @Override
57         public void handleMainAttributes(Attributes attr) throws MissingAttributeException {
58                 m_type = this.getRequiredAttr(TAG, attr, TYPE);
59         }
60 }