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