9e1f53920766e89bd2d8fbd384761b9f58d174ec
[cfb.git] / prod / net / jaekl / cfb / xml / messages / BugCategory.java
1 package net.jaekl.cfb.xml.messages;
2
3 import org.xml.sax.Attributes;
4
5 import net.jaekl.qd.xml.MissingAttributeException;
6 import net.jaekl.qd.xml.ParseResult;
7 import net.jaekl.qd.xml.XmlParseException;
8
9 public class BugCategory extends ParseResult {
10         static final String CATEGORY = "category";      // attribute name
11         static final String DESCRIPTION = "Description";
12         static final String ABBREVIATION = "Abbreviation";
13         static final String DETAILS = "Details";
14
15         static final String TAG = "BugCategory";
16         static final String[] INTERNAL = { DESCRIPTION, ABBREVIATION, DETAILS };
17         static final Object[][] EXTERNAL = { };
18
19         String m_category;
20         String m_descr;
21         String m_abbrev;
22         String m_details;
23         
24         public BugCategory() 
25         {
26                 super(TAG, INTERNAL, EXTERNAL);
27                 m_category = m_descr = m_abbrev = m_details = "";
28         }
29         
30         public String getCategory() { return m_category; }
31         public String getDescr() { return m_descr; }
32         public String getAbbrev() { return m_abbrev; }
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 (DESCRIPTION.equals(localName)) {
39                         m_descr = chars;
40                 }
41                 else if (ABBREVIATION.equals(localName)) {
42                         m_abbrev = 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)
51                 throws XmlParseException 
52         {
53                 // nothing to do
54         }
55         
56         // Called once for this tag itself
57         @Override 
58         public void handleMainAttributes(Attributes attr) throws MissingAttributeException {
59                 m_category = this.getRequiredAttr(TAG, attr, CATEGORY);
60         }
61         
62 }