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