X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemabinding%2Fversion2%2Fdescriptors%2FJSeqDescriptor.java;h=d13bf7c98d05ab49ae66b86649a0ec3c73b9a3c0;hb=499899ef6e62998ca49318b728d2f1da8fb21173;hp=3d3a4f52123026967ab0de40f4dee14301956fc7;hpb=09ee1649c4427f534331aa2017a890529f0932f5;p=jalview.git diff --git a/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java index 3d3a4f5..d13bf7c 100644 --- a/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java @@ -1,10 +1,21 @@ /* - * This class was automatically generated with - * Castor 1.1, using an XML - * Schema. - * $Id$ + * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1) + * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - package jalview.schemabinding.version2.descriptors; //---------------------------------/ @@ -45,11 +56,6 @@ public class JSeqDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto */ private java.lang.String _xmlName; - /** - * Field _identity. - */ - private org.exolab.castor.xml.XMLFieldDescriptor _identity; - //----------------/ //- Constructors -/ @@ -198,24 +204,21 @@ public class JSeqDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto } desc.setValidator(fieldValidator); //-- _id - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { JSeq target = (JSeq) object; - if (!target.hasId()) { return null; } - return new java.lang.Integer(target.getId()); + return target.getId(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { JSeq target = (JSeq) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setId( ((java.lang.Integer) value).intValue()); + target.setId( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } @@ -233,11 +236,10 @@ public class JSeqDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(1); { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + typeValidator.setWhiteSpace("preserve"); } desc.setValidator(fieldValidator); //-- _hidden @@ -442,7 +444,7 @@ public class JSeqDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto */ public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { - return _identity; + return super.getIdentity(); } /**