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