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