| Revision 47,
1.1 KB
checked in by bmcguffin, 9 years ago
(diff) |
|
Updated toXML behaviors for several classes to bring final adjustments in line with desired output.
|
| Line | |
|---|
| 1 | /* |
|---|
| 2 | * To change this license header, choose License Headers in Project Properties. |
|---|
| 3 | * To change this template file, choose Tools | Templates |
|---|
| 4 | * and open the template in the editor. |
|---|
| 5 | */ |
|---|
| 6 | package scriptbuilder.structures.events; |
|---|
| 7 | |
|---|
| 8 | import java.util.StringTokenizer; |
|---|
| 9 | import scriptbuilder.structures.ELEMENT; |
|---|
| 10 | import scriptbuilder.structures.I_XML_Writable; |
|---|
| 11 | import scriptbuilder.structures.ScriptEvent; |
|---|
| 12 | import scriptbuilder.structures.XMLWriter; |
|---|
| 13 | |
|---|
| 14 | /** |
|---|
| 15 | * Data model for a CAD incident event. CAD events have a string description of |
|---|
| 16 | * what is occurring at that time, and may or may not have sub-events. |
|---|
| 17 | * |
|---|
| 18 | * @author Bryan McGuffin |
|---|
| 19 | */ |
|---|
| 20 | public class CADEvent extends ScriptEvent implements I_XML_Writable |
|---|
| 21 | { |
|---|
| 22 | |
|---|
| 23 | public CADEvent() |
|---|
| 24 | { |
|---|
| 25 | super(ScriptEventType.CAD_EVENT); |
|---|
| 26 | } |
|---|
| 27 | |
|---|
| 28 | public boolean hasSubEvents = false; |
|---|
| 29 | |
|---|
| 30 | public String detail = ""; |
|---|
| 31 | |
|---|
| 32 | @Override |
|---|
| 33 | public String toXML() |
|---|
| 34 | { |
|---|
| 35 | StringTokenizer tok = new StringTokenizer(detail, "\n"); |
|---|
| 36 | String output = ""; |
|---|
| 37 | while (tok.hasMoreTokens()) |
|---|
| 38 | { |
|---|
| 39 | output += XMLWriter.simpleTag(tok.nextToken(), ELEMENT.DETAIL); |
|---|
| 40 | } |
|---|
| 41 | return output; |
|---|
| 42 | } |
|---|
| 43 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.