< prev index next >

## src/com/sun/javatest/cof/COFEnvironment.java

Print this page

      30 import java.io.RandomAccessFile;
      31 import java.net.InetAddress;
      32 import java.net.UnknownHostException;
      33 import java.util.ArrayList;
      34 import java.util.LinkedHashMap;
      35 import java.util.List;
      36 import java.util.StringTokenizer;
      37 import java.util.TimeZone;
      38
      39 import com.sun.javatest.util.I18NResourceBundle;
      40
      41 /* temp */public/* temp */class COFEnvironment extends COFItem {
      42         static String[] propOrder = { "machine", "os", "jdk", "systemLocale",
      43                         "userLocale", "encoding", "timezone", "bits", "displaydepth",
      44                         "description", "sw" };
      45
      46         static String[] propTags = { "machine", "os", "jdk", "system-locale",
      47                         "user-locale", "encoding", "timezone", "bits", "displaydepth",
      48                         "description", "sw" };
      49
      50         static LinkedHashMap xmlAttributes;
      51
      52         static LinkedHashMap xmlElements;
      53
      54         static String xmlTagName;
      55         private static I18NResourceBundle i18n = I18NResourceBundle
      56         .getBundleForClass(Main.class);
      57
      58         static {
      59                 xmlElements = new LinkedHashMap();
      60                 for (int i = 0; i < propOrder.length; i++) {
      61                         xmlElements.put(propOrder[i], propTags[i]);
      62                 }
      63                 xmlAttributes = new LinkedHashMap();
      64                 xmlAttributes.put("id", "id");
      65                 xmlTagName = "environment";
      66         }
      67
      68         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
      69         protected Integer bits;
      70
      71         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
      72         protected String description;
      73
      74         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
      75         protected Integer displaydepth;
      76
      77         private String domainName;
      78
      79         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
      80         protected String encoding;
      81
      82         private String hostName;
      83
      84         //    @XmlAttribute(required = true)
      85         protected String id = "env:0";
      86
      87         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
      88         protected String jdk;
      89
      90         //  @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema", required = true)
      91         protected String machine;
      92
      93         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema", required = true)
      94         protected COFOS os;
      95
      96         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema", required = true)
      97         protected List/*<SWEntity>*/sw;
      98
      99         //    @XmlElement(name = "system-locale", namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
     100         protected String systemLocale;
     101
     102         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
     103         protected String timezone;
     104
     105         //    @XmlElement(name = "system-locale", namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
     106         protected String userLocale;
     107     protected COFData data;
     108
     109         COFEnvironment(COFData data) {
     110         this.data = data;
     111
     112         initDefaultHostInfo();
     113                 initDefaultOSInfo();
     114
     115                 hostName = data.get("environment.host", hostName);
     116                 domainName = data.get("environment.domain", domainName);
     117                 setMachine(data.get("environment.machine", hostName + "." + domainName));
     240                                 } catch (Exception e) {
     241                                 }
     242                         }
     243                 }
     244
     245                 return res;
     246         }
     247
     248         /**
     249          * Gets the value of the id property.
     250          *
     251          * @return
     252          *     possible object is
     253          *     {@link String }
     254          *
     255          */
     256         public String getId() {
     257                 return id;
     258         }
     259
     260         LinkedHashMap getItemAttributes() {
     261                 return xmlAttributes;
     262         }
     263
     264         LinkedHashMap getItemElements() {
     265                 return xmlElements;
     266         }
     267
     268         String getItemTagName() {
     269                 return xmlTagName;
     270         }
     271
     272         /**
     273          * Gets the value of the jdk property.
     274          *
     275          * @return
     276          *     possible object is
     277          *     {@link String }
     278          *
     279          */
     280         public String getJdk() {
     281                 return jdk;
     282         }
     283
     284         /**
     314          *
     315          * <p>
     316          * This accessor method returns a reference to the live list,
     317          * not a snapshot. Therefore any modification you make to the
     318          * returned list will be present inside the JAXB object.
     319          * This is why there is not a <CODE>set</CODE> method for the sw property.
     320          *
     321          * <p>
     322          * For example, to add a new item, do as follows:
     323          * <pre>
     324          *    getSw().add(newItem);
     325          * </pre>
     326          *
     327          *
     328          * <p>
     329          * Objects of the following type(s) are allowed in the list
     330          * {@link SWEntity }
     331          *
     332          *
     333          */
     334         public List/*<SWEntity>*/getSw() {
     335                 if (sw == null) {
     336                         sw = new ArrayList/*<SWEntity>*/();
     337                 }
     338                 return this.sw;
     339         }
     340
     341         /**
     342          * Gets the value of the systemLocale property.
     343          *
     344          * @return
     345          *     possible object is
     346          *     {@link String }
     347          *
     348          */
     349         public String getSystemLocale() {
     350                 return systemLocale;
     351         }
     352
     353         String getTagName() {
     354                 return itemTagName;
     355         }
     356
      30 import java.io.RandomAccessFile;
      31 import java.net.InetAddress;
      32 import java.net.UnknownHostException;
      33 import java.util.ArrayList;
      34 import java.util.LinkedHashMap;
      35 import java.util.List;
      36 import java.util.StringTokenizer;
      37 import java.util.TimeZone;
      38
      39 import com.sun.javatest.util.I18NResourceBundle;
      40
      41 /* temp */public/* temp */class COFEnvironment extends COFItem {
      42         static String[] propOrder = { "machine", "os", "jdk", "systemLocale",
      43                         "userLocale", "encoding", "timezone", "bits", "displaydepth",
      44                         "description", "sw" };
      45
      46         static String[] propTags = { "machine", "os", "jdk", "system-locale",
      47                         "user-locale", "encoding", "timezone", "bits", "displaydepth",
      48                         "description", "sw" };
      49
      50         static LinkedHashMap<String, String> xmlAttributes;
      51
      52         static LinkedHashMap<String, String> xmlElements;
      53
      54         static String xmlTagName;
      55         private static I18NResourceBundle i18n = I18NResourceBundle
      56         .getBundleForClass(Main.class);
      57
      58         static {
      59                 xmlElements = new LinkedHashMap<>();
      60                 for (int i = 0; i < propOrder.length; i++) {
      61                         xmlElements.put(propOrder[i], propTags[i]);
      62                 }
      63                 xmlAttributes = new LinkedHashMap<>();
      64                 xmlAttributes.put("id", "id");
      65                 xmlTagName = "environment";
      66         }
      67
      68         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
      69         protected Integer bits;
      70
      71         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
      72         protected String description;
      73
      74         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
      75         protected Integer displaydepth;
      76
      77         private String domainName;
      78
      79         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
      80         protected String encoding;
      81
      82         private String hostName;
      83
      84         //    @XmlAttribute(required = true)
      85         protected String id = "env:0";
      86
      87         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
      88         protected String jdk;
      89
      90         //  @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema", required = true)
      91         protected String machine;
      92
      93         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema", required = true)
      94         protected COFOS os;
      95
      96         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema", required = true)
      97         protected List<COFSWEntity> sw;
      98
      99         //    @XmlElement(name = "system-locale", namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
     100         protected String systemLocale;
     101
     102         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
     103         protected String timezone;
     104
     105         //    @XmlElement(name = "system-locale", namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema")
     106         protected String userLocale;
     107     protected COFData data;
     108
     109         COFEnvironment(COFData data) {
     110         this.data = data;
     111
     112         initDefaultHostInfo();
     113                 initDefaultOSInfo();
     114
     115                 hostName = data.get("environment.host", hostName);
     116                 domainName = data.get("environment.domain", domainName);
     117                 setMachine(data.get("environment.machine", hostName + "." + domainName));
     240                                 } catch (Exception e) {
     241                                 }
     242                         }
     243                 }
     244
     245                 return res;
     246         }
     247
     248         /**
     249          * Gets the value of the id property.
     250          *
     251          * @return
     252          *     possible object is
     253          *     {@link String }
     254          *
     255          */
     256         public String getId() {
     257                 return id;
     258         }
     259
     260         LinkedHashMap<String, String> getItemAttributes() {
     261                 return xmlAttributes;
     262         }
     263
     264         LinkedHashMap<String, String> getItemElements() {
     265                 return xmlElements;
     266         }
     267
     268         String getItemTagName() {
     269                 return xmlTagName;
     270         }
     271
     272         /**
     273          * Gets the value of the jdk property.
     274          *
     275          * @return
     276          *     possible object is
     277          *     {@link String }
     278          *
     279          */
     280         public String getJdk() {
     281                 return jdk;
     282         }
     283
     284         /**
     314          *
     315          * <p>
     316          * This accessor method returns a reference to the live list,
     317          * not a snapshot. Therefore any modification you make to the
     318          * returned list will be present inside the JAXB object.
     319          * This is why there is not a <CODE>set</CODE> method for the sw property.
     320          *
     321          * <p>
     322          * For example, to add a new item, do as follows:
     323          * <pre>
     324          *    getSw().add(newItem);
     325          * </pre>
     326          *
     327          *
     328          * <p>
     329          * Objects of the following type(s) are allowed in the list
     330          * {@link SWEntity }
     331          *
     332          *
     333          */
     334         public List<COFSWEntity> getSw() {
     335                 if (sw == null) {
     336                         sw = new ArrayList<>();
     337                 }
     338                 return this.sw;
     339         }
     340
     341         /**
     342          * Gets the value of the systemLocale property.
     343          *
     344          * @return
     345          *     possible object is
     346          *     {@link String }
     347          *
     348          */
     349         public String getSystemLocale() {
     350                 return systemLocale;
     351         }
     352
     353         String getTagName() {
     354                 return itemTagName;
     355         }
     356

< prev index next >