2 * This file is part of the Vamsas Client version 0.1.
\r
3 * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
\r
4 * Andrew Waterhouse and Dominik Lindner.
\r
6 * Earlier versions have also been incorporated into Jalview version 2.4
\r
7 * since 2008, and TOPALi version 2 since 2007.
\r
9 * The Vamsas Client is free software: you can redistribute it and/or modify
\r
10 * it under the terms of the GNU Lesser General Public License as published by
\r
11 * the Free Software Foundation, either version 3 of the License, or
\r
12 * (at your option) any later version.
\r
14 * The Vamsas Client is distributed in the hope that it will be useful,
\r
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
17 * GNU Lesser General Public License for more details.
\r
19 * You should have received a copy of the GNU Lesser General Public License
\r
20 * along with the Vamsas Client. If not, see <http://www.gnu.org/licenses/>.
\r
22 package uk.ac.vamsas.objects.core;
\r
24 //---------------------------------/
\r
25 //- Imported classes and packages -/
\r
26 //---------------------------------/
\r
28 import org.exolab.castor.xml.Marshaller;
\r
29 import org.exolab.castor.xml.Unmarshaller;
\r
34 * @version $Revision$ $Date$
\r
36 public class Common extends uk.ac.vamsas.objects.core.AppData implements
\r
37 java.io.Serializable {
\r
39 // ----------------/
\r
40 // - Constructors -/
\r
41 // ----------------/
\r
52 * Overrides the java.lang.Object.equals method.
\r
55 * @return true if the objects are equal.
\r
57 public boolean equals(final java.lang.Object obj) {
\r
61 if (super.equals(obj) == false)
\r
64 if (obj instanceof Common) {
\r
72 * Overrides the java.lang.Object.hashCode method.
\r
74 * The following steps came from <b>Effective Java Programming Language
\r
75 * Guide</b> by Joshua Bloch, Chapter 3
\r
77 * @return a hash code value for the object.
\r
79 public int hashCode() {
\r
80 int result = super.hashCode();
\r
90 * @return true if this object is valid according to the schema
\r
92 public boolean isValid() {
\r
95 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
105 * @throws org.exolab.castor.xml.MarshalException
\r
106 * if object is null or if any SAXException is thrown during
\r
108 * @throws org.exolab.castor.xml.ValidationException
\r
109 * if this object is an invalid instance according to the schema
\r
111 public void marshal(final java.io.Writer out)
\r
112 throws org.exolab.castor.xml.MarshalException,
\r
113 org.exolab.castor.xml.ValidationException {
\r
114 Marshaller.marshal(this, out);
\r
121 * @throws java.io.IOException
\r
122 * if an IOException occurs during marshaling
\r
123 * @throws org.exolab.castor.xml.ValidationException
\r
124 * if this object is an invalid instance according to the schema
\r
125 * @throws org.exolab.castor.xml.MarshalException
\r
126 * if object is null or if any SAXException is thrown during
\r
129 public void marshal(final org.xml.sax.ContentHandler handler)
\r
130 throws java.io.IOException, org.exolab.castor.xml.MarshalException,
\r
131 org.exolab.castor.xml.ValidationException {
\r
132 Marshaller.marshal(this, handler);
\r
136 * Method unmarshal.
\r
139 * @throws org.exolab.castor.xml.MarshalException
\r
140 * if object is null or if any SAXException is thrown during
\r
142 * @throws org.exolab.castor.xml.ValidationException
\r
143 * if this object is an invalid instance according to the schema
\r
144 * @return the unmarshaled uk.ac.vamsas.objects.core.AppData
\r
146 public static uk.ac.vamsas.objects.core.AppData unmarshal(
\r
147 final java.io.Reader reader)
\r
148 throws org.exolab.castor.xml.MarshalException,
\r
149 org.exolab.castor.xml.ValidationException {
\r
150 return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(
\r
151 uk.ac.vamsas.objects.core.Common.class, reader);
\r
157 * @throws org.exolab.castor.xml.ValidationException
\r
158 * if this object is an invalid instance according to the schema
\r
160 public void validate() throws org.exolab.castor.xml.ValidationException {
\r
161 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
162 validator.validate(this);
\r