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