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