       1 /*
       2  * $Id$
       3  *
       4  * Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
       5  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       6  *
       7  * This code is free software; you can redistribute it and/or modify it
       8  * under the terms of the GNU General Public License version 2 only, as
       9  * published by the Free Software Foundation.  Oracle designates this
      10  * particular file as subject to the "Classpath" exception as provided
      11  * by Oracle in the LICENSE file that accompanied this code.
      12  *
      13  * This code is distributed in the hope that it will be useful, but WITHOUT
      14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
      15  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      16  * version 2 for more details (a copy is included in the LICENSE file that
      17  * accompanied this code).
      18  *
      19  * You should have received a copy of the GNU General Public License version
      20  * 2 along with this work; if not, write to the Free Software Foundation,
      21  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
      22  *
      23  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
      24  * or visit www.oracle.com if you need additional information or have any
      25  * questions.
      26  */
      27 package com.sun.javatest.cof;
      28
      29 import java.io.IOException;
      30 import java.util.ArrayList;
      31 import java.util.LinkedHashMap;
      32 import java.util.List;
      33
      34 import com.sun.javatest.util.XMLWriter;
      35 /*import javax.xml.bind.annotation.XmlAccessType;
      36 import javax.xml.bind.annotation.XmlAccessorType;
      37 import javax.xml.bind.annotation.XmlElement;
      38 import javax.xml.bind.annotation.XmlType;
      39 */
      40
      41 /**
      42  * <p>Java class for TestCases complex type.
      43  *
      44  * <p>The following schema fragment specifies the expected content contained within this class.
      45  *
      46  * <pre>
      47  * &lt;complexType name="TestCases">
      48  *   &lt;complexContent>
      49  *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
      50  *       &lt;sequence>
      51  *         &lt;element name="testcase" type="{http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema}TestCase" maxOccurs="unbounded"/>
      52  *       &lt;/sequence>
      53  *     &lt;/restriction>
      54  *   &lt;/complexContent>
      55  * &lt;/complexType>
      56  * </pre>
      57  *
      58  *
      59  */
      60 /*@XmlAccessorType(XmlAccessType.FIELD)
      61 @XmlType(name = "TestCases", propOrder = {
      62     "testcase"
      63 })*/
      64 public class COFTestCases extends COFItem{
      65
      66         static LinkedHashMap xmlAttributes;
      67
      68         static LinkedHashMap xmlElements;
      69
      70         static String xmlTagName;
      71
      72         static {
      73                 xmlTagName = "testcases";
      74                 xmlElements = new LinkedHashMap();
      75                 xmlElements.put("testcase", "testcase");
      76         }
      77
      78         //    @XmlElement(namespace = "http://qare.sfbay.sun.com/projects/COF/2003/2_0_2/Schema", required = true)
      79     protected List/*<COFTestCase>*/ testcase;
      80
      81         LinkedHashMap getItemAttributes() {
      82                 return xmlAttributes;
      83         }
      84
      85         LinkedHashMap getItemElements() {
      86                 return xmlElements;
      87         }
      88
      89
      90         String getItemTagName() {
      91                 return xmlTagName;
      92         }
      93
      94     /**
      95      * Gets the value of the testcase property.
      96      *
      97      * <p>
      98      * This accessor method returns a reference to the live list,
      99      * not a snapshot. Therefore any modification you make to the
     100      * returned list will be present inside the JAXB object.
     101      * This is why there is not a <CODE>set</CODE> method for the testcase property.
     102      *
     103      * <p>
     104      * For example, to add a new item, do as follows:
     105      * <pre>
     106      *    getTestcase().add(newItem);
     107      * </pre>
     108      *
     109      *
     110      * <p>
     111      * Objects of the following type(s) are allowed in the list
     112      * {@link COFTestCase }
     113      *
     114      *
     115      */
     116     public List/*<COFTestCase>*/ getTestcase() {
     117         if (testcase == null) {
     118             testcase = new ArrayList/*<COFTestCase>*/();
     119         }
     120         return this.testcase;
     121     }
     122
     123         /* (non-Javadoc)
     124          * @see com.sun.javatest.cof.COFItem#write(com.sun.javatest.util.XMLWriter)
     125          */
     126         void write(XMLWriter out) throws IOException {
     127                 if (getTestcase().size() != 0) {
     128                         out.newLine();
     129                         super.write(out);
     130                 }
     131         }
     132
     133 }