JAL-1432 updated copyright notices
[jalview.git] / src / jalview / schemabinding / version2 / Group.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  *  
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  * The Jalview Authors are detailed in the 'AUTHORS' file.
18  */
19 package jalview.schemabinding.version2;
20
21 //---------------------------------/
22 //- Imported classes and packages -/
23 //---------------------------------/
24
25 import org.exolab.castor.xml.Marshaller;
26 import org.exolab.castor.xml.Unmarshaller;
27
28 /**
29  * Class Group.
30  * 
31  * @version $Revision$ $Date$
32  */
33 public class Group implements java.io.Serializable
34 {
35
36   // --------------------------/
37   // - Class/Member Variables -/
38   // --------------------------/
39
40   /**
41    * Field _name.
42    */
43   private java.lang.String _name;
44
45   /**
46    * Field _display.
47    */
48   private boolean _display;
49
50   /**
51    * keeps track of state for field: _display
52    */
53   private boolean _has_display;
54
55   // ----------------/
56   // - Constructors -/
57   // ----------------/
58
59   public Group()
60   {
61     super();
62   }
63
64   // -----------/
65   // - Methods -/
66   // -----------/
67
68   /**
69      */
70   public void deleteDisplay()
71   {
72     this._has_display = false;
73   }
74
75   /**
76    * Returns the value of field 'display'.
77    * 
78    * @return the value of field 'Display'.
79    */
80   public boolean getDisplay()
81   {
82     return this._display;
83   }
84
85   /**
86    * Returns the value of field 'name'.
87    * 
88    * @return the value of field 'Name'.
89    */
90   public java.lang.String getName()
91   {
92     return this._name;
93   }
94
95   /**
96    * Method hasDisplay.
97    * 
98    * @return true if at least one Display has been added
99    */
100   public boolean hasDisplay()
101   {
102     return this._has_display;
103   }
104
105   /**
106    * Returns the value of field 'display'.
107    * 
108    * @return the value of field 'Display'.
109    */
110   public boolean isDisplay()
111   {
112     return this._display;
113   }
114
115   /**
116    * Method isValid.
117    * 
118    * @return true if this object is valid according to the schema
119    */
120   public boolean isValid()
121   {
122     try
123     {
124       validate();
125     } catch (org.exolab.castor.xml.ValidationException vex)
126     {
127       return false;
128     }
129     return true;
130   }
131
132   /**
133    * 
134    * 
135    * @param out
136    * @throws org.exolab.castor.xml.MarshalException
137    *           if object is null or if any SAXException is thrown during
138    *           marshaling
139    * @throws org.exolab.castor.xml.ValidationException
140    *           if this object is an invalid instance according to the schema
141    */
142   public void marshal(final java.io.Writer out)
143           throws org.exolab.castor.xml.MarshalException,
144           org.exolab.castor.xml.ValidationException
145   {
146     Marshaller.marshal(this, out);
147   }
148
149   /**
150    * 
151    * 
152    * @param handler
153    * @throws java.io.IOException
154    *           if an IOException occurs during marshaling
155    * @throws org.exolab.castor.xml.ValidationException
156    *           if this object is an invalid instance according to the schema
157    * @throws org.exolab.castor.xml.MarshalException
158    *           if object is null or if any SAXException is thrown during
159    *           marshaling
160    */
161   public void marshal(final org.xml.sax.ContentHandler handler)
162           throws java.io.IOException,
163           org.exolab.castor.xml.MarshalException,
164           org.exolab.castor.xml.ValidationException
165   {
166     Marshaller.marshal(this, handler);
167   }
168
169   /**
170    * Sets the value of field 'display'.
171    * 
172    * @param display
173    *          the value of field 'display'.
174    */
175   public void setDisplay(final boolean display)
176   {
177     this._display = display;
178     this._has_display = true;
179   }
180
181   /**
182    * Sets the value of field 'name'.
183    * 
184    * @param name
185    *          the value of field 'name'.
186    */
187   public void setName(final java.lang.String name)
188   {
189     this._name = name;
190   }
191
192   /**
193    * Method unmarshal.
194    * 
195    * @param reader
196    * @throws org.exolab.castor.xml.MarshalException
197    *           if object is null or if any SAXException is thrown during
198    *           marshaling
199    * @throws org.exolab.castor.xml.ValidationException
200    *           if this object is an invalid instance according to the schema
201    * @return the unmarshaled jalview.schemabinding.version2.Group
202    */
203   public static jalview.schemabinding.version2.Group unmarshal(
204           final java.io.Reader reader)
205           throws org.exolab.castor.xml.MarshalException,
206           org.exolab.castor.xml.ValidationException
207   {
208     return (jalview.schemabinding.version2.Group) Unmarshaller.unmarshal(
209             jalview.schemabinding.version2.Group.class, reader);
210   }
211
212   /**
213    * 
214    * 
215    * @throws org.exolab.castor.xml.ValidationException
216    *           if this object is an invalid instance according to the schema
217    */
218   public void validate() throws org.exolab.castor.xml.ValidationException
219   {
220     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
221     validator.validate(this);
222   }
223
224 }