2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
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.
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.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package jalview.binding;
20 //---------------------------------/
21 //- Imported classes and packages -/
22 //---------------------------------/
24 import org.exolab.castor.xml.Marshaller;
25 import org.exolab.castor.xml.Unmarshaller;
30 * @version $Revision$ $Date$
32 public class Sequence extends SequenceType implements java.io.Serializable
51 * @return true if this object is valid according to the schema
53 public boolean isValid()
58 } catch (org.exolab.castor.xml.ValidationException vex)
69 * @throws org.exolab.castor.xml.MarshalException
70 * if object is null or if any SAXException is thrown during
72 * @throws org.exolab.castor.xml.ValidationException
73 * if this object is an invalid instance according to the schema
75 public void marshal(final java.io.Writer out)
76 throws org.exolab.castor.xml.MarshalException,
77 org.exolab.castor.xml.ValidationException
79 Marshaller.marshal(this, out);
86 * @throws java.io.IOException
87 * if an IOException occurs during marshaling
88 * @throws org.exolab.castor.xml.ValidationException
89 * if this object is an invalid instance according to the schema
90 * @throws org.exolab.castor.xml.MarshalException
91 * if object is null or if any SAXException is thrown during
94 public void marshal(final org.xml.sax.ContentHandler handler)
95 throws java.io.IOException,
96 org.exolab.castor.xml.MarshalException,
97 org.exolab.castor.xml.ValidationException
99 Marshaller.marshal(this, handler);
106 * @throws org.exolab.castor.xml.MarshalException
107 * if object is null or if any SAXException is thrown during
109 * @throws org.exolab.castor.xml.ValidationException
110 * if this object is an invalid instance according to the schema
111 * @return the unmarshaled jalview.binding.SequenceType
113 public static jalview.binding.SequenceType unmarshal(
114 final java.io.Reader reader)
115 throws org.exolab.castor.xml.MarshalException,
116 org.exolab.castor.xml.ValidationException
118 return (jalview.binding.SequenceType) Unmarshaller.unmarshal(
119 jalview.binding.Sequence.class, reader);
125 * @throws org.exolab.castor.xml.ValidationException
126 * if this object is an invalid instance according to the schema
128 public void validate() throws org.exolab.castor.xml.ValidationException
130 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
131 validator.validate(this);