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