From cdb40eae73b3a9a7ca68c9b882e38a2e1dd3d03e Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 20 Jun 2016 21:38:41 +0100 Subject: [PATCH] =?utf8?q?JAL-1369=20updated=20project=20schema=20-=20flag=20?= =?utf8?q?on=20JSeq=20to=20mark=20view=E2=80=99s=20reference=20seq?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- schemas/jalview.xsd | 1 + src/jalview/schemabinding/version2/.castor.cdr | 2 +- src/jalview/schemabinding/version2/JSeq.java | 59 ++++++++++++++++++++ .../descriptors/AnnotationColoursDescriptor.java | 2 + .../version2/descriptors/FeaturesDescriptor.java | 2 + .../version2/descriptors/JSeqDescriptor.java | 55 ++++++++++++++++++ .../descriptors/JalviewUserColoursDescriptor.java | 18 ++++++ .../descriptors/UserColourSchemeDescriptor.java | 2 + .../descriptors/VamsasModelDescriptor.java | 2 + 9 files changed, 142 insertions(+), 1 deletion(-) diff --git a/schemas/jalview.xsd b/schemas/jalview.xsd index 850b223..f0bd638 100755 --- a/schemas/jalview.xsd +++ b/schemas/jalview.xsd @@ -293,6 +293,7 @@ + diff --git a/src/jalview/schemabinding/version2/.castor.cdr b/src/jalview/schemabinding/version2/.castor.cdr index 361fb7c..0a01103 100644 --- a/src/jalview/schemabinding/version2/.castor.cdr +++ b/src/jalview/schemabinding/version2/.castor.cdr @@ -1,4 +1,4 @@ -#Thu Sep 03 10:55:37 BST 2015 +#Mon Jun 20 15:44:52 BST 2016 jalview.schemabinding.version2.ThresholdLine=jalview.schemabinding.version2.descriptors.ThresholdLineDescriptor jalview.schemabinding.version2.SequenceSetProperties=jalview.schemabinding.version2.descriptors.SequenceSetPropertiesDescriptor jalview.schemabinding.version2.StructureState=jalview.schemabinding.version2.descriptors.StructureStateDescriptor diff --git a/src/jalview/schemabinding/version2/JSeq.java b/src/jalview/schemabinding/version2/JSeq.java index 9ca6708..7c6308e 100644 --- a/src/jalview/schemabinding/version2/JSeq.java +++ b/src/jalview/schemabinding/version2/JSeq.java @@ -72,6 +72,16 @@ public class JSeq implements java.io.Serializable private boolean _has_hidden; /** + * Field _viewreference. + */ + private boolean _viewreference; + + /** + * keeps track of state for field: _viewreference + */ + private boolean _has_viewreference; + + /** * Field _featuresList. */ private java.util.Vector _featuresList; @@ -256,6 +266,13 @@ public class JSeq implements java.io.Serializable } /** + */ + public void deleteViewreference() + { + this._has_viewreference = false; + } + + /** * Method enumerateFeatures. * * @return an Enumeration over all jalview.schemabinding.version2.Features @@ -549,6 +566,16 @@ public class JSeq implements java.io.Serializable } /** + * Returns the value of field 'viewreference'. + * + * @return the value of field 'Viewreference'. + */ + public boolean getViewreference() + { + return this._viewreference; + } + + /** * Method hasColour. * * @return true if at least one Colour has been added @@ -589,6 +616,16 @@ public class JSeq implements java.io.Serializable } /** + * Method hasViewreference. + * + * @return true if at least one Viewreference has been added + */ + public boolean hasViewreference() + { + return this._has_viewreference; + } + + /** * Returns the value of field 'hidden'. * * @return the value of field 'Hidden'. @@ -616,6 +653,16 @@ public class JSeq implements java.io.Serializable } /** + * Returns the value of field 'viewreference'. + * + * @return the value of field 'Viewreference'. + */ + public boolean isViewreference() + { + return this._viewreference; + } + + /** * * * @param out @@ -1004,6 +1051,18 @@ public class JSeq implements java.io.Serializable } /** + * Sets the value of field 'viewreference'. + * + * @param viewreference + * the value of field 'viewreference'. + */ + public void setViewreference(final boolean viewreference) + { + this._viewreference = viewreference; + this._has_viewreference = true; + } + + /** * Method unmarshal. * * @param reader diff --git a/src/jalview/schemabinding/version2/descriptors/AnnotationColoursDescriptor.java b/src/jalview/schemabinding/version2/descriptors/AnnotationColoursDescriptor.java index 1d2aad3..5739d90 100644 --- a/src/jalview/schemabinding/version2/descriptors/AnnotationColoursDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/AnnotationColoursDescriptor.java @@ -11,6 +11,8 @@ package jalview.schemabinding.version2.descriptors; //- Imported classes and packages -/ //---------------------------------/ +import jalview.schemabinding.version2.AnnotationColours; + /** * Class AnnotationColoursDescriptor. * diff --git a/src/jalview/schemabinding/version2/descriptors/FeaturesDescriptor.java b/src/jalview/schemabinding/version2/descriptors/FeaturesDescriptor.java index a7ffaba..107c06d 100644 --- a/src/jalview/schemabinding/version2/descriptors/FeaturesDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/FeaturesDescriptor.java @@ -11,6 +11,8 @@ package jalview.schemabinding.version2.descriptors; //- Imported classes and packages -/ //---------------------------------/ +import jalview.schemabinding.version2.Features; + /** * Class FeaturesDescriptor. * diff --git a/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java index 0f000bb..28f23b26 100644 --- a/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java @@ -334,6 +334,61 @@ public class JSeqDescriptor extends fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); + // -- _viewreference + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_viewreference", "viewreference", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JSeq target = (JSeq) object; + if (!target.hasViewreference()) + { + return null; + } + return (target.getViewreference() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteViewreference(); + return; + } + target.setViewreference(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _viewreference + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); // -- initialize element descriptors // -- _featuresList diff --git a/src/jalview/schemabinding/version2/descriptors/JalviewUserColoursDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JalviewUserColoursDescriptor.java index 77efa7e..d65de13 100644 --- a/src/jalview/schemabinding/version2/descriptors/JalviewUserColoursDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JalviewUserColoursDescriptor.java @@ -72,6 +72,7 @@ public class JalviewUserColoursDescriptor extends desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { + @Override public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException { @@ -79,6 +80,7 @@ public class JalviewUserColoursDescriptor extends return target.getSchemeName(); } + @Override public void setValue(java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { @@ -92,6 +94,7 @@ public class JalviewUserColoursDescriptor extends } } + @Override public java.lang.Object newInstance(java.lang.Object parent) { return null; @@ -119,6 +122,7 @@ public class JalviewUserColoursDescriptor extends desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { + @Override public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException { @@ -126,6 +130,7 @@ public class JalviewUserColoursDescriptor extends return target.getVersion(); } + @Override public void setValue(java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { @@ -139,6 +144,7 @@ public class JalviewUserColoursDescriptor extends } } + @Override public java.lang.Object newInstance(java.lang.Object parent) { return null; @@ -163,6 +169,7 @@ public class JalviewUserColoursDescriptor extends org.exolab.castor.xml.NodeType.Element); handler = new org.exolab.castor.xml.XMLFieldHandler() { + @Override public java.lang.Object getValue(java.lang.Object object) throws IllegalStateException { @@ -170,6 +177,7 @@ public class JalviewUserColoursDescriptor extends return target.getColour(); } + @Override public void setValue(java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { @@ -183,6 +191,7 @@ public class JalviewUserColoursDescriptor extends } } + @Override public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { @@ -196,6 +205,7 @@ public class JalviewUserColoursDescriptor extends } } + @Override public java.lang.Object newInstance(java.lang.Object parent) { return new Colour(); @@ -222,6 +232,7 @@ public class JalviewUserColoursDescriptor extends * * @return the access mode specified for this class. */ + @Override public org.exolab.castor.mapping.AccessMode getAccessMode() { return null; @@ -232,6 +243,7 @@ public class JalviewUserColoursDescriptor extends * * @return the identity field, null if this class has no identity. */ + @Override public org.exolab.castor.mapping.FieldDescriptor getIdentity() { return super.getIdentity(); @@ -242,6 +254,7 @@ public class JalviewUserColoursDescriptor extends * * @return the Java class represented by this descriptor. */ + @Override public java.lang.Class getJavaClass() { return jalview.schemabinding.version2.JalviewUserColours.class; @@ -252,6 +265,7 @@ public class JalviewUserColoursDescriptor extends * * @return the namespace prefix to use when marshaling as XML. */ + @Override public java.lang.String getNameSpacePrefix() { return _nsPrefix; @@ -262,6 +276,7 @@ public class JalviewUserColoursDescriptor extends * * @return the namespace URI used when marshaling and unmarshaling as XML. */ + @Override public java.lang.String getNameSpaceURI() { return _nsURI; @@ -273,6 +288,7 @@ public class JalviewUserColoursDescriptor extends * @return a specific validator for the class described by this * ClassDescriptor. */ + @Override public org.exolab.castor.xml.TypeValidator getValidator() { return this; @@ -283,6 +299,7 @@ public class JalviewUserColoursDescriptor extends * * @return the XML Name for the Class being described. */ + @Override public java.lang.String getXMLName() { return _xmlName; @@ -294,6 +311,7 @@ public class JalviewUserColoursDescriptor extends * @return true if XML schema definition of this Class is that of a global * element or element with anonymous type definition. */ + @Override public boolean isElementDefinition() { return _elementDefinition; diff --git a/src/jalview/schemabinding/version2/descriptors/UserColourSchemeDescriptor.java b/src/jalview/schemabinding/version2/descriptors/UserColourSchemeDescriptor.java index ece728a..df9ab07 100644 --- a/src/jalview/schemabinding/version2/descriptors/UserColourSchemeDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/UserColourSchemeDescriptor.java @@ -11,6 +11,8 @@ package jalview.schemabinding.version2.descriptors; //- Imported classes and packages -/ //---------------------------------/ +import jalview.schemabinding.version2.UserColourScheme; + /** * Class UserColourSchemeDescriptor. * diff --git a/src/jalview/schemabinding/version2/descriptors/VamsasModelDescriptor.java b/src/jalview/schemabinding/version2/descriptors/VamsasModelDescriptor.java index 86e6992..3e26611 100644 --- a/src/jalview/schemabinding/version2/descriptors/VamsasModelDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/VamsasModelDescriptor.java @@ -11,6 +11,8 @@ package jalview.schemabinding.version2.descriptors; //- Imported classes and packages -/ //---------------------------------/ +import jalview.schemabinding.version2.VamsasModel; + /** * Class VamsasModelDescriptor. * -- 1.7.10.2