/*\r
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)\r
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)\r
+ * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
* \r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
+ * This file is part of Jalview.\r
* \r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
+ * Jalview is free software: you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License \r
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
* \r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\r
+ * Jalview is distributed in the hope that it will be useful, but \r
+ * WITHOUT ANY WARRANTY; without even the implied warranty \r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ * PURPOSE. See the GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.\r
*/\r
package jalview.schemabinding.version2.descriptors;\r
\r
-// ---------------------------------/\r
-// - Imported classes and packages -/\r
-// ---------------------------------/\r
+//---------------------------------/\r
+//- Imported classes and packages -/\r
+//---------------------------------/\r
\r
-import jalview.schemabinding.version2.Colour;\r
import jalview.schemabinding.version2.JalviewUserColours;\r
+import jalview.schemabinding.version2.Colour;\r
\r
/**\r
* Class JalviewUserColoursDescriptor.\r
desc.setValidator(fieldValidator);\r
// -- initialize element descriptors\r
\r
+ // -- _version\r
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(\r
+ java.lang.String.class, "_version", "Version",\r
+ org.exolab.castor.xml.NodeType.Element);\r
+ desc.setImmutable(true);\r
+ handler = new org.exolab.castor.xml.XMLFieldHandler()\r
+ {\r
+ public java.lang.Object getValue(java.lang.Object object)\r
+ throws IllegalStateException\r
+ {\r
+ JalviewUserColours target = (JalviewUserColours) object;\r
+ return target.getVersion();\r
+ }\r
+\r
+ public void setValue(java.lang.Object object, java.lang.Object value)\r
+ throws IllegalStateException, IllegalArgumentException\r
+ {\r
+ try\r
+ {\r
+ JalviewUserColours target = (JalviewUserColours) object;\r
+ target.setVersion((java.lang.String) value);\r
+ } catch (java.lang.Exception ex)\r
+ {\r
+ throw new IllegalStateException(ex.toString());\r
+ }\r
+ }\r
+\r
+ public java.lang.Object newInstance(java.lang.Object parent)\r
+ {\r
+ return null;\r
+ }\r
+ };\r
+ desc.setHandler(handler);\r
+ desc.setMultivalued(false);\r
+ addFieldDescriptor(desc);\r
+\r
+ // -- validation code for: _version\r
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();\r
+ { // -- local scope\r
+ org.exolab.castor.xml.validators.StringValidator typeValidator;\r
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();\r
+ fieldValidator.setValidator(typeValidator);\r
+ typeValidator.setWhiteSpace("preserve");\r
+ }\r
+ desc.setValidator(fieldValidator);\r
// -- _colourList\r
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(\r
Colour.class, "_colourList", "colour",\r
}\r
};\r
desc.setHandler(handler);\r
- desc.setRequired(true);\r
desc.setMultivalued(true);\r
addFieldDescriptor(desc);\r
\r
// -- validation code for: _colourList\r
fieldValidator = new org.exolab.castor.xml.FieldValidator();\r
- fieldValidator.setMinOccurs(1);\r
+ fieldValidator.setMinOccurs(0);\r
{ // -- local scope\r
}\r
desc.setValidator(fieldValidator);\r