095468b8cc3e09c1b7d1d9d4143b6a81e1682cea
[jalview.git] / src / jalview / schemabinding / version2 / SequenceSetProperties.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 SequenceSetProperties.
29  * 
30  * @version $Revision$ $Date$
31  */
32 public class SequenceSetProperties implements java.io.Serializable
33 {
34
35   // --------------------------/
36   // - Class/Member Variables -/
37   // --------------------------/
38
39   /**
40    * Field _key.
41    */
42   private java.lang.String _key;
43
44   /**
45    * Field _value.
46    */
47   private java.lang.String _value;
48
49   // ----------------/
50   // - Constructors -/
51   // ----------------/
52
53   public SequenceSetProperties()
54   {
55     super();
56   }
57
58   // -----------/
59   // - Methods -/
60   // -----------/
61
62   /**
63    * Returns the value of field 'key'.
64    * 
65    * @return the value of field 'Key'.
66    */
67   public java.lang.String getKey()
68   {
69     return this._key;
70   }
71
72   /**
73    * Returns the value of field 'value'.
74    * 
75    * @return the value of field 'Value'.
76    */
77   public java.lang.String getValue()
78   {
79     return this._value;
80   }
81
82   /**
83    * Method isValid.
84    * 
85    * @return true if this object is valid according to the schema
86    */
87   public boolean isValid()
88   {
89     try
90     {
91       validate();
92     } catch (org.exolab.castor.xml.ValidationException vex)
93     {
94       return false;
95     }
96     return true;
97   }
98
99   /**
100    * 
101    * 
102    * @param out
103    * @throws org.exolab.castor.xml.MarshalException
104    *           if object is null or if any SAXException is thrown during
105    *           marshaling
106    * @throws org.exolab.castor.xml.ValidationException
107    *           if this object is an invalid instance according to the schema
108    */
109   public void marshal(final java.io.Writer out)
110           throws org.exolab.castor.xml.MarshalException,
111           org.exolab.castor.xml.ValidationException
112   {
113     Marshaller.marshal(this, out);
114   }
115
116   /**
117    * 
118    * 
119    * @param handler
120    * @throws java.io.IOException
121    *           if an IOException occurs during marshaling
122    * @throws org.exolab.castor.xml.ValidationException
123    *           if this object is an invalid instance according to the schema
124    * @throws org.exolab.castor.xml.MarshalException
125    *           if object is null or if any SAXException is thrown during
126    *           marshaling
127    */
128   public void marshal(final org.xml.sax.ContentHandler handler)
129           throws java.io.IOException,
130           org.exolab.castor.xml.MarshalException,
131           org.exolab.castor.xml.ValidationException
132   {
133     Marshaller.marshal(this, handler);
134   }
135
136   /**
137    * Sets the value of field 'key'.
138    * 
139    * @param key
140    *          the value of field 'key'.
141    */
142   public void setKey(final java.lang.String key)
143   {
144     this._key = key;
145   }
146
147   /**
148    * Sets the value of field 'value'.
149    * 
150    * @param value
151    *          the value of field 'value'.
152    */
153   public void setValue(final java.lang.String value)
154   {
155     this._value = value;
156   }
157
158   /**
159    * Method unmarshal.
160    * 
161    * @param reader
162    * @throws org.exolab.castor.xml.MarshalException
163    *           if object is null or if any SAXException is thrown during
164    *           marshaling
165    * @throws org.exolab.castor.xml.ValidationException
166    *           if this object is an invalid instance according to the schema
167    * @return the unmarshaled
168    *         jalview.schemabinding.version2.SequenceSetProperties
169    */
170   public static jalview.schemabinding.version2.SequenceSetProperties unmarshal(
171           final java.io.Reader reader)
172           throws org.exolab.castor.xml.MarshalException,
173           org.exolab.castor.xml.ValidationException
174   {
175     return (jalview.schemabinding.version2.SequenceSetProperties) Unmarshaller
176             .unmarshal(
177                     jalview.schemabinding.version2.SequenceSetProperties.class,
178                     reader);
179   }
180
181   /**
182    * 
183    * 
184    * @throws org.exolab.castor.xml.ValidationException
185    *           if this object is an invalid instance according to the schema
186    */
187   public void validate() throws org.exolab.castor.xml.ValidationException
188   {
189     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
190     validator.validate(this);
191   }
192
193 }