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