Changeset 203 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/CadData.java


Ignore:
Timestamp:
02/01/2020 04:18:21 PM (6 years ago)
Author:
jdalbey
Message:

XMLWriter.java name changed to XMLBuilder. Add pretty printing methods (ticket #237).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/CadData.java

    r145 r203  
    8282        if (!Master_Inc_Num.equals("")) 
    8383        { 
    84             output += XMLWriter.simpleTag(Master_Inc_Num, ELEMENT.MASTER_INC_NUM); 
     84            output += XMLBuilder.simpleTag(Master_Inc_Num, ELEMENT.MASTER_INC_NUM); 
    8585        } 
    8686 
    8787        if (!P.equals("")) 
    8888        { 
    89             output += XMLWriter.simpleTag(P, ELEMENT.P); 
     89            output += XMLBuilder.simpleTag(P, ELEMENT.P); 
    9090        } 
    9191 
    9292        if (hasAdditionalInfo()) 
    9393        { 
    94             output += XMLWriter.openTag(ELEMENT.ADDITIONAL_INFO.tag); 
    95             output += XMLWriter.simpleTag(Info_Type_Code, ELEMENT.TYPE_CODE); 
    96             output += XMLWriter.simpleTag(Info_Type, ELEMENT.TYPE); 
    97             output += XMLWriter.closeTag(ELEMENT.ADDITIONAL_INFO.tag); 
     94            output += XMLBuilder.openTag(ELEMENT.ADDITIONAL_INFO.tag); 
     95            output += XMLBuilder.simpleTag(Info_Type_Code, ELEMENT.TYPE_CODE); 
     96            output += XMLBuilder.simpleTag(Info_Type, ELEMENT.TYPE); 
     97            output += XMLBuilder.closeTag(ELEMENT.ADDITIONAL_INFO.tag); 
    9898        } 
    9999 
    100100        if (hasLocation()) 
    101101        { 
    102             output += XMLWriter.openTag(ELEMENT.LOCATION.tag); 
     102            output += XMLBuilder.openTag(ELEMENT.LOCATION.tag); 
    103103            if (!Location_Beat.equals("")) 
    104104            { 
    105                 output += XMLWriter.simpleTag(Location_Beat, ELEMENT.BEAT); 
     105                output += XMLBuilder.simpleTag(Location_Beat, ELEMENT.BEAT); 
    106106            } 
    107107 
    108108            if (!Location_Address.equals("")) 
    109109            { 
    110                 output += XMLWriter.simpleTag(Location_Address, ELEMENT.ADDRESS); 
     110                output += XMLBuilder.simpleTag(Location_Address, ELEMENT.ADDRESS); 
    111111            } 
    112112 
    113113            if (!Location_Loc.equals("")) 
    114114            { 
    115                 output += XMLWriter.simpleTag(Location_Loc, ELEMENT.LOC); 
     115                output += XMLBuilder.simpleTag(Location_Loc, ELEMENT.LOC); 
    116116            } 
    117117 
    118118            if (!Location_City.equals("")) 
    119119            { 
    120                 output += XMLWriter.simpleTag(Location_City, ELEMENT.CITY); 
     120                output += XMLBuilder.simpleTag(Location_City, ELEMENT.CITY); 
    121121            } 
    122122 
    123123            if (!Location_Area.equals("")) 
    124124            { 
    125                 output += XMLWriter.simpleTag(Location_Area, ELEMENT.AREA); 
     125                output += XMLBuilder.simpleTag(Location_Area, ELEMENT.AREA); 
    126126            } 
    127127 
    128128            if (!Location_Fire.equals("")) 
    129129            { 
    130                 output += XMLWriter.simpleTag(Location_Fire, ELEMENT.FIRE); 
     130                output += XMLBuilder.simpleTag(Location_Fire, ELEMENT.FIRE); 
    131131            } 
    132132 
    133133            if (!Location_Law.equals("")) 
    134134            { 
    135                 output += XMLWriter.simpleTag(Location_Law, ELEMENT.LAW); 
     135                output += XMLBuilder.simpleTag(Location_Law, ELEMENT.LAW); 
    136136            } 
    137137 
    138138            if (!Location_Ems.equals("")) 
    139139            { 
    140                 output += XMLWriter.simpleTag(Location_Ems, ELEMENT.EMS); 
    141             } 
    142  
    143             output += XMLWriter.closeTag(ELEMENT.LOCATION.tag); 
     140                output += XMLBuilder.simpleTag(Location_Ems, ELEMENT.EMS); 
     141            } 
     142 
     143            output += XMLBuilder.closeTag(ELEMENT.LOCATION.tag); 
    144144        } 
    145145 
    146146        if (!Agy.equals("")) 
    147147        { 
    148             output += XMLWriter.openTag(ELEMENT.GENERAL.tag); 
    149             output += XMLWriter.simpleTag(Agy, ELEMENT.AGY); 
    150             output += XMLWriter.closeTag(ELEMENT.GENERAL.tag); 
     148            output += XMLBuilder.openTag(ELEMENT.GENERAL.tag); 
     149            output += XMLBuilder.simpleTag(Agy, ELEMENT.AGY); 
     150            output += XMLBuilder.closeTag(ELEMENT.GENERAL.tag); 
    151151        } 
    152152 
     
    154154        { 
    155155            //todo: make this logic trigger only once per incident 
    156             output += XMLWriter.openTag(ELEMENT.HEADER_INFO.tag); 
    157  
    158             output += XMLWriter.simpleTag(Header_Type, ELEMENT.Type); 
    159  
    160             output += XMLWriter.simpleTag(Header_Beat, ELEMENT.Beat); 
    161  
    162             output += XMLWriter.simpleTag(Header_TruncLoc, ELEMENT.TruncLoc); 
    163  
    164             output += XMLWriter.simpleTag(Header_FullLoc, ELEMENT.FullLoc); 
    165  
    166             output += XMLWriter.closeTag(ELEMENT.HEADER_INFO.tag); 
     156            output += XMLBuilder.openTag(ELEMENT.HEADER_INFO.tag); 
     157 
     158            output += XMLBuilder.simpleTag(Header_Type, ELEMENT.Type); 
     159 
     160            output += XMLBuilder.simpleTag(Header_Beat, ELEMENT.Beat); 
     161 
     162            output += XMLBuilder.simpleTag(Header_TruncLoc, ELEMENT.TruncLoc); 
     163 
     164            output += XMLBuilder.simpleTag(Header_FullLoc, ELEMENT.FullLoc); 
     165 
     166            output += XMLBuilder.closeTag(ELEMENT.HEADER_INFO.tag); 
    167167        } 
    168168 
Note: See TracChangeset for help on using the changeset viewer.