0b4499c024509901c25b5c3a7fbef020dd362783
[jalview.git] / src / jalview / schemabinding / version2 / Group.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)\r
3  * Copyright (C) 2009 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       //----------------/\r
57      //- Constructors -/\r
58     //----------------/\r
59 \r
60     public Group() {\r
61         super();\r
62     }\r
63 \r
64 \r
65       //-----------/\r
66      //- Methods -/\r
67     //-----------/\r
68 \r
69     /**\r
70      */\r
71     public void deleteDisplay(\r
72     ) {\r
73         this._has_display= false;\r
74     }\r
75 \r
76     /**\r
77      * Returns the value of field 'display'.\r
78      * \r
79      * @return the value of field 'Display'.\r
80      */\r
81     public boolean getDisplay(\r
82     ) {\r
83         return this._display;\r
84     }\r
85 \r
86     /**\r
87      * Returns the value of field 'name'.\r
88      * \r
89      * @return the value of field 'Name'.\r
90      */\r
91     public java.lang.String getName(\r
92     ) {\r
93         return this._name;\r
94     }\r
95 \r
96     /**\r
97      * Method hasDisplay.\r
98      * \r
99      * @return true if at least one Display has been added\r
100      */\r
101     public boolean hasDisplay(\r
102     ) {\r
103         return this._has_display;\r
104     }\r
105 \r
106     /**\r
107      * Returns the value of field 'display'.\r
108      * \r
109      * @return the value of field 'Display'.\r
110      */\r
111     public boolean isDisplay(\r
112     ) {\r
113         return this._display;\r
114     }\r
115 \r
116     /**\r
117      * Method isValid.\r
118      * \r
119      * @return true if this object is valid according to the schema\r
120      */\r
121     public boolean isValid(\r
122     ) {\r
123         try {\r
124             validate();\r
125         } catch (org.exolab.castor.xml.ValidationException vex) {\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 if object is\r
136      * null or if any SAXException is thrown during marshaling\r
137      * @throws org.exolab.castor.xml.ValidationException if this\r
138      * object is an invalid instance according to the schema\r
139      */\r
140     public void marshal(\r
141             final java.io.Writer out)\r
142     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
143         Marshaller.marshal(this, out);\r
144     }\r
145 \r
146     /**\r
147      * \r
148      * \r
149      * @param handler\r
150      * @throws java.io.IOException if an IOException occurs during\r
151      * marshaling\r
152      * @throws org.exolab.castor.xml.ValidationException if this\r
153      * object is an invalid instance according to the schema\r
154      * @throws org.exolab.castor.xml.MarshalException if object is\r
155      * null or if any SAXException is thrown during marshaling\r
156      */\r
157     public void marshal(\r
158             final org.xml.sax.ContentHandler handler)\r
159     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
160         Marshaller.marshal(this, handler);\r
161     }\r
162 \r
163     /**\r
164      * Sets the value of field 'display'.\r
165      * \r
166      * @param display the value of field 'display'.\r
167      */\r
168     public void setDisplay(\r
169             final boolean display) {\r
170         this._display = display;\r
171         this._has_display = true;\r
172     }\r
173 \r
174     /**\r
175      * Sets the value of field 'name'.\r
176      * \r
177      * @param name the value of field 'name'.\r
178      */\r
179     public void setName(\r
180             final java.lang.String name) {\r
181         this._name = name;\r
182     }\r
183 \r
184     /**\r
185      * Method unmarshal.\r
186      * \r
187      * @param reader\r
188      * @throws org.exolab.castor.xml.MarshalException if object is\r
189      * null or if any SAXException is thrown during marshaling\r
190      * @throws org.exolab.castor.xml.ValidationException if this\r
191      * object is an invalid instance according to the schema\r
192      * @return the unmarshaled jalview.schemabinding.version2.Group\r
193      */\r
194     public static jalview.schemabinding.version2.Group unmarshal(\r
195             final java.io.Reader reader)\r
196     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
197         return (jalview.schemabinding.version2.Group) Unmarshaller.unmarshal(jalview.schemabinding.version2.Group.class, reader);\r
198     }\r
199 \r
200     /**\r
201      * \r
202      * \r
203      * @throws org.exolab.castor.xml.ValidationException if this\r
204      * object is an invalid instance according to the schema\r
205      */\r
206     public void validate(\r
207     )\r
208     throws org.exolab.castor.xml.ValidationException {\r
209         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
210         validator.validate(this);\r
211     }\r
212 \r
213 }\r