From: amwaterhouse Date: Thu, 25 Jan 2007 18:44:47 +0000 (+0000) Subject: AlignmentAnnotations require id X-Git-Tag: Release_2_3~438 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=77dd1ea813b06b331614520a8b3d561435f27880;p=jalview.git AlignmentAnnotations require id --- diff --git a/schemas/vamsas.xsd b/schemas/vamsas.xsd index aeb9ee3..5ee50eb 100755 --- a/schemas/vamsas.xsd +++ b/schemas/vamsas.xsd @@ -46,6 +46,7 @@ + diff --git a/src/jalview/schemabinding/version2/Annotation.java b/src/jalview/schemabinding/version2/Annotation.java index ec9b84c..61f9413 100755 --- a/src/jalview/schemabinding/version2/Annotation.java +++ b/src/jalview/schemabinding/version2/Annotation.java @@ -81,6 +81,11 @@ public class Annotation implements java.io.Serializable { private boolean _has_graphGroup; /** + * Field _id + */ + private java.lang.String _id; + + /** * Field _annotationElementList */ private java.util.Vector _annotationElementList; @@ -294,6 +299,17 @@ public class Annotation implements java.io.Serializable { } //-- int getGraphType() /** + * Returns the value of field 'id'. + * + * @return String + * @return the value of field 'id'. + */ + public java.lang.String getId() + { + return this._id; + } //-- java.lang.String getId() + + /** * Returns the value of field 'label'. * * @return String @@ -533,6 +549,16 @@ public class Annotation implements java.io.Serializable { } //-- void setGraphType(int) /** + * Sets the value of field 'id'. + * + * @param id the value of field 'id'. + */ + public void setId(java.lang.String id) + { + this._id = id; + } //-- void setId(java.lang.String) + + /** * Sets the value of field 'label'. * * @param label the value of field 'label'. diff --git a/src/jalview/schemabinding/version2/AnnotationDescriptor.java b/src/jalview/schemabinding/version2/AnnotationDescriptor.java index b2290fe..34047b3 100755 --- a/src/jalview/schemabinding/version2/AnnotationDescriptor.java +++ b/src/jalview/schemabinding/version2/AnnotationDescriptor.java @@ -265,6 +265,42 @@ public class AnnotationDescriptor extends org.exolab.castor.xml.util.XMLClassDes fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); + //-- _id + 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 + { + Annotation target = (Annotation) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Annotation target = (Annotation) object; + target.setId( (java.lang.String) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return null; + } + } ); + desc.setHandler(handler); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); //-- initialize element descriptors //-- _annotationElementList