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