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