1faa76d3e0dcfefe4e9507d237ee4f6d7d2ed95f
[jalview.git] / src / jalview / schemabinding / version2 / Property.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer (Development 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 Property.\r
30  * \r
31  * @version $Revision$ $Date$\r
32  */\r
33 public class Property implements java.io.Serializable {\r
34 \r
35 \r
36       //--------------------------/\r
37      //- Class/Member Variables -/\r
38     //--------------------------/\r
39 \r
40     /**\r
41      * Field _name.\r
42      */\r
43     private java.lang.String _name;\r
44 \r
45     /**\r
46      * Field _value.\r
47      */\r
48     private java.lang.String _value;\r
49 \r
50 \r
51       //----------------/\r
52      //- Constructors -/\r
53     //----------------/\r
54 \r
55     public Property() {\r
56         super();\r
57     }\r
58 \r
59 \r
60       //-----------/\r
61      //- Methods -/\r
62     //-----------/\r
63 \r
64     /**\r
65      * Returns the value of field 'name'.\r
66      * \r
67      * @return the value of field 'Name'.\r
68      */\r
69     public java.lang.String getName(\r
70     ) {\r
71         return this._name;\r
72     }\r
73 \r
74     /**\r
75      * Returns the value of field 'value'.\r
76      * \r
77      * @return the value of field 'Value'.\r
78      */\r
79     public java.lang.String getValue(\r
80     ) {\r
81         return this._value;\r
82     }\r
83 \r
84     /**\r
85      * Method isValid.\r
86      * \r
87      * @return true if this object is valid according to the schema\r
88      */\r
89     public boolean isValid(\r
90     ) {\r
91         try {\r
92             validate();\r
93         } catch (org.exolab.castor.xml.ValidationException vex) {\r
94             return false;\r
95         }\r
96         return true;\r
97     }\r
98 \r
99     /**\r
100      * \r
101      * \r
102      * @param out\r
103      * @throws org.exolab.castor.xml.MarshalException if object is\r
104      * null or if any SAXException is thrown during marshaling\r
105      * @throws org.exolab.castor.xml.ValidationException if this\r
106      * object is an invalid instance according to the schema\r
107      */\r
108     public void marshal(\r
109             final java.io.Writer out)\r
110     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
111         Marshaller.marshal(this, out);\r
112     }\r
113 \r
114     /**\r
115      * \r
116      * \r
117      * @param handler\r
118      * @throws java.io.IOException if an IOException occurs during\r
119      * marshaling\r
120      * @throws org.exolab.castor.xml.ValidationException if this\r
121      * object is an invalid instance according to the schema\r
122      * @throws org.exolab.castor.xml.MarshalException if object is\r
123      * null or if any SAXException is thrown during marshaling\r
124      */\r
125     public void marshal(\r
126             final org.xml.sax.ContentHandler handler)\r
127     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
128         Marshaller.marshal(this, handler);\r
129     }\r
130 \r
131     /**\r
132      * Sets the value of field 'name'.\r
133      * \r
134      * @param name the value of field 'name'.\r
135      */\r
136     public void setName(\r
137             final java.lang.String name) {\r
138         this._name = name;\r
139     }\r
140 \r
141     /**\r
142      * Sets the value of field 'value'.\r
143      * \r
144      * @param value the value of field 'value'.\r
145      */\r
146     public void setValue(\r
147             final java.lang.String value) {\r
148         this._value = value;\r
149     }\r
150 \r
151     /**\r
152      * Method unmarshal.\r
153      * \r
154      * @param reader\r
155      * @throws org.exolab.castor.xml.MarshalException if object is\r
156      * null or if any SAXException is thrown during marshaling\r
157      * @throws org.exolab.castor.xml.ValidationException if this\r
158      * object is an invalid instance according to the schema\r
159      * @return the unmarshaled\r
160      * jalview.schemabinding.version2.Property\r
161      */\r
162     public static jalview.schemabinding.version2.Property unmarshal(\r
163             final java.io.Reader reader)\r
164     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
165         return (jalview.schemabinding.version2.Property) Unmarshaller.unmarshal(jalview.schemabinding.version2.Property.class, reader);\r
166     }\r
167 \r
168     /**\r
169      * \r
170      * \r
171      * @throws org.exolab.castor.xml.ValidationException if this\r
172      * object is an invalid instance according to the schema\r
173      */\r
174     public void validate(\r
175     )\r
176     throws org.exolab.castor.xml.ValidationException {\r
177         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
178         validator.validate(this);\r
179     }\r
180 \r
181 }\r