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