JAL-1620 version bump and release notes
[jalview.git] / src / jalview / schemabinding / version2 / Mapping.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
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 Mapping.
32  * 
33  * @version $Revision$ $Date$
34  */
35 public class Mapping extends jalview.schemabinding.version2.MapListType
36         implements java.io.Serializable
37 {
38
39   // --------------------------/
40   // - Class/Member Variables -/
41   // --------------------------/
42
43   /**
44    * Internal choice value storage
45    */
46   private java.lang.Object _choiceValue;
47
48   /**
49    * Field _mappingChoice.
50    */
51   private jalview.schemabinding.version2.MappingChoice _mappingChoice;
52
53   // ----------------/
54   // - Constructors -/
55   // ----------------/
56
57   public Mapping()
58   {
59     super();
60   }
61
62   // -----------/
63   // - Methods -/
64   // -----------/
65
66   /**
67    * Returns the value of field 'choiceValue'. The field 'choiceValue' has the
68    * following description: Internal choice value storage
69    * 
70    * @return the value of field 'ChoiceValue'.
71    */
72   public java.lang.Object getChoiceValue()
73   {
74     return this._choiceValue;
75   }
76
77   /**
78    * Returns the value of field 'mappingChoice'.
79    * 
80    * @return the value of field 'MappingChoice'.
81    */
82   public jalview.schemabinding.version2.MappingChoice getMappingChoice()
83   {
84     return this._mappingChoice;
85   }
86
87   /**
88    * Method isValid.
89    * 
90    * @return true if this object is valid according to the schema
91    */
92   public boolean isValid()
93   {
94     try
95     {
96       validate();
97     } catch (org.exolab.castor.xml.ValidationException vex)
98     {
99       return false;
100     }
101     return true;
102   }
103
104   /**
105    * 
106    * 
107    * @param out
108    * @throws org.exolab.castor.xml.MarshalException
109    *           if object is null or if any SAXException is thrown during
110    *           marshaling
111    * @throws org.exolab.castor.xml.ValidationException
112    *           if this object is an invalid instance according to the schema
113    */
114   public void marshal(final java.io.Writer out)
115           throws org.exolab.castor.xml.MarshalException,
116           org.exolab.castor.xml.ValidationException
117   {
118     Marshaller.marshal(this, out);
119   }
120
121   /**
122    * 
123    * 
124    * @param handler
125    * @throws java.io.IOException
126    *           if an IOException occurs during marshaling
127    * @throws org.exolab.castor.xml.ValidationException
128    *           if this object is an invalid instance according to the schema
129    * @throws org.exolab.castor.xml.MarshalException
130    *           if object is null or if any SAXException is thrown during
131    *           marshaling
132    */
133   public void marshal(final org.xml.sax.ContentHandler handler)
134           throws java.io.IOException,
135           org.exolab.castor.xml.MarshalException,
136           org.exolab.castor.xml.ValidationException
137   {
138     Marshaller.marshal(this, handler);
139   }
140
141   /**
142    * Sets the value of field 'mappingChoice'.
143    * 
144    * @param mappingChoice
145    *          the value of field 'mappingChoice'.
146    */
147   public void setMappingChoice(
148           final jalview.schemabinding.version2.MappingChoice mappingChoice)
149   {
150     this._mappingChoice = mappingChoice;
151     this._choiceValue = mappingChoice;
152   }
153
154   /**
155    * Method unmarshal.
156    * 
157    * @param reader
158    * @throws org.exolab.castor.xml.MarshalException
159    *           if object is null or if any SAXException is thrown during
160    *           marshaling
161    * @throws org.exolab.castor.xml.ValidationException
162    *           if this object is an invalid instance according to the schema
163    * @return the unmarshaled jalview.schemabinding.version2.MapListType
164    */
165   public static jalview.schemabinding.version2.MapListType unmarshal(
166           final java.io.Reader reader)
167           throws org.exolab.castor.xml.MarshalException,
168           org.exolab.castor.xml.ValidationException
169   {
170     return (jalview.schemabinding.version2.MapListType) Unmarshaller
171             .unmarshal(jalview.schemabinding.version2.Mapping.class, reader);
172   }
173
174   /**
175    * 
176    * 
177    * @throws org.exolab.castor.xml.ValidationException
178    *           if this object is an invalid instance according to the schema
179    */
180   public void validate() throws org.exolab.castor.xml.ValidationException
181   {
182     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
183     validator.validate(this);
184   }
185
186 }