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