2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
\r
3 * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.schemabinding.version2;
\r
21 // ---------------------------------/
\r
22 // - Imported classes and packages -/
\r
23 // ---------------------------------/
\r
25 import org.exolab.castor.xml.Marshaller;
\r
26 import org.exolab.castor.xml.Unmarshaller;
\r
31 * @version $Revision$ $Date$
\r
33 public class Mapping extends jalview.schemabinding.version2.MapListType
\r
34 implements java.io.Serializable
\r
37 // --------------------------/
\r
38 // - Class/Member Variables -/
\r
39 // --------------------------/
\r
42 * Internal choice value storage
\r
44 private java.lang.Object _choiceValue;
\r
47 * Field _mappingChoice.
\r
49 private jalview.schemabinding.version2.MappingChoice _mappingChoice;
\r
51 // ----------------/
\r
52 // - Constructors -/
\r
53 // ----------------/
\r
65 * Returns the value of field 'choiceValue'. The field 'choiceValue' has the
\r
66 * following description: Internal choice value storage
\r
68 * @return the value of field 'ChoiceValue'.
\r
70 public java.lang.Object getChoiceValue()
\r
72 return this._choiceValue;
\r
76 * Returns the value of field 'mappingChoice'.
\r
78 * @return the value of field 'MappingChoice'.
\r
80 public jalview.schemabinding.version2.MappingChoice getMappingChoice()
\r
82 return this._mappingChoice;
\r
88 * @return true if this object is valid according to the schema
\r
90 public boolean isValid()
\r
95 } catch (org.exolab.castor.xml.ValidationException vex)
\r
106 * @throws org.exolab.castor.xml.MarshalException
\r
107 * if object is null or if any SAXException is thrown during
\r
109 * @throws org.exolab.castor.xml.ValidationException
\r
110 * if this object is an invalid instance according to the
\r
113 public void marshal(final java.io.Writer out)
\r
114 throws org.exolab.castor.xml.MarshalException,
\r
115 org.exolab.castor.xml.ValidationException
\r
117 Marshaller.marshal(this, out);
\r
124 * @throws java.io.IOException
\r
125 * if an IOException occurs during marshaling
\r
126 * @throws org.exolab.castor.xml.ValidationException
\r
127 * if this object is an invalid instance according to the
\r
129 * @throws org.exolab.castor.xml.MarshalException
\r
130 * if object is null or if any SAXException is thrown during
\r
133 public void marshal(final org.xml.sax.ContentHandler handler)
\r
134 throws java.io.IOException,
\r
135 org.exolab.castor.xml.MarshalException,
\r
136 org.exolab.castor.xml.ValidationException
\r
138 Marshaller.marshal(this, handler);
\r
142 * Sets the value of field 'mappingChoice'.
\r
144 * @param mappingChoice
\r
145 * the value of field 'mappingChoice'.
\r
147 public void setMappingChoice(
\r
148 final jalview.schemabinding.version2.MappingChoice mappingChoice)
\r
150 this._mappingChoice = mappingChoice;
\r
151 this._choiceValue = mappingChoice;
\r
155 * Method unmarshal.
\r
158 * @throws org.exolab.castor.xml.MarshalException
\r
159 * if object is null or if any SAXException is thrown during
\r
161 * @throws org.exolab.castor.xml.ValidationException
\r
162 * if this object is an invalid instance according to the
\r
164 * @return the unmarshaled jalview.schemabinding.version2.MapListType
\r
166 public static jalview.schemabinding.version2.MapListType unmarshal(
\r
167 final java.io.Reader reader)
\r
168 throws org.exolab.castor.xml.MarshalException,
\r
169 org.exolab.castor.xml.ValidationException
\r
171 return (jalview.schemabinding.version2.MapListType) Unmarshaller
\r
172 .unmarshal(jalview.schemabinding.version2.Mapping.class, reader);
\r
178 * @throws org.exolab.castor.xml.ValidationException
\r
179 * if this object is an invalid instance according to the
\r
182 public void validate() throws org.exolab.castor.xml.ValidationException
\r
184 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
185 validator.validate(this);
\r