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