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