2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
3 * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 package jalview.binding;
21 // ---------------------------------/
22 // - Imported classes and packages -/
23 // ---------------------------------/
25 import org.exolab.castor.xml.Marshaller;
26 import org.exolab.castor.xml.Unmarshaller;
31 * @version $Revision$ $Date$
33 public class Alignment implements java.io.Serializable
36 // --------------------------/
37 // - Class/Member Variables -/
38 // --------------------------/
43 private jalview.binding.Annotation _annotation;
48 private jalview.binding.SequenceSet _sequenceSet;
64 * Returns the value of field 'annotation'.
66 * @return the value of field 'Annotation'.
68 public jalview.binding.Annotation getAnnotation()
70 return this._annotation;
74 * Returns the value of field 'sequenceSet'.
76 * @return the value of field 'SequenceSet'.
78 public jalview.binding.SequenceSet getSequenceSet()
80 return this._sequenceSet;
86 * @return true if this object is valid according to the schema
88 public boolean isValid()
93 } catch (org.exolab.castor.xml.ValidationException vex)
104 * @throws org.exolab.castor.xml.MarshalException
105 * if object is null or if any SAXException is thrown during
107 * @throws org.exolab.castor.xml.ValidationException
108 * if this object is an invalid instance according to the
111 public void marshal(final java.io.Writer out)
112 throws org.exolab.castor.xml.MarshalException,
113 org.exolab.castor.xml.ValidationException
115 Marshaller.marshal(this, out);
122 * @throws java.io.IOException
123 * if an IOException occurs during marshaling
124 * @throws org.exolab.castor.xml.ValidationException
125 * if this object is an invalid instance according to the
127 * @throws org.exolab.castor.xml.MarshalException
128 * if object is null or if any SAXException is thrown during
131 public void marshal(final org.xml.sax.ContentHandler handler)
132 throws java.io.IOException,
133 org.exolab.castor.xml.MarshalException,
134 org.exolab.castor.xml.ValidationException
136 Marshaller.marshal(this, handler);
140 * Sets the value of field 'annotation'.
143 * the value of field 'annotation'.
145 public void setAnnotation(final jalview.binding.Annotation annotation)
147 this._annotation = annotation;
151 * Sets the value of field 'sequenceSet'.
154 * the value of field 'sequenceSet'.
156 public void setSequenceSet(final jalview.binding.SequenceSet sequenceSet)
158 this._sequenceSet = sequenceSet;
165 * @throws org.exolab.castor.xml.MarshalException
166 * if object is null or if any SAXException is thrown during
168 * @throws org.exolab.castor.xml.ValidationException
169 * if this object is an invalid instance according to the
171 * @return the unmarshaled jalview.binding.Alignment
173 public static jalview.binding.Alignment unmarshal(
174 final java.io.Reader reader)
175 throws org.exolab.castor.xml.MarshalException,
176 org.exolab.castor.xml.ValidationException
178 return (jalview.binding.Alignment) Unmarshaller.unmarshal(
179 jalview.binding.Alignment.class, reader);
185 * @throws org.exolab.castor.xml.ValidationException
186 * if this object is an invalid instance according to the
189 public void validate() throws org.exolab.castor.xml.ValidationException
191 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
192 validator.validate(this);