From 65df62f4b048a1615d32ea2c3576082ad2b63af8 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 4 Apr 2006 09:29:54 +0000 Subject: [PATCH] Binding with descriptors --- src/jalview/schemabinding/version2/Alignment.java | 173 +++ .../version2/AlignmentDescriptor.java | 243 ++++ src/jalview/schemabinding/version2/Annotation.java | 432 ++++++ .../version2/AnnotationDescriptor.java | 371 +++++ .../schemabinding/version2/AnnotationElement.java | 306 +++++ .../version2/AnnotationElementDescriptor.java | 378 ++++++ src/jalview/schemabinding/version2/Colour.java | 173 +++ .../schemabinding/version2/ColourDescriptor.java | 243 ++++ src/jalview/schemabinding/version2/Feature.java | 331 +++++ .../schemabinding/version2/FeatureDescriptor.java | 398 ++++++ .../schemabinding/version2/FeatureSettings.java | 274 ++++ .../version2/FeatureSettingsDescriptor.java | 208 +++ src/jalview/schemabinding/version2/Features.java | 118 ++ .../schemabinding/version2/FeaturesDescriptor.java | 166 +++ src/jalview/schemabinding/version2/JGroup.java | 750 +++++++++++ .../schemabinding/version2/JGroupDescriptor.java | 614 +++++++++ src/jalview/schemabinding/version2/JSeq.java | 637 +++++++++ .../schemabinding/version2/JSeqDescriptor.java | 407 ++++++ .../schemabinding/version2/JalviewModel.java | 227 ++++ .../version2/JalviewModelDescriptor.java | 324 +++++ .../version2/JalviewModelSequence.java | 904 +++++++++++++ .../version2/JalviewModelSequenceDescriptor.java | 383 ++++++ .../schemabinding/version2/JalviewUserColours.java | 300 +++++ .../version2/JalviewUserColoursDescriptor.java | 244 ++++ src/jalview/schemabinding/version2/Pdbentry.java | 326 +++++ .../schemabinding/version2/PdbentryDescriptor.java | 279 ++++ .../schemabinding/version2/PdbentryItem.java | 197 +++ .../version2/PdbentryItemDescriptor.java | 208 +++ src/jalview/schemabinding/version2/Pdbids.java | 118 ++ .../schemabinding/version2/PdbidsDescriptor.java | 166 +++ src/jalview/schemabinding/version2/Property.java | 173 +++ .../schemabinding/version2/PropertyDescriptor.java | 246 ++++ src/jalview/schemabinding/version2/Sequence.java | 118 ++ .../schemabinding/version2/SequenceDescriptor.java | 166 +++ .../schemabinding/version2/SequenceSet.java | 504 +++++++ .../version2/SequenceSetDescriptor.java | 323 +++++ .../schemabinding/version2/SequenceType.java | 225 ++++ .../version2/SequenceTypeDescriptor.java | 325 +++++ src/jalview/schemabinding/version2/Setting.java | 253 ++++ .../schemabinding/version2/SettingDescriptor.java | 290 ++++ src/jalview/schemabinding/version2/Tree.java | 835 ++++++++++++ .../schemabinding/version2/TreeDescriptor.java | 777 +++++++++++ .../schemabinding/version2/UserColourScheme.java | 118 ++ .../version2/UserColourSchemeDescriptor.java | 166 +++ .../schemabinding/version2/UserColours.java | 173 +++ .../version2/UserColoursDescriptor.java | 245 ++++ src/jalview/schemabinding/version2/VAMSAS.java | 576 ++++++++ .../schemabinding/version2/VAMSASDescriptor.java | 282 ++++ .../schemabinding/version2/VamsasModel.java | 118 ++ .../version2/VamsasModelDescriptor.java | 166 +++ src/jalview/schemabinding/version2/Viewport.java | 1420 ++++++++++++++++++++ .../schemabinding/version2/ViewportDescriptor.java | 1221 +++++++++++++++++ 52 files changed, 18618 insertions(+) create mode 100755 src/jalview/schemabinding/version2/Alignment.java create mode 100755 src/jalview/schemabinding/version2/AlignmentDescriptor.java create mode 100755 src/jalview/schemabinding/version2/Annotation.java create mode 100755 src/jalview/schemabinding/version2/AnnotationDescriptor.java create mode 100755 src/jalview/schemabinding/version2/AnnotationElement.java create mode 100755 src/jalview/schemabinding/version2/AnnotationElementDescriptor.java create mode 100755 src/jalview/schemabinding/version2/Colour.java create mode 100755 src/jalview/schemabinding/version2/ColourDescriptor.java create mode 100755 src/jalview/schemabinding/version2/Feature.java create mode 100755 src/jalview/schemabinding/version2/FeatureDescriptor.java create mode 100755 src/jalview/schemabinding/version2/FeatureSettings.java create mode 100755 src/jalview/schemabinding/version2/FeatureSettingsDescriptor.java create mode 100755 src/jalview/schemabinding/version2/Features.java create mode 100755 src/jalview/schemabinding/version2/FeaturesDescriptor.java create mode 100755 src/jalview/schemabinding/version2/JGroup.java create mode 100755 src/jalview/schemabinding/version2/JGroupDescriptor.java create mode 100755 src/jalview/schemabinding/version2/JSeq.java create mode 100755 src/jalview/schemabinding/version2/JSeqDescriptor.java create mode 100755 src/jalview/schemabinding/version2/JalviewModel.java create mode 100755 src/jalview/schemabinding/version2/JalviewModelDescriptor.java create mode 100755 src/jalview/schemabinding/version2/JalviewModelSequence.java create mode 100755 src/jalview/schemabinding/version2/JalviewModelSequenceDescriptor.java create mode 100755 src/jalview/schemabinding/version2/JalviewUserColours.java create mode 100755 src/jalview/schemabinding/version2/JalviewUserColoursDescriptor.java create mode 100755 src/jalview/schemabinding/version2/Pdbentry.java create mode 100755 src/jalview/schemabinding/version2/PdbentryDescriptor.java create mode 100755 src/jalview/schemabinding/version2/PdbentryItem.java create mode 100755 src/jalview/schemabinding/version2/PdbentryItemDescriptor.java create mode 100755 src/jalview/schemabinding/version2/Pdbids.java create mode 100755 src/jalview/schemabinding/version2/PdbidsDescriptor.java create mode 100755 src/jalview/schemabinding/version2/Property.java create mode 100755 src/jalview/schemabinding/version2/PropertyDescriptor.java create mode 100755 src/jalview/schemabinding/version2/Sequence.java create mode 100755 src/jalview/schemabinding/version2/SequenceDescriptor.java create mode 100755 src/jalview/schemabinding/version2/SequenceSet.java create mode 100755 src/jalview/schemabinding/version2/SequenceSetDescriptor.java create mode 100755 src/jalview/schemabinding/version2/SequenceType.java create mode 100755 src/jalview/schemabinding/version2/SequenceTypeDescriptor.java create mode 100755 src/jalview/schemabinding/version2/Setting.java create mode 100755 src/jalview/schemabinding/version2/SettingDescriptor.java create mode 100755 src/jalview/schemabinding/version2/Tree.java create mode 100755 src/jalview/schemabinding/version2/TreeDescriptor.java create mode 100755 src/jalview/schemabinding/version2/UserColourScheme.java create mode 100755 src/jalview/schemabinding/version2/UserColourSchemeDescriptor.java create mode 100755 src/jalview/schemabinding/version2/UserColours.java create mode 100755 src/jalview/schemabinding/version2/UserColoursDescriptor.java create mode 100755 src/jalview/schemabinding/version2/VAMSAS.java create mode 100755 src/jalview/schemabinding/version2/VAMSASDescriptor.java create mode 100755 src/jalview/schemabinding/version2/VamsasModel.java create mode 100755 src/jalview/schemabinding/version2/VamsasModelDescriptor.java create mode 100755 src/jalview/schemabinding/version2/Viewport.java create mode 100755 src/jalview/schemabinding/version2/ViewportDescriptor.java diff --git a/src/jalview/schemabinding/version2/Alignment.java b/src/jalview/schemabinding/version2/Alignment.java new file mode 100755 index 0000000..3b9d53b --- /dev/null +++ b/src/jalview/schemabinding/version2/Alignment.java @@ -0,0 +1,173 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Alignment. + * + * @version $Revision$ $Date$ + */ +public class Alignment implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _annotation + */ + private jalview.schemabinding.version2.Annotation _annotation; + + /** + * Field _sequenceSet + */ + private jalview.schemabinding.version2.SequenceSet _sequenceSet; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Alignment() { + super(); + } //-- jalview.schemabinding.version2.Alignment() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Returns the value of field 'annotation'. + * + * @return Annotation + * @return the value of field 'annotation'. + */ + public jalview.schemabinding.version2.Annotation getAnnotation() + { + return this._annotation; + } //-- jalview.schemabinding.version2.Annotation getAnnotation() + + /** + * Returns the value of field 'sequenceSet'. + * + * @return SequenceSet + * @return the value of field 'sequenceSet'. + */ + public jalview.schemabinding.version2.SequenceSet getSequenceSet() + { + return this._sequenceSet; + } //-- jalview.schemabinding.version2.SequenceSet getSequenceSet() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'annotation'. + * + * @param annotation the value of field 'annotation'. + */ + public void setAnnotation(jalview.schemabinding.version2.Annotation annotation) + { + this._annotation = annotation; + } //-- void setAnnotation(jalview.schemabinding.version2.Annotation) + + /** + * Sets the value of field 'sequenceSet'. + * + * @param sequenceSet the value of field 'sequenceSet'. + */ + public void setSequenceSet(jalview.schemabinding.version2.SequenceSet sequenceSet) + { + this._sequenceSet = sequenceSet; + } //-- void setSequenceSet(jalview.schemabinding.version2.SequenceSet) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Alignment) Unmarshaller.unmarshal(jalview.schemabinding.version2.Alignment.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/AlignmentDescriptor.java b/src/jalview/schemabinding/version2/AlignmentDescriptor.java new file mode 100755 index 0000000..b285229 --- /dev/null +++ b/src/jalview/schemabinding/version2/AlignmentDescriptor.java @@ -0,0 +1,243 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class AlignmentDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AlignmentDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AlignmentDescriptor() { + super(); + nsURI = "www.vamsas.ac.uk/jalview/version2"; + xmlName = "Alignment"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- initialize element descriptors + + //-- _annotation + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Annotation.class, "_annotation", "Annotation", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + return target.getAnnotation(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.setAnnotation( (jalview.schemabinding.version2.Annotation) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.Annotation(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _annotation + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _sequenceSet + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.SequenceSet.class, "_sequenceSet", "SequenceSet", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + return target.getSequenceSet(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.setSequenceSet( (jalview.schemabinding.version2.SequenceSet) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.SequenceSet(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _sequenceSet + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.AlignmentDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Alignment.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/Annotation.java b/src/jalview/schemabinding/version2/Annotation.java new file mode 100755 index 0000000..54811be --- /dev/null +++ b/src/jalview/schemabinding/version2/Annotation.java @@ -0,0 +1,432 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import java.util.Enumeration; +import java.util.Vector; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Annotation. + * + * @version $Revision$ $Date$ + */ +public class Annotation implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _graph + */ + private boolean _graph; + + /** + * keeps track of state for field: _graph + */ + private boolean _has_graph; + + /** + * Field _graphType + */ + private int _graphType; + + /** + * keeps track of state for field: _graphType + */ + private boolean _has_graphType; + + /** + * Field _annotationElementList + */ + private java.util.Vector _annotationElementList; + + /** + * Field _label + */ + private java.lang.String _label; + + /** + * Field _description + */ + private java.lang.String _description; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Annotation() { + super(); + _annotationElementList = new Vector(); + } //-- jalview.schemabinding.version2.Annotation() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addAnnotationElement + * + * + * + * @param vAnnotationElement + */ + public void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + _annotationElementList.addElement(vAnnotationElement); + } //-- void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement) + + /** + * Method addAnnotationElement + * + * + * + * @param index + * @param vAnnotationElement + */ + public void addAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + _annotationElementList.insertElementAt(vAnnotationElement, index); + } //-- void addAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement) + + /** + * Method deleteGraph + * + */ + public void deleteGraph() + { + this._has_graph= false; + } //-- void deleteGraph() + + /** + * Method deleteGraphType + * + */ + public void deleteGraphType() + { + this._has_graphType= false; + } //-- void deleteGraphType() + + /** + * Method enumerateAnnotationElement + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAnnotationElement() + { + return _annotationElementList.elements(); + } //-- java.util.Enumeration enumerateAnnotationElement() + + /** + * Method getAnnotationElement + * + * + * + * @param index + * @return AnnotationElement + */ + public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _annotationElementList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index); + } //-- jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int) + + /** + * Method getAnnotationElement + * + * + * + * @return AnnotationElement + */ + public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement() + { + int size = _annotationElementList.size(); + jalview.schemabinding.version2.AnnotationElement[] mArray = new jalview.schemabinding.version2.AnnotationElement[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement() + + /** + * Method getAnnotationElementCount + * + * + * + * @return int + */ + public int getAnnotationElementCount() + { + return _annotationElementList.size(); + } //-- int getAnnotationElementCount() + + /** + * Returns the value of field 'description'. + * + * @return String + * @return the value of field 'description'. + */ + public java.lang.String getDescription() + { + return this._description; + } //-- java.lang.String getDescription() + + /** + * Returns the value of field 'graph'. + * + * @return boolean + * @return the value of field 'graph'. + */ + public boolean getGraph() + { + return this._graph; + } //-- boolean getGraph() + + /** + * Returns the value of field 'graphType'. + * + * @return int + * @return the value of field 'graphType'. + */ + public int getGraphType() + { + return this._graphType; + } //-- int getGraphType() + + /** + * Returns the value of field 'label'. + * + * @return String + * @return the value of field 'label'. + */ + public java.lang.String getLabel() + { + return this._label; + } //-- java.lang.String getLabel() + + /** + * Method hasGraph + * + * + * + * @return boolean + */ + public boolean hasGraph() + { + return this._has_graph; + } //-- boolean hasGraph() + + /** + * Method hasGraphType + * + * + * + * @return boolean + */ + public boolean hasGraphType() + { + return this._has_graphType; + } //-- boolean hasGraphType() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method removeAllAnnotationElement + * + */ + public void removeAllAnnotationElement() + { + _annotationElementList.removeAllElements(); + } //-- void removeAllAnnotationElement() + + /** + * Method removeAnnotationElement + * + * + * + * @param index + * @return AnnotationElement + */ + public jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int index) + { + java.lang.Object obj = _annotationElementList.elementAt(index); + _annotationElementList.removeElementAt(index); + return (jalview.schemabinding.version2.AnnotationElement) obj; + } //-- jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int) + + /** + * Method setAnnotationElement + * + * + * + * @param index + * @param vAnnotationElement + */ + public void setAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _annotationElementList.size())) { + throw new IndexOutOfBoundsException(); + } + _annotationElementList.setElementAt(vAnnotationElement, index); + } //-- void setAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement) + + /** + * Method setAnnotationElement + * + * + * + * @param annotationElementArray + */ + public void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement[] annotationElementArray) + { + //-- copy array + _annotationElementList.removeAllElements(); + for (int i = 0; i < annotationElementArray.length; i++) { + _annotationElementList.addElement(annotationElementArray[i]); + } + } //-- void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement) + + /** + * Sets the value of field 'description'. + * + * @param description the value of field 'description'. + */ + public void setDescription(java.lang.String description) + { + this._description = description; + } //-- void setDescription(java.lang.String) + + /** + * Sets the value of field 'graph'. + * + * @param graph the value of field 'graph'. + */ + public void setGraph(boolean graph) + { + this._graph = graph; + this._has_graph = true; + } //-- void setGraph(boolean) + + /** + * Sets the value of field 'graphType'. + * + * @param graphType the value of field 'graphType'. + */ + public void setGraphType(int graphType) + { + this._graphType = graphType; + this._has_graphType = true; + } //-- void setGraphType(int) + + /** + * Sets the value of field 'label'. + * + * @param label the value of field 'label'. + */ + public void setLabel(java.lang.String label) + { + this._label = label; + } //-- void setLabel(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/AnnotationDescriptor.java b/src/jalview/schemabinding/version2/AnnotationDescriptor.java new file mode 100755 index 0000000..d60b680 --- /dev/null +++ b/src/jalview/schemabinding/version2/AnnotationDescriptor.java @@ -0,0 +1,371 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class AnnotationDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AnnotationDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AnnotationDescriptor() { + super(); + nsURI = "www.vamsas.ac.uk/jalview/version2"; + xmlName = "Annotation"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _graph + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_graph", "graph", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if(!target.hasGraph()) + return null; + return (target.getGraph() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Annotation target = (Annotation) object; + // ignore null values for non optional primitives + if (value == null) return; + + target.setGraph( ((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.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _graph + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _graphType + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_graphType", "graphType", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if(!target.hasGraphType()) + return null; + return new java.lang.Integer(target.getGraphType()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteGraphType(); + return; + } + target.setGraphType( ((java.lang.Integer)value).intValue()); + } + 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: _graphType + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _annotationElementList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.AnnotationElement.class, "_annotationElementList", "annotationElement", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Annotation target = (Annotation) object; + return target.getAnnotationElement(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Annotation target = (Annotation) object; + target.addAnnotationElement( (jalview.schemabinding.version2.AnnotationElement) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.AnnotationElement(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _annotationElementList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _label + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_label", "label", org.exolab.castor.xml.NodeType.Element); + 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.getLabel(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Annotation target = (Annotation) object; + target.setLabel( (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); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _label + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _description + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element); + 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.getDescription(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Annotation target = (Annotation) object; + target.setDescription( (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); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _description + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.AnnotationDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Annotation.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/AnnotationElement.java b/src/jalview/schemabinding/version2/AnnotationElement.java new file mode 100755 index 0000000..8c91439 --- /dev/null +++ b/src/jalview/schemabinding/version2/AnnotationElement.java @@ -0,0 +1,306 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class AnnotationElement. + * + * @version $Revision$ $Date$ + */ +public class AnnotationElement implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _position + */ + private int _position; + + /** + * keeps track of state for field: _position + */ + private boolean _has_position; + + /** + * Field _displayCharacter + */ + private java.lang.String _displayCharacter; + + /** + * Field _description + */ + private java.lang.String _description; + + /** + * Field _secondaryStructure + */ + private java.lang.String _secondaryStructure; + + /** + * Field _value + */ + private float _value; + + /** + * keeps track of state for field: _value + */ + private boolean _has_value; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AnnotationElement() { + super(); + } //-- jalview.schemabinding.version2.AnnotationElement() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deletePosition + * + */ + public void deletePosition() + { + this._has_position= false; + } //-- void deletePosition() + + /** + * Method deleteValue + * + */ + public void deleteValue() + { + this._has_value= false; + } //-- void deleteValue() + + /** + * Returns the value of field 'description'. + * + * @return String + * @return the value of field 'description'. + */ + public java.lang.String getDescription() + { + return this._description; + } //-- java.lang.String getDescription() + + /** + * Returns the value of field 'displayCharacter'. + * + * @return String + * @return the value of field 'displayCharacter'. + */ + public java.lang.String getDisplayCharacter() + { + return this._displayCharacter; + } //-- java.lang.String getDisplayCharacter() + + /** + * Returns the value of field 'position'. + * + * @return int + * @return the value of field 'position'. + */ + public int getPosition() + { + return this._position; + } //-- int getPosition() + + /** + * Returns the value of field 'secondaryStructure'. + * + * @return String + * @return the value of field 'secondaryStructure'. + */ + public java.lang.String getSecondaryStructure() + { + return this._secondaryStructure; + } //-- java.lang.String getSecondaryStructure() + + /** + * Returns the value of field 'value'. + * + * @return float + * @return the value of field 'value'. + */ + public float getValue() + { + return this._value; + } //-- float getValue() + + /** + * Method hasPosition + * + * + * + * @return boolean + */ + public boolean hasPosition() + { + return this._has_position; + } //-- boolean hasPosition() + + /** + * Method hasValue + * + * + * + * @return boolean + */ + public boolean hasValue() + { + return this._has_value; + } //-- boolean hasValue() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'description'. + * + * @param description the value of field 'description'. + */ + public void setDescription(java.lang.String description) + { + this._description = description; + } //-- void setDescription(java.lang.String) + + /** + * Sets the value of field 'displayCharacter'. + * + * @param displayCharacter the value of field 'displayCharacter' + */ + public void setDisplayCharacter(java.lang.String displayCharacter) + { + this._displayCharacter = displayCharacter; + } //-- void setDisplayCharacter(java.lang.String) + + /** + * Sets the value of field 'position'. + * + * @param position the value of field 'position'. + */ + public void setPosition(int position) + { + this._position = position; + this._has_position = true; + } //-- void setPosition(int) + + /** + * Sets the value of field 'secondaryStructure'. + * + * @param secondaryStructure the value of field + * 'secondaryStructure'. + */ + public void setSecondaryStructure(java.lang.String secondaryStructure) + { + this._secondaryStructure = secondaryStructure; + } //-- void setSecondaryStructure(java.lang.String) + + /** + * Sets the value of field 'value'. + * + * @param value the value of field 'value'. + */ + public void setValue(float value) + { + this._value = value; + this._has_value = true; + } //-- void setValue(float) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.AnnotationElement) Unmarshaller.unmarshal(jalview.schemabinding.version2.AnnotationElement.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/AnnotationElementDescriptor.java b/src/jalview/schemabinding/version2/AnnotationElementDescriptor.java new file mode 100755 index 0000000..4034755 --- /dev/null +++ b/src/jalview/schemabinding/version2/AnnotationElementDescriptor.java @@ -0,0 +1,378 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class AnnotationElementDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AnnotationElementDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AnnotationElementDescriptor() { + super(); + nsURI = "www.vamsas.ac.uk/jalview/version2"; + xmlName = "annotationElement"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _position + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_position", "position", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + if(!target.hasPosition()) + return null; + return new java.lang.Integer(target.getPosition()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + // ignore null values for non optional primitives + if (value == null) return; + + target.setPosition( ((java.lang.Integer)value).intValue()); + } + 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.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _position + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _displayCharacter + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_displayCharacter", "displayCharacter", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + return target.getDisplayCharacter(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + target.setDisplayCharacter( (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); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _displayCharacter + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _description + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + return target.getDescription(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + target.setDescription( (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); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _description + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _secondaryStructure + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_secondaryStructure", "secondaryStructure", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + return target.getSecondaryStructure(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + target.setSecondaryStructure( (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); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _secondaryStructure + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setLength(1); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _value + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_value", "value", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + if(!target.hasValue()) + return null; + return new java.lang.Float(target.getValue()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + // ignore null values for non optional primitives + if (value == null) return; + + target.setValue( ((java.lang.Float)value).floatValue()); + } + 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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _value + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + FloatValidator typeValidator = new FloatValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.AnnotationElementDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.AnnotationElement.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/Colour.java b/src/jalview/schemabinding/version2/Colour.java new file mode 100755 index 0000000..bcc4642 --- /dev/null +++ b/src/jalview/schemabinding/version2/Colour.java @@ -0,0 +1,173 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Colour. + * + * @version $Revision$ $Date$ + */ +public class Colour implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _name + */ + private java.lang.String _name; + + /** + * Field _RGB + */ + private java.lang.String _RGB; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Colour() { + super(); + } //-- jalview.schemabinding.version2.Colour() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Returns the value of field 'name'. + * + * @return String + * @return the value of field 'name'. + */ + public java.lang.String getName() + { + return this._name; + } //-- java.lang.String getName() + + /** + * Returns the value of field 'RGB'. + * + * @return String + * @return the value of field 'RGB'. + */ + public java.lang.String getRGB() + { + return this._RGB; + } //-- java.lang.String getRGB() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'name'. + * + * @param name the value of field 'name'. + */ + public void setName(java.lang.String name) + { + this._name = name; + } //-- void setName(java.lang.String) + + /** + * Sets the value of field 'RGB'. + * + * @param RGB the value of field 'RGB'. + */ + public void setRGB(java.lang.String RGB) + { + this._RGB = RGB; + } //-- void setRGB(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Colour) Unmarshaller.unmarshal(jalview.schemabinding.version2.Colour.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/ColourDescriptor.java b/src/jalview/schemabinding/version2/ColourDescriptor.java new file mode 100755 index 0000000..7aa3a82 --- /dev/null +++ b/src/jalview/schemabinding/version2/ColourDescriptor.java @@ -0,0 +1,243 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class ColourDescriptor. + * + * @version $Revision$ $Date$ + */ +public class ColourDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public ColourDescriptor() { + super(); + xmlName = "colour"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _name + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "Name", 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 + { + Colour target = (Colour) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Colour target = (Colour) object; + target.setName( (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: _name + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _RGB + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_RGB", "RGB", 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 + { + Colour target = (Colour) object; + return target.getRGB(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Colour target = (Colour) object; + target.setRGB( (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); + desc.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _RGB + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } //-- jalview.schemabinding.version2.ColourDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Colour.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/Feature.java b/src/jalview/schemabinding/version2/Feature.java new file mode 100755 index 0000000..3c738bd --- /dev/null +++ b/src/jalview/schemabinding/version2/Feature.java @@ -0,0 +1,331 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Feature. + * + * @version $Revision$ $Date$ + */ +public class Feature implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _begin + */ + private int _begin; + + /** + * keeps track of state for field: _begin + */ + private boolean _has_begin; + + /** + * Field _end + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + /** + * Field _type + */ + private java.lang.String _type; + + /** + * Field _description + */ + private java.lang.String _description; + + /** + * Field _status + */ + private java.lang.String _status; + + /** + * Field _featureGroup + */ + private java.lang.String _featureGroup; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Feature() { + super(); + } //-- jalview.schemabinding.version2.Feature() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteBegin + * + */ + public void deleteBegin() + { + this._has_begin= false; + } //-- void deleteBegin() + + /** + * Method deleteEnd + * + */ + public void deleteEnd() + { + this._has_end= false; + } //-- void deleteEnd() + + /** + * Returns the value of field 'begin'. + * + * @return int + * @return the value of field 'begin'. + */ + public int getBegin() + { + return this._begin; + } //-- int getBegin() + + /** + * Returns the value of field 'description'. + * + * @return String + * @return the value of field 'description'. + */ + public java.lang.String getDescription() + { + return this._description; + } //-- java.lang.String getDescription() + + /** + * Returns the value of field 'end'. + * + * @return int + * @return the value of field 'end'. + */ + public int getEnd() + { + return this._end; + } //-- int getEnd() + + /** + * Returns the value of field 'featureGroup'. + * + * @return String + * @return the value of field 'featureGroup'. + */ + public java.lang.String getFeatureGroup() + { + return this._featureGroup; + } //-- java.lang.String getFeatureGroup() + + /** + * Returns the value of field 'status'. + * + * @return String + * @return the value of field 'status'. + */ + public java.lang.String getStatus() + { + return this._status; + } //-- java.lang.String getStatus() + + /** + * Returns the value of field 'type'. + * + * @return String + * @return the value of field 'type'. + */ + public java.lang.String getType() + { + return this._type; + } //-- java.lang.String getType() + + /** + * Method hasBegin + * + * + * + * @return boolean + */ + public boolean hasBegin() + { + return this._has_begin; + } //-- boolean hasBegin() + + /** + * Method hasEnd + * + * + * + * @return boolean + */ + public boolean hasEnd() + { + return this._has_end; + } //-- boolean hasEnd() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'begin'. + * + * @param begin the value of field 'begin'. + */ + public void setBegin(int begin) + { + this._begin = begin; + this._has_begin = true; + } //-- void setBegin(int) + + /** + * Sets the value of field 'description'. + * + * @param description the value of field 'description'. + */ + public void setDescription(java.lang.String description) + { + this._description = description; + } //-- void setDescription(java.lang.String) + + /** + * Sets the value of field 'end'. + * + * @param end the value of field 'end'. + */ + public void setEnd(int end) + { + this._end = end; + this._has_end = true; + } //-- void setEnd(int) + + /** + * Sets the value of field 'featureGroup'. + * + * @param featureGroup the value of field 'featureGroup'. + */ + public void setFeatureGroup(java.lang.String featureGroup) + { + this._featureGroup = featureGroup; + } //-- void setFeatureGroup(java.lang.String) + + /** + * Sets the value of field 'status'. + * + * @param status the value of field 'status'. + */ + public void setStatus(java.lang.String status) + { + this._status = status; + } //-- void setStatus(java.lang.String) + + /** + * Sets the value of field 'type'. + * + * @param type the value of field 'type'. + */ + public void setType(java.lang.String type) + { + this._type = type; + } //-- void setType(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Feature) Unmarshaller.unmarshal(jalview.schemabinding.version2.Feature.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/FeatureDescriptor.java b/src/jalview/schemabinding/version2/FeatureDescriptor.java new file mode 100755 index 0000000..ac172e8 --- /dev/null +++ b/src/jalview/schemabinding/version2/FeatureDescriptor.java @@ -0,0 +1,398 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class FeatureDescriptor. + * + * @version $Revision$ $Date$ + */ +public class FeatureDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public FeatureDescriptor() { + super(); + nsURI = "www.jalview.org"; + xmlName = "feature"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _begin + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_begin", "begin", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Feature target = (Feature) object; + if(!target.hasBegin()) + return null; + return new java.lang.Integer(target.getBegin()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Feature target = (Feature) object; + // ignore null values for non optional primitives + if (value == null) return; + + target.setBegin( ((java.lang.Integer)value).intValue()); + } + 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.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _begin + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _end + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Feature target = (Feature) object; + if(!target.hasEnd()) + return null; + return new java.lang.Integer(target.getEnd()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Feature target = (Feature) object; + // ignore null values for non optional primitives + if (value == null) return; + + target.setEnd( ((java.lang.Integer)value).intValue()); + } + 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.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _end + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _type + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", 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 + { + Feature target = (Feature) object; + return target.getType(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Feature target = (Feature) object; + target.setType( (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); + desc.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _type + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _description + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", 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 + { + Feature target = (Feature) object; + return target.getDescription(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Feature target = (Feature) object; + target.setDescription( (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: _description + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _status + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_status", "status", 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 + { + Feature target = (Feature) object; + return target.getStatus(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Feature target = (Feature) object; + target.setStatus( (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: _status + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _featureGroup + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_featureGroup", "featureGroup", 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 + { + Feature target = (Feature) object; + return target.getFeatureGroup(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Feature target = (Feature) object; + target.setFeatureGroup( (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: _featureGroup + 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 + + } //-- jalview.schemabinding.version2.FeatureDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Feature.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/FeatureSettings.java b/src/jalview/schemabinding/version2/FeatureSettings.java new file mode 100755 index 0000000..c20a83c --- /dev/null +++ b/src/jalview/schemabinding/version2/FeatureSettings.java @@ -0,0 +1,274 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import java.util.Enumeration; +import java.util.Vector; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class FeatureSettings. + * + * @version $Revision$ $Date$ + */ +public class FeatureSettings implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _settingList + */ + private java.util.Vector _settingList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public FeatureSettings() { + super(); + _settingList = new Vector(); + } //-- jalview.schemabinding.version2.FeatureSettings() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addSetting + * + * + * + * @param vSetting + */ + public void addSetting(jalview.schemabinding.version2.Setting vSetting) + throws java.lang.IndexOutOfBoundsException + { + _settingList.addElement(vSetting); + } //-- void addSetting(jalview.schemabinding.version2.Setting) + + /** + * Method addSetting + * + * + * + * @param index + * @param vSetting + */ + public void addSetting(int index, jalview.schemabinding.version2.Setting vSetting) + throws java.lang.IndexOutOfBoundsException + { + _settingList.insertElementAt(vSetting, index); + } //-- void addSetting(int, jalview.schemabinding.version2.Setting) + + /** + * Method enumerateSetting + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateSetting() + { + return _settingList.elements(); + } //-- java.util.Enumeration enumerateSetting() + + /** + * Method getSetting + * + * + * + * @param index + * @return Setting + */ + public jalview.schemabinding.version2.Setting getSetting(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _settingList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.Setting) _settingList.elementAt(index); + } //-- jalview.schemabinding.version2.Setting getSetting(int) + + /** + * Method getSetting + * + * + * + * @return Setting + */ + public jalview.schemabinding.version2.Setting[] getSetting() + { + int size = _settingList.size(); + jalview.schemabinding.version2.Setting[] mArray = new jalview.schemabinding.version2.Setting[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.Setting) _settingList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.Setting[] getSetting() + + /** + * Method getSettingCount + * + * + * + * @return int + */ + public int getSettingCount() + { + return _settingList.size(); + } //-- int getSettingCount() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method removeAllSetting + * + */ + public void removeAllSetting() + { + _settingList.removeAllElements(); + } //-- void removeAllSetting() + + /** + * Method removeSetting + * + * + * + * @param index + * @return Setting + */ + public jalview.schemabinding.version2.Setting removeSetting(int index) + { + java.lang.Object obj = _settingList.elementAt(index); + _settingList.removeElementAt(index); + return (jalview.schemabinding.version2.Setting) obj; + } //-- jalview.schemabinding.version2.Setting removeSetting(int) + + /** + * Method setSetting + * + * + * + * @param index + * @param vSetting + */ + public void setSetting(int index, jalview.schemabinding.version2.Setting vSetting) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _settingList.size())) { + throw new IndexOutOfBoundsException(); + } + _settingList.setElementAt(vSetting, index); + } //-- void setSetting(int, jalview.schemabinding.version2.Setting) + + /** + * Method setSetting + * + * + * + * @param settingArray + */ + public void setSetting(jalview.schemabinding.version2.Setting[] settingArray) + { + //-- copy array + _settingList.removeAllElements(); + for (int i = 0; i < settingArray.length; i++) { + _settingList.addElement(settingArray[i]); + } + } //-- void setSetting(jalview.schemabinding.version2.Setting) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.FeatureSettings) Unmarshaller.unmarshal(jalview.schemabinding.version2.FeatureSettings.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/FeatureSettingsDescriptor.java b/src/jalview/schemabinding/version2/FeatureSettingsDescriptor.java new file mode 100755 index 0000000..219037e --- /dev/null +++ b/src/jalview/schemabinding/version2/FeatureSettingsDescriptor.java @@ -0,0 +1,208 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class FeatureSettingsDescriptor. + * + * @version $Revision$ $Date$ + */ +public class FeatureSettingsDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public FeatureSettingsDescriptor() { + super(); + nsURI = "www.jalview.org"; + xmlName = "FeatureSettings"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- initialize element descriptors + + //-- _settingList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Setting.class, "_settingList", "setting", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + FeatureSettings target = (FeatureSettings) object; + return target.getSetting(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + FeatureSettings target = (FeatureSettings) object; + target.addSetting( (jalview.schemabinding.version2.Setting) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.Setting(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _settingList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.FeatureSettingsDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.FeatureSettings.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/Features.java b/src/jalview/schemabinding/version2/Features.java new file mode 100755 index 0000000..72321c6 --- /dev/null +++ b/src/jalview/schemabinding/version2/Features.java @@ -0,0 +1,118 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Features. + * + * @version $Revision$ $Date$ + */ +public class Features extends Feature +implements java.io.Serializable +{ + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Features() { + super(); + } //-- jalview.schemabinding.version2.Features() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Features) Unmarshaller.unmarshal(jalview.schemabinding.version2.Features.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/FeaturesDescriptor.java b/src/jalview/schemabinding/version2/FeaturesDescriptor.java new file mode 100755 index 0000000..5eea818 --- /dev/null +++ b/src/jalview/schemabinding/version2/FeaturesDescriptor.java @@ -0,0 +1,166 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class FeaturesDescriptor. + * + * @version $Revision$ $Date$ + */ +public class FeaturesDescriptor extends FeatureDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public FeaturesDescriptor() { + super(); + setExtendsWithoutFlatten(new FeatureDescriptor()); + nsURI = "www.jalview.org"; + xmlName = "features"; + } //-- jalview.schemabinding.version2.FeaturesDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return super.getExtends(); + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + if (identity == null) + return super.getIdentity(); + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Features.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/JGroup.java b/src/jalview/schemabinding/version2/JGroup.java new file mode 100755 index 0000000..f3fe3e9 --- /dev/null +++ b/src/jalview/schemabinding/version2/JGroup.java @@ -0,0 +1,750 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import java.util.Enumeration; +import java.util.Vector; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class JGroup. + * + * @version $Revision$ $Date$ + */ +public class JGroup implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _start + */ + private int _start; + + /** + * keeps track of state for field: _start + */ + private boolean _has_start; + + /** + * Field _end + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + /** + * Field _name + */ + private java.lang.String _name; + + /** + * Field _colour + */ + private java.lang.String _colour; + + /** + * Field _consThreshold + */ + private int _consThreshold; + + /** + * keeps track of state for field: _consThreshold + */ + private boolean _has_consThreshold; + + /** + * Field _pidThreshold + */ + private int _pidThreshold; + + /** + * keeps track of state for field: _pidThreshold + */ + private boolean _has_pidThreshold; + + /** + * Field _outlineColour + */ + private int _outlineColour; + + /** + * keeps track of state for field: _outlineColour + */ + private boolean _has_outlineColour; + + /** + * Field _displayBoxes + */ + private boolean _displayBoxes; + + /** + * keeps track of state for field: _displayBoxes + */ + private boolean _has_displayBoxes; + + /** + * Field _displayText + */ + private boolean _displayText; + + /** + * keeps track of state for field: _displayText + */ + private boolean _has_displayText; + + /** + * Field _colourText + */ + private boolean _colourText; + + /** + * keeps track of state for field: _colourText + */ + private boolean _has_colourText; + + /** + * Field _seqList + */ + private java.util.Vector _seqList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public JGroup() { + super(); + _seqList = new Vector(); + } //-- jalview.schemabinding.version2.JGroup() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addSeq + * + * + * + * @param vSeq + */ + public void addSeq(int vSeq) + throws java.lang.IndexOutOfBoundsException + { + _seqList.addElement(new java.lang.Integer(vSeq)); + } //-- void addSeq(int) + + /** + * Method addSeq + * + * + * + * @param index + * @param vSeq + */ + public void addSeq(int index, int vSeq) + throws java.lang.IndexOutOfBoundsException + { + _seqList.insertElementAt(new java.lang.Integer(vSeq), index); + } //-- void addSeq(int, int) + + /** + * Method deleteColourText + * + */ + public void deleteColourText() + { + this._has_colourText= false; + } //-- void deleteColourText() + + /** + * Method deleteConsThreshold + * + */ + public void deleteConsThreshold() + { + this._has_consThreshold= false; + } //-- void deleteConsThreshold() + + /** + * Method deleteDisplayBoxes + * + */ + public void deleteDisplayBoxes() + { + this._has_displayBoxes= false; + } //-- void deleteDisplayBoxes() + + /** + * Method deleteDisplayText + * + */ + public void deleteDisplayText() + { + this._has_displayText= false; + } //-- void deleteDisplayText() + + /** + * Method deleteEnd + * + */ + public void deleteEnd() + { + this._has_end= false; + } //-- void deleteEnd() + + /** + * Method deleteOutlineColour + * + */ + public void deleteOutlineColour() + { + this._has_outlineColour= false; + } //-- void deleteOutlineColour() + + /** + * Method deletePidThreshold + * + */ + public void deletePidThreshold() + { + this._has_pidThreshold= false; + } //-- void deletePidThreshold() + + /** + * Method deleteStart + * + */ + public void deleteStart() + { + this._has_start= false; + } //-- void deleteStart() + + /** + * Method enumerateSeq + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateSeq() + { + return _seqList.elements(); + } //-- java.util.Enumeration enumerateSeq() + + /** + * Returns the value of field 'colour'. + * + * @return String + * @return the value of field 'colour'. + */ + public java.lang.String getColour() + { + return this._colour; + } //-- java.lang.String getColour() + + /** + * Returns the value of field 'colourText'. + * + * @return boolean + * @return the value of field 'colourText'. + */ + public boolean getColourText() + { + return this._colourText; + } //-- boolean getColourText() + + /** + * Returns the value of field 'consThreshold'. + * + * @return int + * @return the value of field 'consThreshold'. + */ + public int getConsThreshold() + { + return this._consThreshold; + } //-- int getConsThreshold() + + /** + * Returns the value of field 'displayBoxes'. + * + * @return boolean + * @return the value of field 'displayBoxes'. + */ + public boolean getDisplayBoxes() + { + return this._displayBoxes; + } //-- boolean getDisplayBoxes() + + /** + * Returns the value of field 'displayText'. + * + * @return boolean + * @return the value of field 'displayText'. + */ + public boolean getDisplayText() + { + return this._displayText; + } //-- boolean getDisplayText() + + /** + * Returns the value of field 'end'. + * + * @return int + * @return the value of field 'end'. + */ + public int getEnd() + { + return this._end; + } //-- int getEnd() + + /** + * Returns the value of field 'name'. + * + * @return String + * @return the value of field 'name'. + */ + public java.lang.String getName() + { + return this._name; + } //-- java.lang.String getName() + + /** + * Returns the value of field 'outlineColour'. + * + * @return int + * @return the value of field 'outlineColour'. + */ + public int getOutlineColour() + { + return this._outlineColour; + } //-- int getOutlineColour() + + /** + * Returns the value of field 'pidThreshold'. + * + * @return int + * @return the value of field 'pidThreshold'. + */ + public int getPidThreshold() + { + return this._pidThreshold; + } //-- int getPidThreshold() + + /** + * Method getSeq + * + * + * + * @param index + * @return int + */ + public int getSeq(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _seqList.size())) { + throw new IndexOutOfBoundsException(); + } + + return ((java.lang.Integer)_seqList.elementAt(index)).intValue(); + } //-- int getSeq(int) + + /** + * Method getSeq + * + * + * + * @return int + */ + public int[] getSeq() + { + int size = _seqList.size(); + int[] mArray = new int[size]; + for (int index = 0; index < size; index++) { + mArray[index] = ((java.lang.Integer)_seqList.elementAt(index)).intValue(); + } + return mArray; + } //-- int[] getSeq() + + /** + * Method getSeqCount + * + * + * + * @return int + */ + public int getSeqCount() + { + return _seqList.size(); + } //-- int getSeqCount() + + /** + * Returns the value of field 'start'. + * + * @return int + * @return the value of field 'start'. + */ + public int getStart() + { + return this._start; + } //-- int getStart() + + /** + * Method hasColourText + * + * + * + * @return boolean + */ + public boolean hasColourText() + { + return this._has_colourText; + } //-- boolean hasColourText() + + /** + * Method hasConsThreshold + * + * + * + * @return boolean + */ + public boolean hasConsThreshold() + { + return this._has_consThreshold; + } //-- boolean hasConsThreshold() + + /** + * Method hasDisplayBoxes + * + * + * + * @return boolean + */ + public boolean hasDisplayBoxes() + { + return this._has_displayBoxes; + } //-- boolean hasDisplayBoxes() + + /** + * Method hasDisplayText + * + * + * + * @return boolean + */ + public boolean hasDisplayText() + { + return this._has_displayText; + } //-- boolean hasDisplayText() + + /** + * Method hasEnd + * + * + * + * @return boolean + */ + public boolean hasEnd() + { + return this._has_end; + } //-- boolean hasEnd() + + /** + * Method hasOutlineColour + * + * + * + * @return boolean + */ + public boolean hasOutlineColour() + { + return this._has_outlineColour; + } //-- boolean hasOutlineColour() + + /** + * Method hasPidThreshold + * + * + * + * @return boolean + */ + public boolean hasPidThreshold() + { + return this._has_pidThreshold; + } //-- boolean hasPidThreshold() + + /** + * Method hasStart + * + * + * + * @return boolean + */ + public boolean hasStart() + { + return this._has_start; + } //-- boolean hasStart() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method removeAllSeq + * + */ + public void removeAllSeq() + { + _seqList.removeAllElements(); + } //-- void removeAllSeq() + + /** + * Method removeSeq + * + * + * + * @param index + * @return int + */ + public int removeSeq(int index) + { + java.lang.Object obj = _seqList.elementAt(index); + _seqList.removeElementAt(index); + return ((java.lang.Integer)obj).intValue(); + } //-- int removeSeq(int) + + /** + * Sets the value of field 'colour'. + * + * @param colour the value of field 'colour'. + */ + public void setColour(java.lang.String colour) + { + this._colour = colour; + } //-- void setColour(java.lang.String) + + /** + * Sets the value of field 'colourText'. + * + * @param colourText the value of field 'colourText'. + */ + public void setColourText(boolean colourText) + { + this._colourText = colourText; + this._has_colourText = true; + } //-- void setColourText(boolean) + + /** + * Sets the value of field 'consThreshold'. + * + * @param consThreshold the value of field 'consThreshold'. + */ + public void setConsThreshold(int consThreshold) + { + this._consThreshold = consThreshold; + this._has_consThreshold = true; + } //-- void setConsThreshold(int) + + /** + * Sets the value of field 'displayBoxes'. + * + * @param displayBoxes the value of field 'displayBoxes'. + */ + public void setDisplayBoxes(boolean displayBoxes) + { + this._displayBoxes = displayBoxes; + this._has_displayBoxes = true; + } //-- void setDisplayBoxes(boolean) + + /** + * Sets the value of field 'displayText'. + * + * @param displayText the value of field 'displayText'. + */ + public void setDisplayText(boolean displayText) + { + this._displayText = displayText; + this._has_displayText = true; + } //-- void setDisplayText(boolean) + + /** + * Sets the value of field 'end'. + * + * @param end the value of field 'end'. + */ + public void setEnd(int end) + { + this._end = end; + this._has_end = true; + } //-- void setEnd(int) + + /** + * Sets the value of field 'name'. + * + * @param name the value of field 'name'. + */ + public void setName(java.lang.String name) + { + this._name = name; + } //-- void setName(java.lang.String) + + /** + * Sets the value of field 'outlineColour'. + * + * @param outlineColour the value of field 'outlineColour'. + */ + public void setOutlineColour(int outlineColour) + { + this._outlineColour = outlineColour; + this._has_outlineColour = true; + } //-- void setOutlineColour(int) + + /** + * Sets the value of field 'pidThreshold'. + * + * @param pidThreshold the value of field 'pidThreshold'. + */ + public void setPidThreshold(int pidThreshold) + { + this._pidThreshold = pidThreshold; + this._has_pidThreshold = true; + } //-- void setPidThreshold(int) + + /** + * Method setSeq + * + * + * + * @param index + * @param vSeq + */ + public void setSeq(int index, int vSeq) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _seqList.size())) { + throw new IndexOutOfBoundsException(); + } + _seqList.setElementAt(new java.lang.Integer(vSeq), index); + } //-- void setSeq(int, int) + + /** + * Method setSeq + * + * + * + * @param seqArray + */ + public void setSeq(int[] seqArray) + { + //-- copy array + _seqList.removeAllElements(); + for (int i = 0; i < seqArray.length; i++) { + _seqList.addElement(new java.lang.Integer(seqArray[i])); + } + } //-- void setSeq(int) + + /** + * Sets the value of field 'start'. + * + * @param start the value of field 'start'. + */ + public void setStart(int start) + { + this._start = start; + this._has_start = true; + } //-- void setStart(int) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.JGroup) Unmarshaller.unmarshal(jalview.schemabinding.version2.JGroup.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/JGroupDescriptor.java b/src/jalview/schemabinding/version2/JGroupDescriptor.java new file mode 100755 index 0000000..231c631 --- /dev/null +++ b/src/jalview/schemabinding/version2/JGroupDescriptor.java @@ -0,0 +1,614 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class JGroupDescriptor. + * + * @version $Revision$ $Date$ + */ +public class JGroupDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public JGroupDescriptor() { + super(); + nsURI = "www.jalview.org"; + xmlName = "JGroup"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _start + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if(!target.hasStart()) + return null; + return new java.lang.Integer(target.getStart()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteStart(); + return; + } + target.setStart( ((java.lang.Integer)value).intValue()); + } + 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: _start + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _end + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if(!target.hasEnd()) + return null; + return new java.lang.Integer(target.getEnd()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteEnd(); + return; + } + target.setEnd( ((java.lang.Integer)value).intValue()); + } + 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: _end + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _name + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", 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 + { + JGroup target = (JGroup) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JGroup target = (JGroup) object; + target.setName( (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: _name + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _colour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_colour", "colour", 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 + { + JGroup target = (JGroup) object; + return target.getColour(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JGroup target = (JGroup) object; + target.setColour( (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: _colour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _consThreshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_consThreshold", "consThreshold", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if(!target.hasConsThreshold()) + return null; + return new java.lang.Integer(target.getConsThreshold()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteConsThreshold(); + return; + } + target.setConsThreshold( ((java.lang.Integer)value).intValue()); + } + 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: _consThreshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _pidThreshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_pidThreshold", "pidThreshold", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if(!target.hasPidThreshold()) + return null; + return new java.lang.Integer(target.getPidThreshold()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deletePidThreshold(); + return; + } + target.setPidThreshold( ((java.lang.Integer)value).intValue()); + } + 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: _pidThreshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _outlineColour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_outlineColour", "outlineColour", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if(!target.hasOutlineColour()) + return null; + return new java.lang.Integer(target.getOutlineColour()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteOutlineColour(); + return; + } + target.setOutlineColour( ((java.lang.Integer)value).intValue()); + } + 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: _outlineColour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _displayBoxes + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_displayBoxes", "displayBoxes", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if(!target.hasDisplayBoxes()) + return null; + return (target.getDisplayBoxes() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteDisplayBoxes(); + return; + } + target.setDisplayBoxes( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _displayBoxes + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _displayText + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_displayText", "displayText", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if(!target.hasDisplayText()) + return null; + return (target.getDisplayText() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteDisplayText(); + return; + } + target.setDisplayText( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _displayText + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _colourText + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_colourText", "colourText", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if(!target.hasColourText()) + return null; + return (target.getColourText() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteColourText(); + return; + } + target.setColourText( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _colourText + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _seqList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_seqList", "seq", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JGroup target = (JGroup) object; + return target.getSeq(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JGroup target = (JGroup) object; + // ignore null values for non optional primitives + if (value == null) return; + + target.addSeq( ((java.lang.Integer)value).intValue()); + } + 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.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _seqList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.JGroupDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.JGroup.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/JSeq.java b/src/jalview/schemabinding/version2/JSeq.java new file mode 100755 index 0000000..0d8dc08 --- /dev/null +++ b/src/jalview/schemabinding/version2/JSeq.java @@ -0,0 +1,637 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import java.util.Enumeration; +import java.util.Vector; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class JSeq. + * + * @version $Revision$ $Date$ + */ +public class JSeq implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _colour + */ + private int _colour; + + /** + * keeps track of state for field: _colour + */ + private boolean _has_colour; + + /** + * Field _start + */ + private int _start; + + /** + * keeps track of state for field: _start + */ + private boolean _has_start; + + /** + * Field _end + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + /** + * Field _id + */ + private int _id; + + /** + * keeps track of state for field: _id + */ + private boolean _has_id; + + /** + * Field _featuresList + */ + private java.util.Vector _featuresList; + + /** + * Field _pdbidsList + */ + private java.util.Vector _pdbidsList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public JSeq() { + super(); + _featuresList = new Vector(); + _pdbidsList = new Vector(); + } //-- jalview.schemabinding.version2.JSeq() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addFeatures + * + * + * + * @param vFeatures + */ + public void addFeatures(jalview.schemabinding.version2.Features vFeatures) + throws java.lang.IndexOutOfBoundsException + { + _featuresList.addElement(vFeatures); + } //-- void addFeatures(jalview.schemabinding.version2.Features) + + /** + * Method addFeatures + * + * + * + * @param index + * @param vFeatures + */ + public void addFeatures(int index, jalview.schemabinding.version2.Features vFeatures) + throws java.lang.IndexOutOfBoundsException + { + _featuresList.insertElementAt(vFeatures, index); + } //-- void addFeatures(int, jalview.schemabinding.version2.Features) + + /** + * Method addPdbids + * + * + * + * @param vPdbids + */ + public void addPdbids(jalview.schemabinding.version2.Pdbids vPdbids) + throws java.lang.IndexOutOfBoundsException + { + _pdbidsList.addElement(vPdbids); + } //-- void addPdbids(jalview.schemabinding.version2.Pdbids) + + /** + * Method addPdbids + * + * + * + * @param index + * @param vPdbids + */ + public void addPdbids(int index, jalview.schemabinding.version2.Pdbids vPdbids) + throws java.lang.IndexOutOfBoundsException + { + _pdbidsList.insertElementAt(vPdbids, index); + } //-- void addPdbids(int, jalview.schemabinding.version2.Pdbids) + + /** + * Method deleteColour + * + */ + public void deleteColour() + { + this._has_colour= false; + } //-- void deleteColour() + + /** + * Method deleteEnd + * + */ + public void deleteEnd() + { + this._has_end= false; + } //-- void deleteEnd() + + /** + * Method deleteId + * + */ + public void deleteId() + { + this._has_id= false; + } //-- void deleteId() + + /** + * Method deleteStart + * + */ + public void deleteStart() + { + this._has_start= false; + } //-- void deleteStart() + + /** + * Method enumerateFeatures + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateFeatures() + { + return _featuresList.elements(); + } //-- java.util.Enumeration enumerateFeatures() + + /** + * Method enumeratePdbids + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumeratePdbids() + { + return _pdbidsList.elements(); + } //-- java.util.Enumeration enumeratePdbids() + + /** + * Returns the value of field 'colour'. + * + * @return int + * @return the value of field 'colour'. + */ + public int getColour() + { + return this._colour; + } //-- int getColour() + + /** + * Returns the value of field 'end'. + * + * @return int + * @return the value of field 'end'. + */ + public int getEnd() + { + return this._end; + } //-- int getEnd() + + /** + * Method getFeatures + * + * + * + * @param index + * @return Features + */ + public jalview.schemabinding.version2.Features getFeatures(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _featuresList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.Features) _featuresList.elementAt(index); + } //-- jalview.schemabinding.version2.Features getFeatures(int) + + /** + * Method getFeatures + * + * + * + * @return Features + */ + public jalview.schemabinding.version2.Features[] getFeatures() + { + int size = _featuresList.size(); + jalview.schemabinding.version2.Features[] mArray = new jalview.schemabinding.version2.Features[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.Features) _featuresList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.Features[] getFeatures() + + /** + * Method getFeaturesCount + * + * + * + * @return int + */ + public int getFeaturesCount() + { + return _featuresList.size(); + } //-- int getFeaturesCount() + + /** + * Returns the value of field 'id'. + * + * @return int + * @return the value of field 'id'. + */ + public int getId() + { + return this._id; + } //-- int getId() + + /** + * Method getPdbids + * + * + * + * @param index + * @return Pdbids + */ + public jalview.schemabinding.version2.Pdbids getPdbids(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _pdbidsList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.Pdbids) _pdbidsList.elementAt(index); + } //-- jalview.schemabinding.version2.Pdbids getPdbids(int) + + /** + * Method getPdbids + * + * + * + * @return Pdbids + */ + public jalview.schemabinding.version2.Pdbids[] getPdbids() + { + int size = _pdbidsList.size(); + jalview.schemabinding.version2.Pdbids[] mArray = new jalview.schemabinding.version2.Pdbids[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.Pdbids) _pdbidsList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.Pdbids[] getPdbids() + + /** + * Method getPdbidsCount + * + * + * + * @return int + */ + public int getPdbidsCount() + { + return _pdbidsList.size(); + } //-- int getPdbidsCount() + + /** + * Returns the value of field 'start'. + * + * @return int + * @return the value of field 'start'. + */ + public int getStart() + { + return this._start; + } //-- int getStart() + + /** + * Method hasColour + * + * + * + * @return boolean + */ + public boolean hasColour() + { + return this._has_colour; + } //-- boolean hasColour() + + /** + * Method hasEnd + * + * + * + * @return boolean + */ + public boolean hasEnd() + { + return this._has_end; + } //-- boolean hasEnd() + + /** + * Method hasId + * + * + * + * @return boolean + */ + public boolean hasId() + { + return this._has_id; + } //-- boolean hasId() + + /** + * Method hasStart + * + * + * + * @return boolean + */ + public boolean hasStart() + { + return this._has_start; + } //-- boolean hasStart() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method removeAllFeatures + * + */ + public void removeAllFeatures() + { + _featuresList.removeAllElements(); + } //-- void removeAllFeatures() + + /** + * Method removeAllPdbids + * + */ + public void removeAllPdbids() + { + _pdbidsList.removeAllElements(); + } //-- void removeAllPdbids() + + /** + * Method removeFeatures + * + * + * + * @param index + * @return Features + */ + public jalview.schemabinding.version2.Features removeFeatures(int index) + { + java.lang.Object obj = _featuresList.elementAt(index); + _featuresList.removeElementAt(index); + return (jalview.schemabinding.version2.Features) obj; + } //-- jalview.schemabinding.version2.Features removeFeatures(int) + + /** + * Method removePdbids + * + * + * + * @param index + * @return Pdbids + */ + public jalview.schemabinding.version2.Pdbids removePdbids(int index) + { + java.lang.Object obj = _pdbidsList.elementAt(index); + _pdbidsList.removeElementAt(index); + return (jalview.schemabinding.version2.Pdbids) obj; + } //-- jalview.schemabinding.version2.Pdbids removePdbids(int) + + /** + * Sets the value of field 'colour'. + * + * @param colour the value of field 'colour'. + */ + public void setColour(int colour) + { + this._colour = colour; + this._has_colour = true; + } //-- void setColour(int) + + /** + * Sets the value of field 'end'. + * + * @param end the value of field 'end'. + */ + public void setEnd(int end) + { + this._end = end; + this._has_end = true; + } //-- void setEnd(int) + + /** + * Method setFeatures + * + * + * + * @param index + * @param vFeatures + */ + public void setFeatures(int index, jalview.schemabinding.version2.Features vFeatures) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _featuresList.size())) { + throw new IndexOutOfBoundsException(); + } + _featuresList.setElementAt(vFeatures, index); + } //-- void setFeatures(int, jalview.schemabinding.version2.Features) + + /** + * Method setFeatures + * + * + * + * @param featuresArray + */ + public void setFeatures(jalview.schemabinding.version2.Features[] featuresArray) + { + //-- copy array + _featuresList.removeAllElements(); + for (int i = 0; i < featuresArray.length; i++) { + _featuresList.addElement(featuresArray[i]); + } + } //-- void setFeatures(jalview.schemabinding.version2.Features) + + /** + * Sets the value of field 'id'. + * + * @param id the value of field 'id'. + */ + public void setId(int id) + { + this._id = id; + this._has_id = true; + } //-- void setId(int) + + /** + * Method setPdbids + * + * + * + * @param index + * @param vPdbids + */ + public void setPdbids(int index, jalview.schemabinding.version2.Pdbids vPdbids) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _pdbidsList.size())) { + throw new IndexOutOfBoundsException(); + } + _pdbidsList.setElementAt(vPdbids, index); + } //-- void setPdbids(int, jalview.schemabinding.version2.Pdbids) + + /** + * Method setPdbids + * + * + * + * @param pdbidsArray + */ + public void setPdbids(jalview.schemabinding.version2.Pdbids[] pdbidsArray) + { + //-- copy array + _pdbidsList.removeAllElements(); + for (int i = 0; i < pdbidsArray.length; i++) { + _pdbidsList.addElement(pdbidsArray[i]); + } + } //-- void setPdbids(jalview.schemabinding.version2.Pdbids) + + /** + * Sets the value of field 'start'. + * + * @param start the value of field 'start'. + */ + public void setStart(int start) + { + this._start = start; + this._has_start = true; + } //-- void setStart(int) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.JSeq) Unmarshaller.unmarshal(jalview.schemabinding.version2.JSeq.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/JSeqDescriptor.java b/src/jalview/schemabinding/version2/JSeqDescriptor.java new file mode 100755 index 0000000..f19b91c --- /dev/null +++ b/src/jalview/schemabinding/version2/JSeqDescriptor.java @@ -0,0 +1,407 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class JSeqDescriptor. + * + * @version $Revision$ $Date$ + */ +public class JSeqDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public JSeqDescriptor() { + super(); + nsURI = "www.jalview.org"; + xmlName = "JSeq"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _colour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_colour", "colour", 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.hasColour()) + return null; + return new java.lang.Integer(target.getColour()); + } + 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.deleteColour(); + return; + } + target.setColour( ((java.lang.Integer)value).intValue()); + } + 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: _colour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _start + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", 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.hasStart()) + return null; + return new java.lang.Integer(target.getStart()); + } + 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.setStart( ((java.lang.Integer)value).intValue()); + } + 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.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _start + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _end + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", 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.hasEnd()) + return null; + return new java.lang.Integer(target.getEnd()); + } + 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.setEnd( ((java.lang.Integer)value).intValue()); + } + 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.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _end + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_id", "id", 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.hasId()) + return null; + return new java.lang.Integer(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()); + } + 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.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _featuresList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Features.class, "_featuresList", "features", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JSeq target = (JSeq) object; + return target.getFeatures(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JSeq target = (JSeq) object; + target.addFeatures( (jalview.schemabinding.version2.Features) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.Features(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _featuresList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _pdbidsList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Pdbids.class, "_pdbidsList", "pdbids", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JSeq target = (JSeq) object; + return target.getPdbids(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JSeq target = (JSeq) object; + target.addPdbids( (jalview.schemabinding.version2.Pdbids) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.Pdbids(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _pdbidsList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.JSeqDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.JSeq.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/JalviewModel.java b/src/jalview/schemabinding/version2/JalviewModel.java new file mode 100755 index 0000000..fe8deef --- /dev/null +++ b/src/jalview/schemabinding/version2/JalviewModel.java @@ -0,0 +1,227 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import java.util.Date; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class JalviewModel. + * + * @version $Revision$ $Date$ + */ +public class JalviewModel implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _creationDate + */ + private java.util.Date _creationDate; + + /** + * Field _version + */ + private java.lang.String _version; + + /** + * Field _vamsasModel + */ + private jalview.schemabinding.version2.VamsasModel _vamsasModel; + + /** + * Field _jalviewModelSequence + */ + private jalview.schemabinding.version2.JalviewModelSequence _jalviewModelSequence; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public JalviewModel() { + super(); + } //-- jalview.schemabinding.version2.JalviewModel() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Returns the value of field 'creationDate'. + * + * @return Date + * @return the value of field 'creationDate'. + */ + public java.util.Date getCreationDate() + { + return this._creationDate; + } //-- java.util.Date getCreationDate() + + /** + * Returns the value of field 'jalviewModelSequence'. + * + * @return JalviewModelSequence + * @return the value of field 'jalviewModelSequence'. + */ + public jalview.schemabinding.version2.JalviewModelSequence getJalviewModelSequence() + { + return this._jalviewModelSequence; + } //-- jalview.schemabinding.version2.JalviewModelSequence getJalviewModelSequence() + + /** + * Returns the value of field 'vamsasModel'. + * + * @return VamsasModel + * @return the value of field 'vamsasModel'. + */ + public jalview.schemabinding.version2.VamsasModel getVamsasModel() + { + return this._vamsasModel; + } //-- jalview.schemabinding.version2.VamsasModel getVamsasModel() + + /** + * Returns the value of field 'version'. + * + * @return String + * @return the value of field 'version'. + */ + public java.lang.String getVersion() + { + return this._version; + } //-- java.lang.String getVersion() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'creationDate'. + * + * @param creationDate the value of field 'creationDate'. + */ + public void setCreationDate(java.util.Date creationDate) + { + this._creationDate = creationDate; + } //-- void setCreationDate(java.util.Date) + + /** + * Sets the value of field 'jalviewModelSequence'. + * + * @param jalviewModelSequence the value of field + * 'jalviewModelSequence'. + */ + public void setJalviewModelSequence(jalview.schemabinding.version2.JalviewModelSequence jalviewModelSequence) + { + this._jalviewModelSequence = jalviewModelSequence; + } //-- void setJalviewModelSequence(jalview.schemabinding.version2.JalviewModelSequence) + + /** + * Sets the value of field 'vamsasModel'. + * + * @param vamsasModel the value of field 'vamsasModel'. + */ + public void setVamsasModel(jalview.schemabinding.version2.VamsasModel vamsasModel) + { + this._vamsasModel = vamsasModel; + } //-- void setVamsasModel(jalview.schemabinding.version2.VamsasModel) + + /** + * Sets the value of field 'version'. + * + * @param version the value of field 'version'. + */ + public void setVersion(java.lang.String version) + { + this._version = version; + } //-- void setVersion(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.JalviewModel) Unmarshaller.unmarshal(jalview.schemabinding.version2.JalviewModel.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/JalviewModelDescriptor.java b/src/jalview/schemabinding/version2/JalviewModelDescriptor.java new file mode 100755 index 0000000..ad2dc13 --- /dev/null +++ b/src/jalview/schemabinding/version2/JalviewModelDescriptor.java @@ -0,0 +1,324 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class JalviewModelDescriptor. + * + * @version $Revision$ $Date$ + */ +public class JalviewModelDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public JalviewModelDescriptor() { + super(); + nsURI = "www.jalview.org"; + xmlName = "JalviewModel"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- initialize element descriptors + + //-- _creationDate + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.util.Date.class, "_creationDate", "creationDate", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JalviewModel target = (JalviewModel) object; + return target.getCreationDate(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JalviewModel target = (JalviewModel) object; + target.setCreationDate( (java.util.Date) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new java.util.Date(); + } + } ); + desc.setHandler( new org.exolab.castor.xml.handlers.DateFieldHandler(handler)); + desc.setImmutable(true); + desc.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _creationDate + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _version + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "version", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JalviewModel target = (JalviewModel) object; + return target.getVersion(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JalviewModel target = (JalviewModel) object; + target.setVersion( (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); + desc.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _version + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _vamsasModel + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.VamsasModel.class, "_vamsasModel", "vamsasModel", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JalviewModel target = (JalviewModel) object; + return target.getVamsasModel(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JalviewModel target = (JalviewModel) object; + target.setVamsasModel( (jalview.schemabinding.version2.VamsasModel) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.VamsasModel(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _vamsasModel + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _jalviewModelSequence + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.JalviewModelSequence.class, "_jalviewModelSequence", "-error-if-this-is-used-", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JalviewModel target = (JalviewModel) object; + return target.getJalviewModelSequence(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JalviewModel target = (JalviewModel) object; + target.setJalviewModelSequence( (jalview.schemabinding.version2.JalviewModelSequence) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.JalviewModelSequence(); + } + } ); + desc.setHandler(handler); + desc.setContainer(true); + desc.setClassDescriptor(new jalview.schemabinding.version2.JalviewModelSequenceDescriptor()); + desc.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _jalviewModelSequence + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.JalviewModelDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.JalviewModel.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/JalviewModelSequence.java b/src/jalview/schemabinding/version2/JalviewModelSequence.java new file mode 100755 index 0000000..45f486b --- /dev/null +++ b/src/jalview/schemabinding/version2/JalviewModelSequence.java @@ -0,0 +1,904 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import java.util.Enumeration; +import java.util.Vector; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class JalviewModelSequence. + * + * @version $Revision$ $Date$ + */ +public class JalviewModelSequence implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _JSeqList + */ + private java.util.Vector _JSeqList; + + /** + * Field _JGroupList + */ + private java.util.Vector _JGroupList; + + /** + * Field _viewportList + */ + private java.util.Vector _viewportList; + + /** + * Field _userColoursList + */ + private java.util.Vector _userColoursList; + + /** + * Field _treeList + */ + private java.util.Vector _treeList; + + /** + * Field _featureSettings + */ + private jalview.schemabinding.version2.FeatureSettings _featureSettings; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public JalviewModelSequence() { + super(); + _JSeqList = new Vector(); + _JGroupList = new Vector(); + _viewportList = new Vector(); + _userColoursList = new Vector(); + _treeList = new Vector(); + } //-- jalview.schemabinding.version2.JalviewModelSequence() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addJGroup + * + * + * + * @param vJGroup + */ + public void addJGroup(jalview.schemabinding.version2.JGroup vJGroup) + throws java.lang.IndexOutOfBoundsException + { + _JGroupList.addElement(vJGroup); + } //-- void addJGroup(jalview.schemabinding.version2.JGroup) + + /** + * Method addJGroup + * + * + * + * @param index + * @param vJGroup + */ + public void addJGroup(int index, jalview.schemabinding.version2.JGroup vJGroup) + throws java.lang.IndexOutOfBoundsException + { + _JGroupList.insertElementAt(vJGroup, index); + } //-- void addJGroup(int, jalview.schemabinding.version2.JGroup) + + /** + * Method addJSeq + * + * + * + * @param vJSeq + */ + public void addJSeq(jalview.schemabinding.version2.JSeq vJSeq) + throws java.lang.IndexOutOfBoundsException + { + _JSeqList.addElement(vJSeq); + } //-- void addJSeq(jalview.schemabinding.version2.JSeq) + + /** + * Method addJSeq + * + * + * + * @param index + * @param vJSeq + */ + public void addJSeq(int index, jalview.schemabinding.version2.JSeq vJSeq) + throws java.lang.IndexOutOfBoundsException + { + _JSeqList.insertElementAt(vJSeq, index); + } //-- void addJSeq(int, jalview.schemabinding.version2.JSeq) + + /** + * Method addTree + * + * + * + * @param vTree + */ + public void addTree(jalview.schemabinding.version2.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + _treeList.addElement(vTree); + } //-- void addTree(jalview.schemabinding.version2.Tree) + + /** + * Method addTree + * + * + * + * @param index + * @param vTree + */ + public void addTree(int index, jalview.schemabinding.version2.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + _treeList.insertElementAt(vTree, index); + } //-- void addTree(int, jalview.schemabinding.version2.Tree) + + /** + * Method addUserColours + * + * + * + * @param vUserColours + */ + public void addUserColours(jalview.schemabinding.version2.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException + { + _userColoursList.addElement(vUserColours); + } //-- void addUserColours(jalview.schemabinding.version2.UserColours) + + /** + * Method addUserColours + * + * + * + * @param index + * @param vUserColours + */ + public void addUserColours(int index, jalview.schemabinding.version2.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException + { + _userColoursList.insertElementAt(vUserColours, index); + } //-- void addUserColours(int, jalview.schemabinding.version2.UserColours) + + /** + * Method addViewport + * + * + * + * @param vViewport + */ + public void addViewport(jalview.schemabinding.version2.Viewport vViewport) + throws java.lang.IndexOutOfBoundsException + { + _viewportList.addElement(vViewport); + } //-- void addViewport(jalview.schemabinding.version2.Viewport) + + /** + * Method addViewport + * + * + * + * @param index + * @param vViewport + */ + public void addViewport(int index, jalview.schemabinding.version2.Viewport vViewport) + throws java.lang.IndexOutOfBoundsException + { + _viewportList.insertElementAt(vViewport, index); + } //-- void addViewport(int, jalview.schemabinding.version2.Viewport) + + /** + * Method enumerateJGroup + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateJGroup() + { + return _JGroupList.elements(); + } //-- java.util.Enumeration enumerateJGroup() + + /** + * Method enumerateJSeq + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateJSeq() + { + return _JSeqList.elements(); + } //-- java.util.Enumeration enumerateJSeq() + + /** + * Method enumerateTree + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateTree() + { + return _treeList.elements(); + } //-- java.util.Enumeration enumerateTree() + + /** + * Method enumerateUserColours + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateUserColours() + { + return _userColoursList.elements(); + } //-- java.util.Enumeration enumerateUserColours() + + /** + * Method enumerateViewport + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateViewport() + { + return _viewportList.elements(); + } //-- java.util.Enumeration enumerateViewport() + + /** + * Returns the value of field 'featureSettings'. + * + * @return FeatureSettings + * @return the value of field 'featureSettings'. + */ + public jalview.schemabinding.version2.FeatureSettings getFeatureSettings() + { + return this._featureSettings; + } //-- jalview.schemabinding.version2.FeatureSettings getFeatureSettings() + + /** + * Method getJGroup + * + * + * + * @param index + * @return JGroup + */ + public jalview.schemabinding.version2.JGroup getJGroup(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _JGroupList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.JGroup) _JGroupList.elementAt(index); + } //-- jalview.schemabinding.version2.JGroup getJGroup(int) + + /** + * Method getJGroup + * + * + * + * @return JGroup + */ + public jalview.schemabinding.version2.JGroup[] getJGroup() + { + int size = _JGroupList.size(); + jalview.schemabinding.version2.JGroup[] mArray = new jalview.schemabinding.version2.JGroup[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.JGroup) _JGroupList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.JGroup[] getJGroup() + + /** + * Method getJGroupCount + * + * + * + * @return int + */ + public int getJGroupCount() + { + return _JGroupList.size(); + } //-- int getJGroupCount() + + /** + * Method getJSeq + * + * + * + * @param index + * @return JSeq + */ + public jalview.schemabinding.version2.JSeq getJSeq(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _JSeqList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.JSeq) _JSeqList.elementAt(index); + } //-- jalview.schemabinding.version2.JSeq getJSeq(int) + + /** + * Method getJSeq + * + * + * + * @return JSeq + */ + public jalview.schemabinding.version2.JSeq[] getJSeq() + { + int size = _JSeqList.size(); + jalview.schemabinding.version2.JSeq[] mArray = new jalview.schemabinding.version2.JSeq[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.JSeq) _JSeqList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.JSeq[] getJSeq() + + /** + * Method getJSeqCount + * + * + * + * @return int + */ + public int getJSeqCount() + { + return _JSeqList.size(); + } //-- int getJSeqCount() + + /** + * Method getTree + * + * + * + * @param index + * @return Tree + */ + public jalview.schemabinding.version2.Tree getTree(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _treeList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.Tree) _treeList.elementAt(index); + } //-- jalview.schemabinding.version2.Tree getTree(int) + + /** + * Method getTree + * + * + * + * @return Tree + */ + public jalview.schemabinding.version2.Tree[] getTree() + { + int size = _treeList.size(); + jalview.schemabinding.version2.Tree[] mArray = new jalview.schemabinding.version2.Tree[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.Tree) _treeList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.Tree[] getTree() + + /** + * Method getTreeCount + * + * + * + * @return int + */ + public int getTreeCount() + { + return _treeList.size(); + } //-- int getTreeCount() + + /** + * Method getUserColours + * + * + * + * @param index + * @return UserColours + */ + public jalview.schemabinding.version2.UserColours getUserColours(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _userColoursList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.UserColours) _userColoursList.elementAt(index); + } //-- jalview.schemabinding.version2.UserColours getUserColours(int) + + /** + * Method getUserColours + * + * + * + * @return UserColours + */ + public jalview.schemabinding.version2.UserColours[] getUserColours() + { + int size = _userColoursList.size(); + jalview.schemabinding.version2.UserColours[] mArray = new jalview.schemabinding.version2.UserColours[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.UserColours) _userColoursList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.UserColours[] getUserColours() + + /** + * Method getUserColoursCount + * + * + * + * @return int + */ + public int getUserColoursCount() + { + return _userColoursList.size(); + } //-- int getUserColoursCount() + + /** + * Method getViewport + * + * + * + * @param index + * @return Viewport + */ + public jalview.schemabinding.version2.Viewport getViewport(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _viewportList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.Viewport) _viewportList.elementAt(index); + } //-- jalview.schemabinding.version2.Viewport getViewport(int) + + /** + * Method getViewport + * + * + * + * @return Viewport + */ + public jalview.schemabinding.version2.Viewport[] getViewport() + { + int size = _viewportList.size(); + jalview.schemabinding.version2.Viewport[] mArray = new jalview.schemabinding.version2.Viewport[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.Viewport) _viewportList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.Viewport[] getViewport() + + /** + * Method getViewportCount + * + * + * + * @return int + */ + public int getViewportCount() + { + return _viewportList.size(); + } //-- int getViewportCount() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method removeAllJGroup + * + */ + public void removeAllJGroup() + { + _JGroupList.removeAllElements(); + } //-- void removeAllJGroup() + + /** + * Method removeAllJSeq + * + */ + public void removeAllJSeq() + { + _JSeqList.removeAllElements(); + } //-- void removeAllJSeq() + + /** + * Method removeAllTree + * + */ + public void removeAllTree() + { + _treeList.removeAllElements(); + } //-- void removeAllTree() + + /** + * Method removeAllUserColours + * + */ + public void removeAllUserColours() + { + _userColoursList.removeAllElements(); + } //-- void removeAllUserColours() + + /** + * Method removeAllViewport + * + */ + public void removeAllViewport() + { + _viewportList.removeAllElements(); + } //-- void removeAllViewport() + + /** + * Method removeJGroup + * + * + * + * @param index + * @return JGroup + */ + public jalview.schemabinding.version2.JGroup removeJGroup(int index) + { + java.lang.Object obj = _JGroupList.elementAt(index); + _JGroupList.removeElementAt(index); + return (jalview.schemabinding.version2.JGroup) obj; + } //-- jalview.schemabinding.version2.JGroup removeJGroup(int) + + /** + * Method removeJSeq + * + * + * + * @param index + * @return JSeq + */ + public jalview.schemabinding.version2.JSeq removeJSeq(int index) + { + java.lang.Object obj = _JSeqList.elementAt(index); + _JSeqList.removeElementAt(index); + return (jalview.schemabinding.version2.JSeq) obj; + } //-- jalview.schemabinding.version2.JSeq removeJSeq(int) + + /** + * Method removeTree + * + * + * + * @param index + * @return Tree + */ + public jalview.schemabinding.version2.Tree removeTree(int index) + { + java.lang.Object obj = _treeList.elementAt(index); + _treeList.removeElementAt(index); + return (jalview.schemabinding.version2.Tree) obj; + } //-- jalview.schemabinding.version2.Tree removeTree(int) + + /** + * Method removeUserColours + * + * + * + * @param index + * @return UserColours + */ + public jalview.schemabinding.version2.UserColours removeUserColours(int index) + { + java.lang.Object obj = _userColoursList.elementAt(index); + _userColoursList.removeElementAt(index); + return (jalview.schemabinding.version2.UserColours) obj; + } //-- jalview.schemabinding.version2.UserColours removeUserColours(int) + + /** + * Method removeViewport + * + * + * + * @param index + * @return Viewport + */ + public jalview.schemabinding.version2.Viewport removeViewport(int index) + { + java.lang.Object obj = _viewportList.elementAt(index); + _viewportList.removeElementAt(index); + return (jalview.schemabinding.version2.Viewport) obj; + } //-- jalview.schemabinding.version2.Viewport removeViewport(int) + + /** + * Sets the value of field 'featureSettings'. + * + * @param featureSettings the value of field 'featureSettings'. + */ + public void setFeatureSettings(jalview.schemabinding.version2.FeatureSettings featureSettings) + { + this._featureSettings = featureSettings; + } //-- void setFeatureSettings(jalview.schemabinding.version2.FeatureSettings) + + /** + * Method setJGroup + * + * + * + * @param index + * @param vJGroup + */ + public void setJGroup(int index, jalview.schemabinding.version2.JGroup vJGroup) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _JGroupList.size())) { + throw new IndexOutOfBoundsException(); + } + _JGroupList.setElementAt(vJGroup, index); + } //-- void setJGroup(int, jalview.schemabinding.version2.JGroup) + + /** + * Method setJGroup + * + * + * + * @param JGroupArray + */ + public void setJGroup(jalview.schemabinding.version2.JGroup[] JGroupArray) + { + //-- copy array + _JGroupList.removeAllElements(); + for (int i = 0; i < JGroupArray.length; i++) { + _JGroupList.addElement(JGroupArray[i]); + } + } //-- void setJGroup(jalview.schemabinding.version2.JGroup) + + /** + * Method setJSeq + * + * + * + * @param index + * @param vJSeq + */ + public void setJSeq(int index, jalview.schemabinding.version2.JSeq vJSeq) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _JSeqList.size())) { + throw new IndexOutOfBoundsException(); + } + _JSeqList.setElementAt(vJSeq, index); + } //-- void setJSeq(int, jalview.schemabinding.version2.JSeq) + + /** + * Method setJSeq + * + * + * + * @param JSeqArray + */ + public void setJSeq(jalview.schemabinding.version2.JSeq[] JSeqArray) + { + //-- copy array + _JSeqList.removeAllElements(); + for (int i = 0; i < JSeqArray.length; i++) { + _JSeqList.addElement(JSeqArray[i]); + } + } //-- void setJSeq(jalview.schemabinding.version2.JSeq) + + /** + * Method setTree + * + * + * + * @param index + * @param vTree + */ + public void setTree(int index, jalview.schemabinding.version2.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _treeList.size())) { + throw new IndexOutOfBoundsException(); + } + _treeList.setElementAt(vTree, index); + } //-- void setTree(int, jalview.schemabinding.version2.Tree) + + /** + * Method setTree + * + * + * + * @param treeArray + */ + public void setTree(jalview.schemabinding.version2.Tree[] treeArray) + { + //-- copy array + _treeList.removeAllElements(); + for (int i = 0; i < treeArray.length; i++) { + _treeList.addElement(treeArray[i]); + } + } //-- void setTree(jalview.schemabinding.version2.Tree) + + /** + * Method setUserColours + * + * + * + * @param index + * @param vUserColours + */ + public void setUserColours(int index, jalview.schemabinding.version2.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _userColoursList.size())) { + throw new IndexOutOfBoundsException(); + } + _userColoursList.setElementAt(vUserColours, index); + } //-- void setUserColours(int, jalview.schemabinding.version2.UserColours) + + /** + * Method setUserColours + * + * + * + * @param userColoursArray + */ + public void setUserColours(jalview.schemabinding.version2.UserColours[] userColoursArray) + { + //-- copy array + _userColoursList.removeAllElements(); + for (int i = 0; i < userColoursArray.length; i++) { + _userColoursList.addElement(userColoursArray[i]); + } + } //-- void setUserColours(jalview.schemabinding.version2.UserColours) + + /** + * Method setViewport + * + * + * + * @param index + * @param vViewport + */ + public void setViewport(int index, jalview.schemabinding.version2.Viewport vViewport) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _viewportList.size())) { + throw new IndexOutOfBoundsException(); + } + _viewportList.setElementAt(vViewport, index); + } //-- void setViewport(int, jalview.schemabinding.version2.Viewport) + + /** + * Method setViewport + * + * + * + * @param viewportArray + */ + public void setViewport(jalview.schemabinding.version2.Viewport[] viewportArray) + { + //-- copy array + _viewportList.removeAllElements(); + for (int i = 0; i < viewportArray.length; i++) { + _viewportList.addElement(viewportArray[i]); + } + } //-- void setViewport(jalview.schemabinding.version2.Viewport) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.JalviewModelSequence) Unmarshaller.unmarshal(jalview.schemabinding.version2.JalviewModelSequence.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/JalviewModelSequenceDescriptor.java b/src/jalview/schemabinding/version2/JalviewModelSequenceDescriptor.java new file mode 100755 index 0000000..7f5bd43 --- /dev/null +++ b/src/jalview/schemabinding/version2/JalviewModelSequenceDescriptor.java @@ -0,0 +1,383 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class JalviewModelSequenceDescriptor. + * + * @version $Revision$ $Date$ + */ +public class JalviewModelSequenceDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public JalviewModelSequenceDescriptor() { + super(); + nsURI = "www.jalview.org"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- initialize element descriptors + + //-- _JSeqList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.JSeq.class, "_JSeqList", "JSeq", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JalviewModelSequence target = (JalviewModelSequence) object; + return target.getJSeq(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JalviewModelSequence target = (JalviewModelSequence) object; + target.addJSeq( (jalview.schemabinding.version2.JSeq) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.JSeq(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _JSeqList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _JGroupList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.JGroup.class, "_JGroupList", "JGroup", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JalviewModelSequence target = (JalviewModelSequence) object; + return target.getJGroup(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JalviewModelSequence target = (JalviewModelSequence) object; + target.addJGroup( (jalview.schemabinding.version2.JGroup) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.JGroup(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _JGroupList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _viewportList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Viewport.class, "_viewportList", "Viewport", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JalviewModelSequence target = (JalviewModelSequence) object; + return target.getViewport(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JalviewModelSequence target = (JalviewModelSequence) object; + target.addViewport( (jalview.schemabinding.version2.Viewport) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.Viewport(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _viewportList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _userColoursList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.UserColours.class, "_userColoursList", "UserColours", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JalviewModelSequence target = (JalviewModelSequence) object; + return target.getUserColours(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JalviewModelSequence target = (JalviewModelSequence) object; + target.addUserColours( (jalview.schemabinding.version2.UserColours) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.UserColours(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _userColoursList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _treeList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Tree.class, "_treeList", "tree", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JalviewModelSequence target = (JalviewModelSequence) object; + return target.getTree(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JalviewModelSequence target = (JalviewModelSequence) object; + target.addTree( (jalview.schemabinding.version2.Tree) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.Tree(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _treeList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _featureSettings + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.FeatureSettings.class, "_featureSettings", "FeatureSettings", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JalviewModelSequence target = (JalviewModelSequence) object; + return target.getFeatureSettings(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JalviewModelSequence target = (JalviewModelSequence) object; + target.setFeatureSettings( (jalview.schemabinding.version2.FeatureSettings) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.FeatureSettings(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _featureSettings + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.JalviewModelSequenceDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.JalviewModelSequence.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/JalviewUserColours.java b/src/jalview/schemabinding/version2/JalviewUserColours.java new file mode 100755 index 0000000..7963596 --- /dev/null +++ b/src/jalview/schemabinding/version2/JalviewUserColours.java @@ -0,0 +1,300 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import java.util.Enumeration; +import java.util.Vector; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class JalviewUserColours. + * + * @version $Revision$ $Date$ + */ +public class JalviewUserColours implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _schemeName + */ + private java.lang.String _schemeName; + + /** + * Field _colourList + */ + private java.util.Vector _colourList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public JalviewUserColours() { + super(); + _colourList = new Vector(); + } //-- jalview.schemabinding.version2.JalviewUserColours() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addColour + * + * + * + * @param vColour + */ + public void addColour(jalview.schemabinding.version2.Colour vColour) + throws java.lang.IndexOutOfBoundsException + { + _colourList.addElement(vColour); + } //-- void addColour(jalview.schemabinding.version2.Colour) + + /** + * Method addColour + * + * + * + * @param index + * @param vColour + */ + public void addColour(int index, jalview.schemabinding.version2.Colour vColour) + throws java.lang.IndexOutOfBoundsException + { + _colourList.insertElementAt(vColour, index); + } //-- void addColour(int, jalview.schemabinding.version2.Colour) + + /** + * Method enumerateColour + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateColour() + { + return _colourList.elements(); + } //-- java.util.Enumeration enumerateColour() + + /** + * Method getColour + * + * + * + * @param index + * @return Colour + */ + public jalview.schemabinding.version2.Colour getColour(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _colourList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.Colour) _colourList.elementAt(index); + } //-- jalview.schemabinding.version2.Colour getColour(int) + + /** + * Method getColour + * + * + * + * @return Colour + */ + public jalview.schemabinding.version2.Colour[] getColour() + { + int size = _colourList.size(); + jalview.schemabinding.version2.Colour[] mArray = new jalview.schemabinding.version2.Colour[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.Colour) _colourList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.Colour[] getColour() + + /** + * Method getColourCount + * + * + * + * @return int + */ + public int getColourCount() + { + return _colourList.size(); + } //-- int getColourCount() + + /** + * Returns the value of field 'schemeName'. + * + * @return String + * @return the value of field 'schemeName'. + */ + public java.lang.String getSchemeName() + { + return this._schemeName; + } //-- java.lang.String getSchemeName() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method removeAllColour + * + */ + public void removeAllColour() + { + _colourList.removeAllElements(); + } //-- void removeAllColour() + + /** + * Method removeColour + * + * + * + * @param index + * @return Colour + */ + public jalview.schemabinding.version2.Colour removeColour(int index) + { + java.lang.Object obj = _colourList.elementAt(index); + _colourList.removeElementAt(index); + return (jalview.schemabinding.version2.Colour) obj; + } //-- jalview.schemabinding.version2.Colour removeColour(int) + + /** + * Method setColour + * + * + * + * @param index + * @param vColour + */ + public void setColour(int index, jalview.schemabinding.version2.Colour vColour) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _colourList.size())) { + throw new IndexOutOfBoundsException(); + } + _colourList.setElementAt(vColour, index); + } //-- void setColour(int, jalview.schemabinding.version2.Colour) + + /** + * Method setColour + * + * + * + * @param colourArray + */ + public void setColour(jalview.schemabinding.version2.Colour[] colourArray) + { + //-- copy array + _colourList.removeAllElements(); + for (int i = 0; i < colourArray.length; i++) { + _colourList.addElement(colourArray[i]); + } + } //-- void setColour(jalview.schemabinding.version2.Colour) + + /** + * Sets the value of field 'schemeName'. + * + * @param schemeName the value of field 'schemeName'. + */ + public void setSchemeName(java.lang.String schemeName) + { + this._schemeName = schemeName; + } //-- void setSchemeName(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.JalviewUserColours) Unmarshaller.unmarshal(jalview.schemabinding.version2.JalviewUserColours.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/JalviewUserColoursDescriptor.java b/src/jalview/schemabinding/version2/JalviewUserColoursDescriptor.java new file mode 100755 index 0000000..661d102 --- /dev/null +++ b/src/jalview/schemabinding/version2/JalviewUserColoursDescriptor.java @@ -0,0 +1,244 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class JalviewUserColoursDescriptor. + * + * @version $Revision$ $Date$ + */ +public class JalviewUserColoursDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public JalviewUserColoursDescriptor() { + super(); + nsURI = "www.jalview.org/colours"; + xmlName = "JalviewUserColours"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _schemeName + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_schemeName", "schemeName", 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 + { + JalviewUserColours target = (JalviewUserColours) object; + return target.getSchemeName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JalviewUserColours target = (JalviewUserColours) object; + target.setSchemeName( (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: _schemeName + 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 + + //-- _colourList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Colour.class, "_colourList", "colour", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + JalviewUserColours target = (JalviewUserColours) object; + return target.getColour(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + JalviewUserColours target = (JalviewUserColours) object; + target.addColour( (jalview.schemabinding.version2.Colour) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.Colour(); + } + } ); + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _colourList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.JalviewUserColoursDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.JalviewUserColours.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/Pdbentry.java b/src/jalview/schemabinding/version2/Pdbentry.java new file mode 100755 index 0000000..15694db --- /dev/null +++ b/src/jalview/schemabinding/version2/Pdbentry.java @@ -0,0 +1,326 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import java.util.Enumeration; +import java.util.Vector; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Pdbentry. + * + * @version $Revision$ $Date$ + */ +public class Pdbentry implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _id + */ + private java.lang.String _id; + + /** + * Field _type + */ + private java.lang.String _type; + + /** + * Field _items + */ + private java.util.Vector _items; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Pdbentry() { + super(); + _items = new Vector(); + } //-- jalview.schemabinding.version2.Pdbentry() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addPdbentryItem + * + * + * + * @param vPdbentryItem + */ + public void addPdbentryItem(jalview.schemabinding.version2.PdbentryItem vPdbentryItem) + throws java.lang.IndexOutOfBoundsException + { + _items.addElement(vPdbentryItem); + } //-- void addPdbentryItem(jalview.schemabinding.version2.PdbentryItem) + + /** + * Method addPdbentryItem + * + * + * + * @param index + * @param vPdbentryItem + */ + public void addPdbentryItem(int index, jalview.schemabinding.version2.PdbentryItem vPdbentryItem) + throws java.lang.IndexOutOfBoundsException + { + _items.insertElementAt(vPdbentryItem, index); + } //-- void addPdbentryItem(int, jalview.schemabinding.version2.PdbentryItem) + + /** + * Method enumeratePdbentryItem + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumeratePdbentryItem() + { + return _items.elements(); + } //-- java.util.Enumeration enumeratePdbentryItem() + + /** + * 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() + + /** + * Method getPdbentryItem + * + * + * + * @param index + * @return PdbentryItem + */ + public jalview.schemabinding.version2.PdbentryItem getPdbentryItem(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _items.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.PdbentryItem) _items.elementAt(index); + } //-- jalview.schemabinding.version2.PdbentryItem getPdbentryItem(int) + + /** + * Method getPdbentryItem + * + * + * + * @return PdbentryItem + */ + public jalview.schemabinding.version2.PdbentryItem[] getPdbentryItem() + { + int size = _items.size(); + jalview.schemabinding.version2.PdbentryItem[] mArray = new jalview.schemabinding.version2.PdbentryItem[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.PdbentryItem) _items.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.PdbentryItem[] getPdbentryItem() + + /** + * Method getPdbentryItemCount + * + * + * + * @return int + */ + public int getPdbentryItemCount() + { + return _items.size(); + } //-- int getPdbentryItemCount() + + /** + * Returns the value of field 'type'. + * + * @return String + * @return the value of field 'type'. + */ + public java.lang.String getType() + { + return this._type; + } //-- java.lang.String getType() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method removeAllPdbentryItem + * + */ + public void removeAllPdbentryItem() + { + _items.removeAllElements(); + } //-- void removeAllPdbentryItem() + + /** + * Method removePdbentryItem + * + * + * + * @param index + * @return PdbentryItem + */ + public jalview.schemabinding.version2.PdbentryItem removePdbentryItem(int index) + { + java.lang.Object obj = _items.elementAt(index); + _items.removeElementAt(index); + return (jalview.schemabinding.version2.PdbentryItem) obj; + } //-- jalview.schemabinding.version2.PdbentryItem removePdbentryItem(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) + + /** + * Method setPdbentryItem + * + * + * + * @param index + * @param vPdbentryItem + */ + public void setPdbentryItem(int index, jalview.schemabinding.version2.PdbentryItem vPdbentryItem) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _items.size())) { + throw new IndexOutOfBoundsException(); + } + _items.setElementAt(vPdbentryItem, index); + } //-- void setPdbentryItem(int, jalview.schemabinding.version2.PdbentryItem) + + /** + * Method setPdbentryItem + * + * + * + * @param pdbentryItemArray + */ + public void setPdbentryItem(jalview.schemabinding.version2.PdbentryItem[] pdbentryItemArray) + { + //-- copy array + _items.removeAllElements(); + for (int i = 0; i < pdbentryItemArray.length; i++) { + _items.addElement(pdbentryItemArray[i]); + } + } //-- void setPdbentryItem(jalview.schemabinding.version2.PdbentryItem) + + /** + * Sets the value of field 'type'. + * + * @param type the value of field 'type'. + */ + public void setType(java.lang.String type) + { + this._type = type; + } //-- void setType(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Pdbentry) Unmarshaller.unmarshal(jalview.schemabinding.version2.Pdbentry.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/PdbentryDescriptor.java b/src/jalview/schemabinding/version2/PdbentryDescriptor.java new file mode 100755 index 0000000..bb64034 --- /dev/null +++ b/src/jalview/schemabinding/version2/PdbentryDescriptor.java @@ -0,0 +1,279 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class PdbentryDescriptor. + * + * @version $Revision$ $Date$ + */ +public class PdbentryDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public PdbentryDescriptor() { + super(); + xmlName = "pdbentry"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _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 + { + Pdbentry target = (Pdbentry) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Pdbentry target = (Pdbentry) 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); + desc.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _type + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", 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 + { + Pdbentry target = (Pdbentry) object; + return target.getType(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Pdbentry target = (Pdbentry) object; + target.setType( (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: _type + 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 + + //-- _items + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.PdbentryItem.class, "_items", (String)null, org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Pdbentry target = (Pdbentry) object; + return target.getPdbentryItem(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Pdbentry target = (Pdbentry) object; + target.addPdbentryItem( (jalview.schemabinding.version2.PdbentryItem) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.PdbentryItem(); + } + } ); + desc.setHandler(handler); + desc.setContainer(true); + desc.setClassDescriptor(new jalview.schemabinding.version2.PdbentryItemDescriptor()); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _items + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.PdbentryDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Pdbentry.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/PdbentryItem.java b/src/jalview/schemabinding/version2/PdbentryItem.java new file mode 100755 index 0000000..6f64036 --- /dev/null +++ b/src/jalview/schemabinding/version2/PdbentryItem.java @@ -0,0 +1,197 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.Serializable; +import java.util.Enumeration; +import java.util.Vector; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; + +/** + * Class PdbentryItem. + * + * @version $Revision$ $Date$ + */ +public class PdbentryItem implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _propertyList + */ + private java.util.Vector _propertyList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public PdbentryItem() { + super(); + _propertyList = new Vector(); + } //-- jalview.schemabinding.version2.PdbentryItem() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(jalview.schemabinding.version2.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, jalview.schemabinding.version2.Property) + + /** + * Method enumerateProperty + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateProperty() + { + return _propertyList.elements(); + } //-- java.util.Enumeration enumerateProperty() + + /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public jalview.schemabinding.version2.Property getProperty(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.Property) _propertyList.elementAt(index); + } //-- jalview.schemabinding.version2.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public jalview.schemabinding.version2.Property[] getProperty() + { + int size = _propertyList.size(); + jalview.schemabinding.version2.Property[] mArray = new jalview.schemabinding.version2.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.Property[] getProperty() + + /** + * Method getPropertyCount + * + * + * + * @return int + */ + public int getPropertyCount() + { + return _propertyList.size(); + } //-- int getPropertyCount() + + /** + * Method removeAllProperty + * + */ + public void removeAllProperty() + { + _propertyList.removeAllElements(); + } //-- void removeAllProperty() + + /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public jalview.schemabinding.version2.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (jalview.schemabinding.version2.Property) obj; + } //-- jalview.schemabinding.version2.Property removeProperty(int) + + /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException(); + } + _propertyList.setElementAt(vProperty, index); + } //-- void setProperty(int, jalview.schemabinding.version2.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(jalview.schemabinding.version2.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(jalview.schemabinding.version2.Property) + +} diff --git a/src/jalview/schemabinding/version2/PdbentryItemDescriptor.java b/src/jalview/schemabinding/version2/PdbentryItemDescriptor.java new file mode 100755 index 0000000..d9d36c0 --- /dev/null +++ b/src/jalview/schemabinding/version2/PdbentryItemDescriptor.java @@ -0,0 +1,208 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class PdbentryItemDescriptor. + * + * @version $Revision$ $Date$ + */ +public class PdbentryItemDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public PdbentryItemDescriptor() { + super(); + nsURI = "www.jalview.org"; + xmlName = "pdbentry"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- initialize element descriptors + + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + PdbentryItem target = (PdbentryItem) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + PdbentryItem target = (PdbentryItem) object; + target.addProperty( (jalview.schemabinding.version2.Property) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.Property(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _propertyList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.PdbentryItemDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.PdbentryItem.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/Pdbids.java b/src/jalview/schemabinding/version2/Pdbids.java new file mode 100755 index 0000000..53b2e91 --- /dev/null +++ b/src/jalview/schemabinding/version2/Pdbids.java @@ -0,0 +1,118 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Pdbids. + * + * @version $Revision$ $Date$ + */ +public class Pdbids extends Pdbentry +implements java.io.Serializable +{ + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Pdbids() { + super(); + } //-- jalview.schemabinding.version2.Pdbids() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Pdbids) Unmarshaller.unmarshal(jalview.schemabinding.version2.Pdbids.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/PdbidsDescriptor.java b/src/jalview/schemabinding/version2/PdbidsDescriptor.java new file mode 100755 index 0000000..607f122 --- /dev/null +++ b/src/jalview/schemabinding/version2/PdbidsDescriptor.java @@ -0,0 +1,166 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class PdbidsDescriptor. + * + * @version $Revision$ $Date$ + */ +public class PdbidsDescriptor extends PdbentryDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public PdbidsDescriptor() { + super(); + setExtendsWithoutFlatten(new PdbentryDescriptor()); + nsURI = "www.jalview.org"; + xmlName = "pdbids"; + } //-- jalview.schemabinding.version2.PdbidsDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return super.getExtends(); + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + if (identity == null) + return super.getIdentity(); + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Pdbids.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/Property.java b/src/jalview/schemabinding/version2/Property.java new file mode 100755 index 0000000..338dd90 --- /dev/null +++ b/src/jalview/schemabinding/version2/Property.java @@ -0,0 +1,173 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Property. + * + * @version $Revision$ $Date$ + */ +public class Property implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _name + */ + private java.lang.String _name; + + /** + * Field _value + */ + private java.lang.String _value; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Property() { + super(); + } //-- jalview.schemabinding.version2.Property() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Returns the value of field 'name'. + * + * @return String + * @return the value of field 'name'. + */ + public java.lang.String getName() + { + return this._name; + } //-- java.lang.String getName() + + /** + * Returns the value of field 'value'. + * + * @return String + * @return the value of field 'value'. + */ + public java.lang.String getValue() + { + return this._value; + } //-- java.lang.String getValue() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'name'. + * + * @param name the value of field 'name'. + */ + public void setName(java.lang.String name) + { + this._name = name; + } //-- void setName(java.lang.String) + + /** + * Sets the value of field 'value'. + * + * @param value the value of field 'value'. + */ + public void setValue(java.lang.String value) + { + this._value = value; + } //-- void setValue(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Property) Unmarshaller.unmarshal(jalview.schemabinding.version2.Property.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/PropertyDescriptor.java b/src/jalview/schemabinding/version2/PropertyDescriptor.java new file mode 100755 index 0000000..e22704c --- /dev/null +++ b/src/jalview/schemabinding/version2/PropertyDescriptor.java @@ -0,0 +1,246 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class PropertyDescriptor. + * + * @version $Revision$ $Date$ + */ +public class PropertyDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public PropertyDescriptor() { + super(); + nsURI = "www.jalview.org"; + xmlName = "property"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _name + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", 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 + { + Property target = (Property) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Property target = (Property) object; + target.setName( (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); + desc.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _name + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _value + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_value", "value", 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 + { + Property target = (Property) object; + return target.getValue(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Property target = (Property) object; + target.setValue( (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); + desc.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _value + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } //-- jalview.schemabinding.version2.PropertyDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Property.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/Sequence.java b/src/jalview/schemabinding/version2/Sequence.java new file mode 100755 index 0000000..7a15332 --- /dev/null +++ b/src/jalview/schemabinding/version2/Sequence.java @@ -0,0 +1,118 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Sequence. + * + * @version $Revision$ $Date$ + */ +public class Sequence extends SequenceType +implements java.io.Serializable +{ + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Sequence() { + super(); + } //-- jalview.schemabinding.version2.Sequence() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Sequence) Unmarshaller.unmarshal(jalview.schemabinding.version2.Sequence.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/SequenceDescriptor.java b/src/jalview/schemabinding/version2/SequenceDescriptor.java new file mode 100755 index 0000000..9e1a7f3 --- /dev/null +++ b/src/jalview/schemabinding/version2/SequenceDescriptor.java @@ -0,0 +1,166 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class SequenceDescriptor. + * + * @version $Revision$ $Date$ + */ +public class SequenceDescriptor extends SequenceTypeDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SequenceDescriptor() { + super(); + setExtendsWithoutFlatten(new SequenceTypeDescriptor()); + nsURI = "www.vamsas.ac.uk/jalview/version2"; + xmlName = "Sequence"; + } //-- jalview.schemabinding.version2.SequenceDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return super.getExtends(); + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + if (identity == null) + return super.getIdentity(); + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Sequence.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/SequenceSet.java b/src/jalview/schemabinding/version2/SequenceSet.java new file mode 100755 index 0000000..187139d --- /dev/null +++ b/src/jalview/schemabinding/version2/SequenceSet.java @@ -0,0 +1,504 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import java.util.Enumeration; +import java.util.Vector; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class SequenceSet. + * + * @version $Revision$ $Date$ + */ +public class SequenceSet implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _gapChar + */ + private java.lang.String _gapChar; + + /** + * Field _aligned + */ + private boolean _aligned; + + /** + * keeps track of state for field: _aligned + */ + private boolean _has_aligned; + + /** + * Field _sequenceList + */ + private java.util.Vector _sequenceList; + + /** + * Field _annotationList + */ + private java.util.Vector _annotationList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SequenceSet() { + super(); + _sequenceList = new Vector(); + _annotationList = new Vector(); + } //-- jalview.schemabinding.version2.SequenceSet() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addAnnotation + * + * + * + * @param vAnnotation + */ + public void addAnnotation(jalview.schemabinding.version2.Annotation vAnnotation) + throws java.lang.IndexOutOfBoundsException + { + _annotationList.addElement(vAnnotation); + } //-- void addAnnotation(jalview.schemabinding.version2.Annotation) + + /** + * Method addAnnotation + * + * + * + * @param index + * @param vAnnotation + */ + public void addAnnotation(int index, jalview.schemabinding.version2.Annotation vAnnotation) + throws java.lang.IndexOutOfBoundsException + { + _annotationList.insertElementAt(vAnnotation, index); + } //-- void addAnnotation(int, jalview.schemabinding.version2.Annotation) + + /** + * Method addSequence + * + * + * + * @param vSequence + */ + public void addSequence(jalview.schemabinding.version2.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + _sequenceList.addElement(vSequence); + } //-- void addSequence(jalview.schemabinding.version2.Sequence) + + /** + * Method addSequence + * + * + * + * @param index + * @param vSequence + */ + public void addSequence(int index, jalview.schemabinding.version2.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + _sequenceList.insertElementAt(vSequence, index); + } //-- void addSequence(int, jalview.schemabinding.version2.Sequence) + + /** + * Method deleteAligned + * + */ + public void deleteAligned() + { + this._has_aligned= false; + } //-- void deleteAligned() + + /** + * Method enumerateAnnotation + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAnnotation() + { + return _annotationList.elements(); + } //-- java.util.Enumeration enumerateAnnotation() + + /** + * Method enumerateSequence + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateSequence() + { + return _sequenceList.elements(); + } //-- java.util.Enumeration enumerateSequence() + + /** + * Returns the value of field 'aligned'. + * + * @return boolean + * @return the value of field 'aligned'. + */ + public boolean getAligned() + { + return this._aligned; + } //-- boolean getAligned() + + /** + * Method getAnnotation + * + * + * + * @param index + * @return Annotation + */ + public jalview.schemabinding.version2.Annotation getAnnotation(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _annotationList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.Annotation) _annotationList.elementAt(index); + } //-- jalview.schemabinding.version2.Annotation getAnnotation(int) + + /** + * Method getAnnotation + * + * + * + * @return Annotation + */ + public jalview.schemabinding.version2.Annotation[] getAnnotation() + { + int size = _annotationList.size(); + jalview.schemabinding.version2.Annotation[] mArray = new jalview.schemabinding.version2.Annotation[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.Annotation) _annotationList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.Annotation[] getAnnotation() + + /** + * Method getAnnotationCount + * + * + * + * @return int + */ + public int getAnnotationCount() + { + return _annotationList.size(); + } //-- int getAnnotationCount() + + /** + * Returns the value of field 'gapChar'. + * + * @return String + * @return the value of field 'gapChar'. + */ + public java.lang.String getGapChar() + { + return this._gapChar; + } //-- java.lang.String getGapChar() + + /** + * Method getSequence + * + * + * + * @param index + * @return Sequence + */ + public jalview.schemabinding.version2.Sequence getSequence(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _sequenceList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.Sequence) _sequenceList.elementAt(index); + } //-- jalview.schemabinding.version2.Sequence getSequence(int) + + /** + * Method getSequence + * + * + * + * @return Sequence + */ + public jalview.schemabinding.version2.Sequence[] getSequence() + { + int size = _sequenceList.size(); + jalview.schemabinding.version2.Sequence[] mArray = new jalview.schemabinding.version2.Sequence[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.Sequence) _sequenceList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.Sequence[] getSequence() + + /** + * Method getSequenceCount + * + * + * + * @return int + */ + public int getSequenceCount() + { + return _sequenceList.size(); + } //-- int getSequenceCount() + + /** + * Method hasAligned + * + * + * + * @return boolean + */ + public boolean hasAligned() + { + return this._has_aligned; + } //-- boolean hasAligned() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method removeAllAnnotation + * + */ + public void removeAllAnnotation() + { + _annotationList.removeAllElements(); + } //-- void removeAllAnnotation() + + /** + * Method removeAllSequence + * + */ + public void removeAllSequence() + { + _sequenceList.removeAllElements(); + } //-- void removeAllSequence() + + /** + * Method removeAnnotation + * + * + * + * @param index + * @return Annotation + */ + public jalview.schemabinding.version2.Annotation removeAnnotation(int index) + { + java.lang.Object obj = _annotationList.elementAt(index); + _annotationList.removeElementAt(index); + return (jalview.schemabinding.version2.Annotation) obj; + } //-- jalview.schemabinding.version2.Annotation removeAnnotation(int) + + /** + * Method removeSequence + * + * + * + * @param index + * @return Sequence + */ + public jalview.schemabinding.version2.Sequence removeSequence(int index) + { + java.lang.Object obj = _sequenceList.elementAt(index); + _sequenceList.removeElementAt(index); + return (jalview.schemabinding.version2.Sequence) obj; + } //-- jalview.schemabinding.version2.Sequence removeSequence(int) + + /** + * Sets the value of field 'aligned'. + * + * @param aligned the value of field 'aligned'. + */ + public void setAligned(boolean aligned) + { + this._aligned = aligned; + this._has_aligned = true; + } //-- void setAligned(boolean) + + /** + * Method setAnnotation + * + * + * + * @param index + * @param vAnnotation + */ + public void setAnnotation(int index, jalview.schemabinding.version2.Annotation vAnnotation) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _annotationList.size())) { + throw new IndexOutOfBoundsException(); + } + _annotationList.setElementAt(vAnnotation, index); + } //-- void setAnnotation(int, jalview.schemabinding.version2.Annotation) + + /** + * Method setAnnotation + * + * + * + * @param annotationArray + */ + public void setAnnotation(jalview.schemabinding.version2.Annotation[] annotationArray) + { + //-- copy array + _annotationList.removeAllElements(); + for (int i = 0; i < annotationArray.length; i++) { + _annotationList.addElement(annotationArray[i]); + } + } //-- void setAnnotation(jalview.schemabinding.version2.Annotation) + + /** + * Sets the value of field 'gapChar'. + * + * @param gapChar the value of field 'gapChar'. + */ + public void setGapChar(java.lang.String gapChar) + { + this._gapChar = gapChar; + } //-- void setGapChar(java.lang.String) + + /** + * Method setSequence + * + * + * + * @param index + * @param vSequence + */ + public void setSequence(int index, jalview.schemabinding.version2.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _sequenceList.size())) { + throw new IndexOutOfBoundsException(); + } + _sequenceList.setElementAt(vSequence, index); + } //-- void setSequence(int, jalview.schemabinding.version2.Sequence) + + /** + * Method setSequence + * + * + * + * @param sequenceArray + */ + public void setSequence(jalview.schemabinding.version2.Sequence[] sequenceArray) + { + //-- copy array + _sequenceList.removeAllElements(); + for (int i = 0; i < sequenceArray.length; i++) { + _sequenceList.addElement(sequenceArray[i]); + } + } //-- void setSequence(jalview.schemabinding.version2.Sequence) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.SequenceSet) Unmarshaller.unmarshal(jalview.schemabinding.version2.SequenceSet.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/SequenceSetDescriptor.java b/src/jalview/schemabinding/version2/SequenceSetDescriptor.java new file mode 100755 index 0000000..1e6c7b5 --- /dev/null +++ b/src/jalview/schemabinding/version2/SequenceSetDescriptor.java @@ -0,0 +1,323 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class SequenceSetDescriptor. + * + * @version $Revision$ $Date$ + */ +public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SequenceSetDescriptor() { + super(); + nsURI = "www.vamsas.ac.uk/jalview/version2"; + xmlName = "SequenceSet"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _gapChar + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_gapChar", "gapChar", 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 + { + SequenceSet target = (SequenceSet) object; + return target.getGapChar(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceSet target = (SequenceSet) object; + target.setGapChar( (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); + desc.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _gapChar + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _aligned + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_aligned", "aligned", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceSet target = (SequenceSet) object; + if(!target.hasAligned()) + return null; + return (target.getAligned() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceSet target = (SequenceSet) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteAligned(); + return; + } + target.setAligned( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _aligned + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _sequenceList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Sequence.class, "_sequenceList", "Sequence", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceSet target = (SequenceSet) object; + return target.getSequence(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceSet target = (SequenceSet) object; + target.addSequence( (jalview.schemabinding.version2.Sequence) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.Sequence(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _sequenceList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _annotationList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Annotation.class, "_annotationList", "Annotation", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceSet target = (SequenceSet) object; + return target.getAnnotation(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceSet target = (SequenceSet) object; + target.addAnnotation( (jalview.schemabinding.version2.Annotation) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.Annotation(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _annotationList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.SequenceSetDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.SequenceSet.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/SequenceType.java b/src/jalview/schemabinding/version2/SequenceType.java new file mode 100755 index 0000000..d413e2d --- /dev/null +++ b/src/jalview/schemabinding/version2/SequenceType.java @@ -0,0 +1,225 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class SequenceType. + * + * @version $Revision$ $Date$ + */ +public class SequenceType implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _id + */ + private java.lang.String _id; + + /** + * Field _description + */ + private java.lang.String _description; + + /** + * Field _sequence + */ + private java.lang.String _sequence; + + /** + * Field _name + */ + private java.lang.String _name; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SequenceType() { + super(); + } //-- jalview.schemabinding.version2.SequenceType() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Returns the value of field 'description'. + * + * @return String + * @return the value of field 'description'. + */ + public java.lang.String getDescription() + { + return this._description; + } //-- java.lang.String getDescription() + + /** + * 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 'name'. + * + * @return String + * @return the value of field 'name'. + */ + public java.lang.String getName() + { + return this._name; + } //-- java.lang.String getName() + + /** + * Returns the value of field 'sequence'. + * + * @return String + * @return the value of field 'sequence'. + */ + public java.lang.String getSequence() + { + return this._sequence; + } //-- java.lang.String getSequence() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'description'. + * + * @param description the value of field 'description'. + */ + public void setDescription(java.lang.String description) + { + this._description = description; + } //-- void setDescription(java.lang.String) + + /** + * 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 'name'. + * + * @param name the value of field 'name'. + */ + public void setName(java.lang.String name) + { + this._name = name; + } //-- void setName(java.lang.String) + + /** + * Sets the value of field 'sequence'. + * + * @param sequence the value of field 'sequence'. + */ + public void setSequence(java.lang.String sequence) + { + this._sequence = sequence; + } //-- void setSequence(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.SequenceType) Unmarshaller.unmarshal(jalview.schemabinding.version2.SequenceType.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/SequenceTypeDescriptor.java b/src/jalview/schemabinding/version2/SequenceTypeDescriptor.java new file mode 100755 index 0000000..9977ea3 --- /dev/null +++ b/src/jalview/schemabinding/version2/SequenceTypeDescriptor.java @@ -0,0 +1,325 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class SequenceTypeDescriptor. + * + * @version $Revision$ $Date$ + */ +public class SequenceTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SequenceTypeDescriptor() { + super(); + nsURI = "www.vamsas.ac.uk/jalview/version2"; + xmlName = "SequenceType"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _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 + { + SequenceType target = (SequenceType) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceType target = (SequenceType) 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); + //-- _description + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", 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 + { + SequenceType target = (SequenceType) object; + return target.getDescription(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceType target = (SequenceType) object; + target.setDescription( (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: _description + 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 + + //-- _sequence + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_sequence", "sequence", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceType target = (SequenceType) object; + return target.getSequence(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceType target = (SequenceType) object; + target.setSequence( (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); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _sequence + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _name + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceType target = (SequenceType) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceType target = (SequenceType) object; + target.setName( (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); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _name + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.SequenceTypeDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.SequenceType.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/Setting.java b/src/jalview/schemabinding/version2/Setting.java new file mode 100755 index 0000000..668ef9d --- /dev/null +++ b/src/jalview/schemabinding/version2/Setting.java @@ -0,0 +1,253 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Setting. + * + * @version $Revision$ $Date$ + */ +public class Setting implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _type + */ + private java.lang.String _type; + + /** + * Field _colour + */ + private int _colour; + + /** + * keeps track of state for field: _colour + */ + private boolean _has_colour; + + /** + * Field _display + */ + private boolean _display; + + /** + * keeps track of state for field: _display + */ + private boolean _has_display; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Setting() { + super(); + } //-- jalview.schemabinding.version2.Setting() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteColour + * + */ + public void deleteColour() + { + this._has_colour= false; + } //-- void deleteColour() + + /** + * Method deleteDisplay + * + */ + public void deleteDisplay() + { + this._has_display= false; + } //-- void deleteDisplay() + + /** + * Returns the value of field 'colour'. + * + * @return int + * @return the value of field 'colour'. + */ + public int getColour() + { + return this._colour; + } //-- int getColour() + + /** + * Returns the value of field 'display'. + * + * @return boolean + * @return the value of field 'display'. + */ + public boolean getDisplay() + { + return this._display; + } //-- boolean getDisplay() + + /** + * Returns the value of field 'type'. + * + * @return String + * @return the value of field 'type'. + */ + public java.lang.String getType() + { + return this._type; + } //-- java.lang.String getType() + + /** + * Method hasColour + * + * + * + * @return boolean + */ + public boolean hasColour() + { + return this._has_colour; + } //-- boolean hasColour() + + /** + * Method hasDisplay + * + * + * + * @return boolean + */ + public boolean hasDisplay() + { + return this._has_display; + } //-- boolean hasDisplay() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'colour'. + * + * @param colour the value of field 'colour'. + */ + public void setColour(int colour) + { + this._colour = colour; + this._has_colour = true; + } //-- void setColour(int) + + /** + * Sets the value of field 'display'. + * + * @param display the value of field 'display'. + */ + public void setDisplay(boolean display) + { + this._display = display; + this._has_display = true; + } //-- void setDisplay(boolean) + + /** + * Sets the value of field 'type'. + * + * @param type the value of field 'type'. + */ + public void setType(java.lang.String type) + { + this._type = type; + } //-- void setType(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Setting) Unmarshaller.unmarshal(jalview.schemabinding.version2.Setting.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/SettingDescriptor.java b/src/jalview/schemabinding/version2/SettingDescriptor.java new file mode 100755 index 0000000..6cadc16 --- /dev/null +++ b/src/jalview/schemabinding/version2/SettingDescriptor.java @@ -0,0 +1,290 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class SettingDescriptor. + * + * @version $Revision$ $Date$ + */ +public class SettingDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SettingDescriptor() { + super(); + nsURI = "www.jalview.org"; + xmlName = "setting"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _type + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", 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 + { + Setting target = (Setting) object; + return target.getType(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Setting target = (Setting) object; + target.setType( (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); + desc.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _type + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _colour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_colour", "colour", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Setting target = (Setting) object; + if(!target.hasColour()) + return null; + return new java.lang.Integer(target.getColour()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Setting target = (Setting) object; + // ignore null values for non optional primitives + if (value == null) return; + + target.setColour( ((java.lang.Integer)value).intValue()); + } + 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.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _colour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _display + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_display", "display", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Setting target = (Setting) object; + if(!target.hasDisplay()) + return null; + return (target.getDisplay() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Setting target = (Setting) object; + // ignore null values for non optional primitives + if (value == null) return; + + target.setDisplay( ((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.setRequired(true); + addFieldDescriptor(desc); + + //-- validation code for: _display + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } //-- jalview.schemabinding.version2.SettingDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Setting.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/Tree.java b/src/jalview/schemabinding/version2/Tree.java new file mode 100755 index 0000000..96b2e18 --- /dev/null +++ b/src/jalview/schemabinding/version2/Tree.java @@ -0,0 +1,835 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Tree. + * + * @version $Revision$ $Date$ + */ +public class Tree implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _width + */ + private int _width; + + /** + * keeps track of state for field: _width + */ + private boolean _has_width; + + /** + * Field _height + */ + private int _height; + + /** + * keeps track of state for field: _height + */ + private boolean _has_height; + + /** + * Field _xpos + */ + private int _xpos; + + /** + * keeps track of state for field: _xpos + */ + private boolean _has_xpos; + + /** + * Field _ypos + */ + private int _ypos; + + /** + * keeps track of state for field: _ypos + */ + private boolean _has_ypos; + + /** + * Field _fontName + */ + private java.lang.String _fontName; + + /** + * Field _fontSize + */ + private int _fontSize; + + /** + * keeps track of state for field: _fontSize + */ + private boolean _has_fontSize; + + /** + * Field _fontStyle + */ + private int _fontStyle; + + /** + * keeps track of state for field: _fontStyle + */ + private boolean _has_fontStyle; + + /** + * Field _threshold + */ + private float _threshold; + + /** + * keeps track of state for field: _threshold + */ + private boolean _has_threshold; + + /** + * Field _showBootstrap + */ + private boolean _showBootstrap; + + /** + * keeps track of state for field: _showBootstrap + */ + private boolean _has_showBootstrap; + + /** + * Field _showDistances + */ + private boolean _showDistances; + + /** + * keeps track of state for field: _showDistances + */ + private boolean _has_showDistances; + + /** + * Field _markUnlinked + */ + private boolean _markUnlinked; + + /** + * keeps track of state for field: _markUnlinked + */ + private boolean _has_markUnlinked; + + /** + * Field _fitToWindow + */ + private boolean _fitToWindow; + + /** + * keeps track of state for field: _fitToWindow + */ + private boolean _has_fitToWindow; + + /** + * Field _currentTree + */ + private boolean _currentTree; + + /** + * keeps track of state for field: _currentTree + */ + private boolean _has_currentTree; + + /** + * Field _title + */ + private java.lang.String _title; + + /** + * Field _newick + */ + private java.lang.String _newick; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Tree() { + super(); + } //-- jalview.schemabinding.version2.Tree() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteCurrentTree + * + */ + public void deleteCurrentTree() + { + this._has_currentTree= false; + } //-- void deleteCurrentTree() + + /** + * Method deleteFitToWindow + * + */ + public void deleteFitToWindow() + { + this._has_fitToWindow= false; + } //-- void deleteFitToWindow() + + /** + * Method deleteFontSize + * + */ + public void deleteFontSize() + { + this._has_fontSize= false; + } //-- void deleteFontSize() + + /** + * Method deleteFontStyle + * + */ + public void deleteFontStyle() + { + this._has_fontStyle= false; + } //-- void deleteFontStyle() + + /** + * Method deleteHeight + * + */ + public void deleteHeight() + { + this._has_height= false; + } //-- void deleteHeight() + + /** + * Method deleteMarkUnlinked + * + */ + public void deleteMarkUnlinked() + { + this._has_markUnlinked= false; + } //-- void deleteMarkUnlinked() + + /** + * Method deleteShowBootstrap + * + */ + public void deleteShowBootstrap() + { + this._has_showBootstrap= false; + } //-- void deleteShowBootstrap() + + /** + * Method deleteShowDistances + * + */ + public void deleteShowDistances() + { + this._has_showDistances= false; + } //-- void deleteShowDistances() + + /** + * Method deleteThreshold + * + */ + public void deleteThreshold() + { + this._has_threshold= false; + } //-- void deleteThreshold() + + /** + * Method deleteWidth + * + */ + public void deleteWidth() + { + this._has_width= false; + } //-- void deleteWidth() + + /** + * Method deleteXpos + * + */ + public void deleteXpos() + { + this._has_xpos= false; + } //-- void deleteXpos() + + /** + * Method deleteYpos + * + */ + public void deleteYpos() + { + this._has_ypos= false; + } //-- void deleteYpos() + + /** + * Returns the value of field 'currentTree'. + * + * @return boolean + * @return the value of field 'currentTree'. + */ + public boolean getCurrentTree() + { + return this._currentTree; + } //-- boolean getCurrentTree() + + /** + * Returns the value of field 'fitToWindow'. + * + * @return boolean + * @return the value of field 'fitToWindow'. + */ + public boolean getFitToWindow() + { + return this._fitToWindow; + } //-- boolean getFitToWindow() + + /** + * Returns the value of field 'fontName'. + * + * @return String + * @return the value of field 'fontName'. + */ + public java.lang.String getFontName() + { + return this._fontName; + } //-- java.lang.String getFontName() + + /** + * Returns the value of field 'fontSize'. + * + * @return int + * @return the value of field 'fontSize'. + */ + public int getFontSize() + { + return this._fontSize; + } //-- int getFontSize() + + /** + * Returns the value of field 'fontStyle'. + * + * @return int + * @return the value of field 'fontStyle'. + */ + public int getFontStyle() + { + return this._fontStyle; + } //-- int getFontStyle() + + /** + * Returns the value of field 'height'. + * + * @return int + * @return the value of field 'height'. + */ + public int getHeight() + { + return this._height; + } //-- int getHeight() + + /** + * Returns the value of field 'markUnlinked'. + * + * @return boolean + * @return the value of field 'markUnlinked'. + */ + public boolean getMarkUnlinked() + { + return this._markUnlinked; + } //-- boolean getMarkUnlinked() + + /** + * Returns the value of field 'newick'. + * + * @return String + * @return the value of field 'newick'. + */ + public java.lang.String getNewick() + { + return this._newick; + } //-- java.lang.String getNewick() + + /** + * Returns the value of field 'showBootstrap'. + * + * @return boolean + * @return the value of field 'showBootstrap'. + */ + public boolean getShowBootstrap() + { + return this._showBootstrap; + } //-- boolean getShowBootstrap() + + /** + * Returns the value of field 'showDistances'. + * + * @return boolean + * @return the value of field 'showDistances'. + */ + public boolean getShowDistances() + { + return this._showDistances; + } //-- boolean getShowDistances() + + /** + * Returns the value of field 'threshold'. + * + * @return float + * @return the value of field 'threshold'. + */ + public float getThreshold() + { + return this._threshold; + } //-- float getThreshold() + + /** + * Returns the value of field 'title'. + * + * @return String + * @return the value of field 'title'. + */ + public java.lang.String getTitle() + { + return this._title; + } //-- java.lang.String getTitle() + + /** + * Returns the value of field 'width'. + * + * @return int + * @return the value of field 'width'. + */ + public int getWidth() + { + return this._width; + } //-- int getWidth() + + /** + * Returns the value of field 'xpos'. + * + * @return int + * @return the value of field 'xpos'. + */ + public int getXpos() + { + return this._xpos; + } //-- int getXpos() + + /** + * Returns the value of field 'ypos'. + * + * @return int + * @return the value of field 'ypos'. + */ + public int getYpos() + { + return this._ypos; + } //-- int getYpos() + + /** + * Method hasCurrentTree + * + * + * + * @return boolean + */ + public boolean hasCurrentTree() + { + return this._has_currentTree; + } //-- boolean hasCurrentTree() + + /** + * Method hasFitToWindow + * + * + * + * @return boolean + */ + public boolean hasFitToWindow() + { + return this._has_fitToWindow; + } //-- boolean hasFitToWindow() + + /** + * Method hasFontSize + * + * + * + * @return boolean + */ + public boolean hasFontSize() + { + return this._has_fontSize; + } //-- boolean hasFontSize() + + /** + * Method hasFontStyle + * + * + * + * @return boolean + */ + public boolean hasFontStyle() + { + return this._has_fontStyle; + } //-- boolean hasFontStyle() + + /** + * Method hasHeight + * + * + * + * @return boolean + */ + public boolean hasHeight() + { + return this._has_height; + } //-- boolean hasHeight() + + /** + * Method hasMarkUnlinked + * + * + * + * @return boolean + */ + public boolean hasMarkUnlinked() + { + return this._has_markUnlinked; + } //-- boolean hasMarkUnlinked() + + /** + * Method hasShowBootstrap + * + * + * + * @return boolean + */ + public boolean hasShowBootstrap() + { + return this._has_showBootstrap; + } //-- boolean hasShowBootstrap() + + /** + * Method hasShowDistances + * + * + * + * @return boolean + */ + public boolean hasShowDistances() + { + return this._has_showDistances; + } //-- boolean hasShowDistances() + + /** + * Method hasThreshold + * + * + * + * @return boolean + */ + public boolean hasThreshold() + { + return this._has_threshold; + } //-- boolean hasThreshold() + + /** + * Method hasWidth + * + * + * + * @return boolean + */ + public boolean hasWidth() + { + return this._has_width; + } //-- boolean hasWidth() + + /** + * Method hasXpos + * + * + * + * @return boolean + */ + public boolean hasXpos() + { + return this._has_xpos; + } //-- boolean hasXpos() + + /** + * Method hasYpos + * + * + * + * @return boolean + */ + public boolean hasYpos() + { + return this._has_ypos; + } //-- boolean hasYpos() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'currentTree'. + * + * @param currentTree the value of field 'currentTree'. + */ + public void setCurrentTree(boolean currentTree) + { + this._currentTree = currentTree; + this._has_currentTree = true; + } //-- void setCurrentTree(boolean) + + /** + * Sets the value of field 'fitToWindow'. + * + * @param fitToWindow the value of field 'fitToWindow'. + */ + public void setFitToWindow(boolean fitToWindow) + { + this._fitToWindow = fitToWindow; + this._has_fitToWindow = true; + } //-- void setFitToWindow(boolean) + + /** + * Sets the value of field 'fontName'. + * + * @param fontName the value of field 'fontName'. + */ + public void setFontName(java.lang.String fontName) + { + this._fontName = fontName; + } //-- void setFontName(java.lang.String) + + /** + * Sets the value of field 'fontSize'. + * + * @param fontSize the value of field 'fontSize'. + */ + public void setFontSize(int fontSize) + { + this._fontSize = fontSize; + this._has_fontSize = true; + } //-- void setFontSize(int) + + /** + * Sets the value of field 'fontStyle'. + * + * @param fontStyle the value of field 'fontStyle'. + */ + public void setFontStyle(int fontStyle) + { + this._fontStyle = fontStyle; + this._has_fontStyle = true; + } //-- void setFontStyle(int) + + /** + * Sets the value of field 'height'. + * + * @param height the value of field 'height'. + */ + public void setHeight(int height) + { + this._height = height; + this._has_height = true; + } //-- void setHeight(int) + + /** + * Sets the value of field 'markUnlinked'. + * + * @param markUnlinked the value of field 'markUnlinked'. + */ + public void setMarkUnlinked(boolean markUnlinked) + { + this._markUnlinked = markUnlinked; + this._has_markUnlinked = true; + } //-- void setMarkUnlinked(boolean) + + /** + * Sets the value of field 'newick'. + * + * @param newick the value of field 'newick'. + */ + public void setNewick(java.lang.String newick) + { + this._newick = newick; + } //-- void setNewick(java.lang.String) + + /** + * Sets the value of field 'showBootstrap'. + * + * @param showBootstrap the value of field 'showBootstrap'. + */ + public void setShowBootstrap(boolean showBootstrap) + { + this._showBootstrap = showBootstrap; + this._has_showBootstrap = true; + } //-- void setShowBootstrap(boolean) + + /** + * Sets the value of field 'showDistances'. + * + * @param showDistances the value of field 'showDistances'. + */ + public void setShowDistances(boolean showDistances) + { + this._showDistances = showDistances; + this._has_showDistances = true; + } //-- void setShowDistances(boolean) + + /** + * Sets the value of field 'threshold'. + * + * @param threshold the value of field 'threshold'. + */ + public void setThreshold(float threshold) + { + this._threshold = threshold; + this._has_threshold = true; + } //-- void setThreshold(float) + + /** + * Sets the value of field 'title'. + * + * @param title the value of field 'title'. + */ + public void setTitle(java.lang.String title) + { + this._title = title; + } //-- void setTitle(java.lang.String) + + /** + * Sets the value of field 'width'. + * + * @param width the value of field 'width'. + */ + public void setWidth(int width) + { + this._width = width; + this._has_width = true; + } //-- void setWidth(int) + + /** + * Sets the value of field 'xpos'. + * + * @param xpos the value of field 'xpos'. + */ + public void setXpos(int xpos) + { + this._xpos = xpos; + this._has_xpos = true; + } //-- void setXpos(int) + + /** + * Sets the value of field 'ypos'. + * + * @param ypos the value of field 'ypos'. + */ + public void setYpos(int ypos) + { + this._ypos = ypos; + this._has_ypos = true; + } //-- void setYpos(int) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Tree) Unmarshaller.unmarshal(jalview.schemabinding.version2.Tree.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/TreeDescriptor.java b/src/jalview/schemabinding/version2/TreeDescriptor.java new file mode 100755 index 0000000..5232c12 --- /dev/null +++ b/src/jalview/schemabinding/version2/TreeDescriptor.java @@ -0,0 +1,777 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class TreeDescriptor. + * + * @version $Revision$ $Date$ + */ +public class TreeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public TreeDescriptor() { + super(); + nsURI = "www.jalview.org"; + xmlName = "tree"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _width + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_width", "width", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasWidth()) + return null; + return new java.lang.Integer(target.getWidth()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteWidth(); + return; + } + target.setWidth( ((java.lang.Integer)value).intValue()); + } + 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: _width + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _height + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_height", "height", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasHeight()) + return null; + return new java.lang.Integer(target.getHeight()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteHeight(); + return; + } + target.setHeight( ((java.lang.Integer)value).intValue()); + } + 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: _height + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _xpos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_xpos", "xpos", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasXpos()) + return null; + return new java.lang.Integer(target.getXpos()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteXpos(); + return; + } + target.setXpos( ((java.lang.Integer)value).intValue()); + } + 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: _xpos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _ypos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_ypos", "ypos", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasYpos()) + return null; + return new java.lang.Integer(target.getYpos()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteYpos(); + return; + } + target.setYpos( ((java.lang.Integer)value).intValue()); + } + 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: _ypos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _fontName + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_fontName", "fontName", 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 + { + Tree target = (Tree) object; + return target.getFontName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + target.setFontName( (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: _fontName + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _fontSize + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_fontSize", "fontSize", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasFontSize()) + return null; + return new java.lang.Integer(target.getFontSize()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteFontSize(); + return; + } + target.setFontSize( ((java.lang.Integer)value).intValue()); + } + 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: _fontSize + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _fontStyle + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_fontStyle", "fontStyle", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasFontStyle()) + return null; + return new java.lang.Integer(target.getFontStyle()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteFontStyle(); + return; + } + target.setFontStyle( ((java.lang.Integer)value).intValue()); + } + 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: _fontStyle + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _threshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_threshold", "threshold", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasThreshold()) + return null; + return new java.lang.Float(target.getThreshold()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteThreshold(); + return; + } + target.setThreshold( ((java.lang.Float)value).floatValue()); + } + 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: _threshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + FloatValidator typeValidator = new FloatValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _showBootstrap + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showBootstrap", "showBootstrap", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasShowBootstrap()) + return null; + return (target.getShowBootstrap() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowBootstrap(); + return; + } + target.setShowBootstrap( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _showBootstrap + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _showDistances + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showDistances", "showDistances", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasShowDistances()) + return null; + return (target.getShowDistances() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowDistances(); + return; + } + target.setShowDistances( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _showDistances + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _markUnlinked + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_markUnlinked", "markUnlinked", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasMarkUnlinked()) + return null; + return (target.getMarkUnlinked() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteMarkUnlinked(); + return; + } + target.setMarkUnlinked( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _markUnlinked + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _fitToWindow + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_fitToWindow", "fitToWindow", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasFitToWindow()) + return null; + return (target.getFitToWindow() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteFitToWindow(); + return; + } + target.setFitToWindow( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _fitToWindow + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _currentTree + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_currentTree", "currentTree", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasCurrentTree()) + return null; + return (target.getCurrentTree() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteCurrentTree(); + return; + } + target.setCurrentTree( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _currentTree + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _title + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + return target.getTitle(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + target.setTitle( (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); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _title + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _newick + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_newick", "newick", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + return target.getNewick(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + target.setNewick( (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); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _newick + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.TreeDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Tree.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/UserColourScheme.java b/src/jalview/schemabinding/version2/UserColourScheme.java new file mode 100755 index 0000000..00bc181 --- /dev/null +++ b/src/jalview/schemabinding/version2/UserColourScheme.java @@ -0,0 +1,118 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class UserColourScheme. + * + * @version $Revision$ $Date$ + */ +public class UserColourScheme extends JalviewUserColours +implements java.io.Serializable +{ + + + //----------------/ + //- Constructors -/ + //----------------/ + + public UserColourScheme() { + super(); + } //-- jalview.schemabinding.version2.UserColourScheme() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.UserColourScheme) Unmarshaller.unmarshal(jalview.schemabinding.version2.UserColourScheme.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/UserColourSchemeDescriptor.java b/src/jalview/schemabinding/version2/UserColourSchemeDescriptor.java new file mode 100755 index 0000000..cf86a11 --- /dev/null +++ b/src/jalview/schemabinding/version2/UserColourSchemeDescriptor.java @@ -0,0 +1,166 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class UserColourSchemeDescriptor. + * + * @version $Revision$ $Date$ + */ +public class UserColourSchemeDescriptor extends JalviewUserColoursDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public UserColourSchemeDescriptor() { + super(); + setExtendsWithoutFlatten(new JalviewUserColoursDescriptor()); + nsURI = "www.jalview.org"; + xmlName = "UserColourScheme"; + } //-- jalview.schemabinding.version2.UserColourSchemeDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return super.getExtends(); + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + if (identity == null) + return super.getIdentity(); + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.UserColourScheme.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/UserColours.java b/src/jalview/schemabinding/version2/UserColours.java new file mode 100755 index 0000000..28f2b39 --- /dev/null +++ b/src/jalview/schemabinding/version2/UserColours.java @@ -0,0 +1,173 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class UserColours. + * + * @version $Revision$ $Date$ + */ +public class UserColours implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _id + */ + private java.lang.String _id; + + /** + * Field _userColourScheme + */ + private jalview.schemabinding.version2.UserColourScheme _userColourScheme; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public UserColours() { + super(); + } //-- jalview.schemabinding.version2.UserColours() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * 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 'userColourScheme'. + * + * @return UserColourScheme + * @return the value of field 'userColourScheme'. + */ + public jalview.schemabinding.version2.UserColourScheme getUserColourScheme() + { + return this._userColourScheme; + } //-- jalview.schemabinding.version2.UserColourScheme getUserColourScheme() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * 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 'userColourScheme'. + * + * @param userColourScheme the value of field 'userColourScheme' + */ + public void setUserColourScheme(jalview.schemabinding.version2.UserColourScheme userColourScheme) + { + this._userColourScheme = userColourScheme; + } //-- void setUserColourScheme(jalview.schemabinding.version2.UserColourScheme) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.UserColours) Unmarshaller.unmarshal(jalview.schemabinding.version2.UserColours.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/UserColoursDescriptor.java b/src/jalview/schemabinding/version2/UserColoursDescriptor.java new file mode 100755 index 0000000..6c42d0b --- /dev/null +++ b/src/jalview/schemabinding/version2/UserColoursDescriptor.java @@ -0,0 +1,245 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class UserColoursDescriptor. + * + * @version $Revision$ $Date$ + */ +public class UserColoursDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public UserColoursDescriptor() { + super(); + nsURI = "www.jalview.org"; + xmlName = "UserColours"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _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 + { + UserColours target = (UserColours) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + UserColours target = (UserColours) 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 + + //-- _userColourScheme + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.UserColourScheme.class, "_userColourScheme", "UserColourScheme", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + UserColours target = (UserColours) object; + return target.getUserColourScheme(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + UserColours target = (UserColours) object; + target.setUserColourScheme( (jalview.schemabinding.version2.UserColourScheme) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.UserColourScheme(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _userColourScheme + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.UserColoursDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.UserColours.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/VAMSAS.java b/src/jalview/schemabinding/version2/VAMSAS.java new file mode 100755 index 0000000..9550690 --- /dev/null +++ b/src/jalview/schemabinding/version2/VAMSAS.java @@ -0,0 +1,576 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import java.util.Enumeration; +import java.util.Vector; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class VAMSAS. + * + * @version $Revision$ $Date$ + */ +public class VAMSAS implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _alignmentList + */ + private java.util.Vector _alignmentList; + + /** + * Field _treeList + */ + private java.util.Vector _treeList; + + /** + * Field _sequenceSetList + */ + private java.util.Vector _sequenceSetList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public VAMSAS() { + super(); + _alignmentList = new Vector(); + _treeList = new Vector(); + _sequenceSetList = new Vector(); + } //-- jalview.schemabinding.version2.VAMSAS() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addAlignment + * + * + * + * @param vAlignment + */ + public void addAlignment(jalview.schemabinding.version2.Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException + { + _alignmentList.addElement(vAlignment); + } //-- void addAlignment(jalview.schemabinding.version2.Alignment) + + /** + * Method addAlignment + * + * + * + * @param index + * @param vAlignment + */ + public void addAlignment(int index, jalview.schemabinding.version2.Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException + { + _alignmentList.insertElementAt(vAlignment, index); + } //-- void addAlignment(int, jalview.schemabinding.version2.Alignment) + + /** + * Method addSequenceSet + * + * + * + * @param vSequenceSet + */ + public void addSequenceSet(jalview.schemabinding.version2.SequenceSet vSequenceSet) + throws java.lang.IndexOutOfBoundsException + { + _sequenceSetList.addElement(vSequenceSet); + } //-- void addSequenceSet(jalview.schemabinding.version2.SequenceSet) + + /** + * Method addSequenceSet + * + * + * + * @param index + * @param vSequenceSet + */ + public void addSequenceSet(int index, jalview.schemabinding.version2.SequenceSet vSequenceSet) + throws java.lang.IndexOutOfBoundsException + { + _sequenceSetList.insertElementAt(vSequenceSet, index); + } //-- void addSequenceSet(int, jalview.schemabinding.version2.SequenceSet) + + /** + * Method addTree + * + * + * + * @param vTree + */ + public void addTree(java.lang.String vTree) + throws java.lang.IndexOutOfBoundsException + { + _treeList.addElement(vTree); + } //-- void addTree(java.lang.String) + + /** + * Method addTree + * + * + * + * @param index + * @param vTree + */ + public void addTree(int index, java.lang.String vTree) + throws java.lang.IndexOutOfBoundsException + { + _treeList.insertElementAt(vTree, index); + } //-- void addTree(int, java.lang.String) + + /** + * Method enumerateAlignment + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAlignment() + { + return _alignmentList.elements(); + } //-- java.util.Enumeration enumerateAlignment() + + /** + * Method enumerateSequenceSet + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateSequenceSet() + { + return _sequenceSetList.elements(); + } //-- java.util.Enumeration enumerateSequenceSet() + + /** + * Method enumerateTree + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateTree() + { + return _treeList.elements(); + } //-- java.util.Enumeration enumerateTree() + + /** + * Method getAlignment + * + * + * + * @param index + * @return Alignment + */ + public jalview.schemabinding.version2.Alignment getAlignment(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _alignmentList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.Alignment) _alignmentList.elementAt(index); + } //-- jalview.schemabinding.version2.Alignment getAlignment(int) + + /** + * Method getAlignment + * + * + * + * @return Alignment + */ + public jalview.schemabinding.version2.Alignment[] getAlignment() + { + int size = _alignmentList.size(); + jalview.schemabinding.version2.Alignment[] mArray = new jalview.schemabinding.version2.Alignment[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.Alignment) _alignmentList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.Alignment[] getAlignment() + + /** + * Method getAlignmentCount + * + * + * + * @return int + */ + public int getAlignmentCount() + { + return _alignmentList.size(); + } //-- int getAlignmentCount() + + /** + * Method getSequenceSet + * + * + * + * @param index + * @return SequenceSet + */ + public jalview.schemabinding.version2.SequenceSet getSequenceSet(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _sequenceSetList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (jalview.schemabinding.version2.SequenceSet) _sequenceSetList.elementAt(index); + } //-- jalview.schemabinding.version2.SequenceSet getSequenceSet(int) + + /** + * Method getSequenceSet + * + * + * + * @return SequenceSet + */ + public jalview.schemabinding.version2.SequenceSet[] getSequenceSet() + { + int size = _sequenceSetList.size(); + jalview.schemabinding.version2.SequenceSet[] mArray = new jalview.schemabinding.version2.SequenceSet[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (jalview.schemabinding.version2.SequenceSet) _sequenceSetList.elementAt(index); + } + return mArray; + } //-- jalview.schemabinding.version2.SequenceSet[] getSequenceSet() + + /** + * Method getSequenceSetCount + * + * + * + * @return int + */ + public int getSequenceSetCount() + { + return _sequenceSetList.size(); + } //-- int getSequenceSetCount() + + /** + * Method getTree + * + * + * + * @param index + * @return String + */ + public java.lang.String getTree(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _treeList.size())) { + throw new IndexOutOfBoundsException(); + } + + return (String)_treeList.elementAt(index); + } //-- java.lang.String getTree(int) + + /** + * Method getTree + * + * + * + * @return String + */ + public java.lang.String[] getTree() + { + int size = _treeList.size(); + java.lang.String[] mArray = new java.lang.String[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (String)_treeList.elementAt(index); + } + return mArray; + } //-- java.lang.String[] getTree() + + /** + * Method getTreeCount + * + * + * + * @return int + */ + public int getTreeCount() + { + return _treeList.size(); + } //-- int getTreeCount() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method removeAlignment + * + * + * + * @param index + * @return Alignment + */ + public jalview.schemabinding.version2.Alignment removeAlignment(int index) + { + java.lang.Object obj = _alignmentList.elementAt(index); + _alignmentList.removeElementAt(index); + return (jalview.schemabinding.version2.Alignment) obj; + } //-- jalview.schemabinding.version2.Alignment removeAlignment(int) + + /** + * Method removeAllAlignment + * + */ + public void removeAllAlignment() + { + _alignmentList.removeAllElements(); + } //-- void removeAllAlignment() + + /** + * Method removeAllSequenceSet + * + */ + public void removeAllSequenceSet() + { + _sequenceSetList.removeAllElements(); + } //-- void removeAllSequenceSet() + + /** + * Method removeAllTree + * + */ + public void removeAllTree() + { + _treeList.removeAllElements(); + } //-- void removeAllTree() + + /** + * Method removeSequenceSet + * + * + * + * @param index + * @return SequenceSet + */ + public jalview.schemabinding.version2.SequenceSet removeSequenceSet(int index) + { + java.lang.Object obj = _sequenceSetList.elementAt(index); + _sequenceSetList.removeElementAt(index); + return (jalview.schemabinding.version2.SequenceSet) obj; + } //-- jalview.schemabinding.version2.SequenceSet removeSequenceSet(int) + + /** + * Method removeTree + * + * + * + * @param index + * @return String + */ + public java.lang.String removeTree(int index) + { + java.lang.Object obj = _treeList.elementAt(index); + _treeList.removeElementAt(index); + return (String)obj; + } //-- java.lang.String removeTree(int) + + /** + * Method setAlignment + * + * + * + * @param index + * @param vAlignment + */ + public void setAlignment(int index, jalview.schemabinding.version2.Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _alignmentList.size())) { + throw new IndexOutOfBoundsException(); + } + _alignmentList.setElementAt(vAlignment, index); + } //-- void setAlignment(int, jalview.schemabinding.version2.Alignment) + + /** + * Method setAlignment + * + * + * + * @param alignmentArray + */ + public void setAlignment(jalview.schemabinding.version2.Alignment[] alignmentArray) + { + //-- copy array + _alignmentList.removeAllElements(); + for (int i = 0; i < alignmentArray.length; i++) { + _alignmentList.addElement(alignmentArray[i]); + } + } //-- void setAlignment(jalview.schemabinding.version2.Alignment) + + /** + * Method setSequenceSet + * + * + * + * @param index + * @param vSequenceSet + */ + public void setSequenceSet(int index, jalview.schemabinding.version2.SequenceSet vSequenceSet) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _sequenceSetList.size())) { + throw new IndexOutOfBoundsException(); + } + _sequenceSetList.setElementAt(vSequenceSet, index); + } //-- void setSequenceSet(int, jalview.schemabinding.version2.SequenceSet) + + /** + * Method setSequenceSet + * + * + * + * @param sequenceSetArray + */ + public void setSequenceSet(jalview.schemabinding.version2.SequenceSet[] sequenceSetArray) + { + //-- copy array + _sequenceSetList.removeAllElements(); + for (int i = 0; i < sequenceSetArray.length; i++) { + _sequenceSetList.addElement(sequenceSetArray[i]); + } + } //-- void setSequenceSet(jalview.schemabinding.version2.SequenceSet) + + /** + * Method setTree + * + * + * + * @param index + * @param vTree + */ + public void setTree(int index, java.lang.String vTree) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _treeList.size())) { + throw new IndexOutOfBoundsException(); + } + _treeList.setElementAt(vTree, index); + } //-- void setTree(int, java.lang.String) + + /** + * Method setTree + * + * + * + * @param treeArray + */ + public void setTree(java.lang.String[] treeArray) + { + //-- copy array + _treeList.removeAllElements(); + for (int i = 0; i < treeArray.length; i++) { + _treeList.addElement(treeArray[i]); + } + } //-- void setTree(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.VAMSAS) Unmarshaller.unmarshal(jalview.schemabinding.version2.VAMSAS.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/VAMSASDescriptor.java b/src/jalview/schemabinding/version2/VAMSASDescriptor.java new file mode 100755 index 0000000..02140e0 --- /dev/null +++ b/src/jalview/schemabinding/version2/VAMSASDescriptor.java @@ -0,0 +1,282 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class VAMSASDescriptor. + * + * @version $Revision$ $Date$ + */ +public class VAMSASDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public VAMSASDescriptor() { + super(); + nsURI = "www.vamsas.ac.uk/jalview/version2"; + xmlName = "VAMSAS"; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- initialize element descriptors + + //-- _alignmentList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Alignment.class, "_alignmentList", "Alignment", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VAMSAS target = (VAMSAS) object; + return target.getAlignment(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VAMSAS target = (VAMSAS) object; + target.addAlignment( (jalview.schemabinding.version2.Alignment) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.Alignment(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _alignmentList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _treeList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_treeList", "Tree", org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VAMSAS target = (VAMSAS) object; + return target.getTree(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VAMSAS target = (VAMSAS) object; + target.addTree( (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); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _treeList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _sequenceSetList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.SequenceSet.class, "_sequenceSetList", "SequenceSet", org.exolab.castor.xml.NodeType.Element); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VAMSAS target = (VAMSAS) object; + return target.getSequenceSet(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VAMSAS target = (VAMSAS) object; + target.addSequenceSet( (jalview.schemabinding.version2.SequenceSet) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new jalview.schemabinding.version2.SequenceSet(); + } + } ); + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _sequenceSetList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- jalview.schemabinding.version2.VAMSASDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.VAMSAS.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/VamsasModel.java b/src/jalview/schemabinding/version2/VamsasModel.java new file mode 100755 index 0000000..4617903 --- /dev/null +++ b/src/jalview/schemabinding/version2/VamsasModel.java @@ -0,0 +1,118 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class VamsasModel. + * + * @version $Revision$ $Date$ + */ +public class VamsasModel extends VAMSAS +implements java.io.Serializable +{ + + + //----------------/ + //- Constructors -/ + //----------------/ + + public VamsasModel() { + super(); + } //-- jalview.schemabinding.version2.VamsasModel() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.VamsasModel) Unmarshaller.unmarshal(jalview.schemabinding.version2.VamsasModel.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/VamsasModelDescriptor.java b/src/jalview/schemabinding/version2/VamsasModelDescriptor.java new file mode 100755 index 0000000..e40d9c8 --- /dev/null +++ b/src/jalview/schemabinding/version2/VamsasModelDescriptor.java @@ -0,0 +1,166 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class VamsasModelDescriptor. + * + * @version $Revision$ $Date$ + */ +public class VamsasModelDescriptor extends VAMSASDescriptor { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public VamsasModelDescriptor() { + super(); + setExtendsWithoutFlatten(new VAMSASDescriptor()); + nsURI = "www.jalview.org"; + xmlName = "vamsasModel"; + } //-- jalview.schemabinding.version2.VamsasModelDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return super.getExtends(); + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + if (identity == null) + return super.getIdentity(); + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.VamsasModel.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/jalview/schemabinding/version2/Viewport.java b/src/jalview/schemabinding/version2/Viewport.java new file mode 100755 index 0000000..4e6747e --- /dev/null +++ b/src/jalview/schemabinding/version2/Viewport.java @@ -0,0 +1,1420 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class Viewport. + * + * @version $Revision$ $Date$ + */ +public class Viewport implements java.io.Serializable { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _conservationSelected + */ + private boolean _conservationSelected; + + /** + * keeps track of state for field: _conservationSelected + */ + private boolean _has_conservationSelected; + + /** + * Field _pidSelected + */ + private boolean _pidSelected; + + /** + * keeps track of state for field: _pidSelected + */ + private boolean _has_pidSelected; + + /** + * Field _bgColour + */ + private java.lang.String _bgColour; + + /** + * Field _consThreshold + */ + private int _consThreshold; + + /** + * keeps track of state for field: _consThreshold + */ + private boolean _has_consThreshold; + + /** + * Field _pidThreshold + */ + private int _pidThreshold; + + /** + * keeps track of state for field: _pidThreshold + */ + private boolean _has_pidThreshold; + + /** + * Field _title + */ + private java.lang.String _title; + + /** + * Field _showFullId + */ + private boolean _showFullId; + + /** + * keeps track of state for field: _showFullId + */ + private boolean _has_showFullId; + + /** + * Field _showText + */ + private boolean _showText; + + /** + * keeps track of state for field: _showText + */ + private boolean _has_showText; + + /** + * Field _showColourText + */ + private boolean _showColourText; + + /** + * keeps track of state for field: _showColourText + */ + private boolean _has_showColourText; + + /** + * Field _showBoxes + */ + private boolean _showBoxes; + + /** + * keeps track of state for field: _showBoxes + */ + private boolean _has_showBoxes; + + /** + * Field _wrapAlignment + */ + private boolean _wrapAlignment; + + /** + * keeps track of state for field: _wrapAlignment + */ + private boolean _has_wrapAlignment; + + /** + * Field _renderGaps + */ + private boolean _renderGaps; + + /** + * keeps track of state for field: _renderGaps + */ + private boolean _has_renderGaps; + + /** + * Field _showSequenceFeatures + */ + private boolean _showSequenceFeatures; + + /** + * keeps track of state for field: _showSequenceFeatures + */ + private boolean _has_showSequenceFeatures; + + /** + * Field _showAnnotation + */ + private boolean _showAnnotation; + + /** + * keeps track of state for field: _showAnnotation + */ + private boolean _has_showAnnotation; + + /** + * Field _showConservation + */ + private boolean _showConservation; + + /** + * keeps track of state for field: _showConservation + */ + private boolean _has_showConservation; + + /** + * Field _showQuality + */ + private boolean _showQuality; + + /** + * keeps track of state for field: _showQuality + */ + private boolean _has_showQuality; + + /** + * Field _showIdentity + */ + private boolean _showIdentity; + + /** + * keeps track of state for field: _showIdentity + */ + private boolean _has_showIdentity; + + /** + * Field _xpos + */ + private int _xpos; + + /** + * keeps track of state for field: _xpos + */ + private boolean _has_xpos; + + /** + * Field _ypos + */ + private int _ypos; + + /** + * keeps track of state for field: _ypos + */ + private boolean _has_ypos; + + /** + * Field _width + */ + private int _width; + + /** + * keeps track of state for field: _width + */ + private boolean _has_width; + + /** + * Field _height + */ + private int _height; + + /** + * keeps track of state for field: _height + */ + private boolean _has_height; + + /** + * Field _startRes + */ + private int _startRes; + + /** + * keeps track of state for field: _startRes + */ + private boolean _has_startRes; + + /** + * Field _startSeq + */ + private int _startSeq; + + /** + * keeps track of state for field: _startSeq + */ + private boolean _has_startSeq; + + /** + * Field _fontName + */ + private java.lang.String _fontName; + + /** + * Field _fontSize + */ + private int _fontSize; + + /** + * keeps track of state for field: _fontSize + */ + private boolean _has_fontSize; + + /** + * Field _fontStyle + */ + private int _fontStyle; + + /** + * keeps track of state for field: _fontStyle + */ + private boolean _has_fontStyle; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Viewport() { + super(); + } //-- jalview.schemabinding.version2.Viewport() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteConsThreshold + * + */ + public void deleteConsThreshold() + { + this._has_consThreshold= false; + } //-- void deleteConsThreshold() + + /** + * Method deleteConservationSelected + * + */ + public void deleteConservationSelected() + { + this._has_conservationSelected= false; + } //-- void deleteConservationSelected() + + /** + * Method deleteFontSize + * + */ + public void deleteFontSize() + { + this._has_fontSize= false; + } //-- void deleteFontSize() + + /** + * Method deleteFontStyle + * + */ + public void deleteFontStyle() + { + this._has_fontStyle= false; + } //-- void deleteFontStyle() + + /** + * Method deleteHeight + * + */ + public void deleteHeight() + { + this._has_height= false; + } //-- void deleteHeight() + + /** + * Method deletePidSelected + * + */ + public void deletePidSelected() + { + this._has_pidSelected= false; + } //-- void deletePidSelected() + + /** + * Method deletePidThreshold + * + */ + public void deletePidThreshold() + { + this._has_pidThreshold= false; + } //-- void deletePidThreshold() + + /** + * Method deleteRenderGaps + * + */ + public void deleteRenderGaps() + { + this._has_renderGaps= false; + } //-- void deleteRenderGaps() + + /** + * Method deleteShowAnnotation + * + */ + public void deleteShowAnnotation() + { + this._has_showAnnotation= false; + } //-- void deleteShowAnnotation() + + /** + * Method deleteShowBoxes + * + */ + public void deleteShowBoxes() + { + this._has_showBoxes= false; + } //-- void deleteShowBoxes() + + /** + * Method deleteShowColourText + * + */ + public void deleteShowColourText() + { + this._has_showColourText= false; + } //-- void deleteShowColourText() + + /** + * Method deleteShowConservation + * + */ + public void deleteShowConservation() + { + this._has_showConservation= false; + } //-- void deleteShowConservation() + + /** + * Method deleteShowFullId + * + */ + public void deleteShowFullId() + { + this._has_showFullId= false; + } //-- void deleteShowFullId() + + /** + * Method deleteShowIdentity + * + */ + public void deleteShowIdentity() + { + this._has_showIdentity= false; + } //-- void deleteShowIdentity() + + /** + * Method deleteShowQuality + * + */ + public void deleteShowQuality() + { + this._has_showQuality= false; + } //-- void deleteShowQuality() + + /** + * Method deleteShowSequenceFeatures + * + */ + public void deleteShowSequenceFeatures() + { + this._has_showSequenceFeatures= false; + } //-- void deleteShowSequenceFeatures() + + /** + * Method deleteShowText + * + */ + public void deleteShowText() + { + this._has_showText= false; + } //-- void deleteShowText() + + /** + * Method deleteStartRes + * + */ + public void deleteStartRes() + { + this._has_startRes= false; + } //-- void deleteStartRes() + + /** + * Method deleteStartSeq + * + */ + public void deleteStartSeq() + { + this._has_startSeq= false; + } //-- void deleteStartSeq() + + /** + * Method deleteWidth + * + */ + public void deleteWidth() + { + this._has_width= false; + } //-- void deleteWidth() + + /** + * Method deleteWrapAlignment + * + */ + public void deleteWrapAlignment() + { + this._has_wrapAlignment= false; + } //-- void deleteWrapAlignment() + + /** + * Method deleteXpos + * + */ + public void deleteXpos() + { + this._has_xpos= false; + } //-- void deleteXpos() + + /** + * Method deleteYpos + * + */ + public void deleteYpos() + { + this._has_ypos= false; + } //-- void deleteYpos() + + /** + * Returns the value of field 'bgColour'. + * + * @return String + * @return the value of field 'bgColour'. + */ + public java.lang.String getBgColour() + { + return this._bgColour; + } //-- java.lang.String getBgColour() + + /** + * Returns the value of field 'consThreshold'. + * + * @return int + * @return the value of field 'consThreshold'. + */ + public int getConsThreshold() + { + return this._consThreshold; + } //-- int getConsThreshold() + + /** + * Returns the value of field 'conservationSelected'. + * + * @return boolean + * @return the value of field 'conservationSelected'. + */ + public boolean getConservationSelected() + { + return this._conservationSelected; + } //-- boolean getConservationSelected() + + /** + * Returns the value of field 'fontName'. + * + * @return String + * @return the value of field 'fontName'. + */ + public java.lang.String getFontName() + { + return this._fontName; + } //-- java.lang.String getFontName() + + /** + * Returns the value of field 'fontSize'. + * + * @return int + * @return the value of field 'fontSize'. + */ + public int getFontSize() + { + return this._fontSize; + } //-- int getFontSize() + + /** + * Returns the value of field 'fontStyle'. + * + * @return int + * @return the value of field 'fontStyle'. + */ + public int getFontStyle() + { + return this._fontStyle; + } //-- int getFontStyle() + + /** + * Returns the value of field 'height'. + * + * @return int + * @return the value of field 'height'. + */ + public int getHeight() + { + return this._height; + } //-- int getHeight() + + /** + * Returns the value of field 'pidSelected'. + * + * @return boolean + * @return the value of field 'pidSelected'. + */ + public boolean getPidSelected() + { + return this._pidSelected; + } //-- boolean getPidSelected() + + /** + * Returns the value of field 'pidThreshold'. + * + * @return int + * @return the value of field 'pidThreshold'. + */ + public int getPidThreshold() + { + return this._pidThreshold; + } //-- int getPidThreshold() + + /** + * Returns the value of field 'renderGaps'. + * + * @return boolean + * @return the value of field 'renderGaps'. + */ + public boolean getRenderGaps() + { + return this._renderGaps; + } //-- boolean getRenderGaps() + + /** + * Returns the value of field 'showAnnotation'. + * + * @return boolean + * @return the value of field 'showAnnotation'. + */ + public boolean getShowAnnotation() + { + return this._showAnnotation; + } //-- boolean getShowAnnotation() + + /** + * Returns the value of field 'showBoxes'. + * + * @return boolean + * @return the value of field 'showBoxes'. + */ + public boolean getShowBoxes() + { + return this._showBoxes; + } //-- boolean getShowBoxes() + + /** + * Returns the value of field 'showColourText'. + * + * @return boolean + * @return the value of field 'showColourText'. + */ + public boolean getShowColourText() + { + return this._showColourText; + } //-- boolean getShowColourText() + + /** + * Returns the value of field 'showConservation'. + * + * @return boolean + * @return the value of field 'showConservation'. + */ + public boolean getShowConservation() + { + return this._showConservation; + } //-- boolean getShowConservation() + + /** + * Returns the value of field 'showFullId'. + * + * @return boolean + * @return the value of field 'showFullId'. + */ + public boolean getShowFullId() + { + return this._showFullId; + } //-- boolean getShowFullId() + + /** + * Returns the value of field 'showIdentity'. + * + * @return boolean + * @return the value of field 'showIdentity'. + */ + public boolean getShowIdentity() + { + return this._showIdentity; + } //-- boolean getShowIdentity() + + /** + * Returns the value of field 'showQuality'. + * + * @return boolean + * @return the value of field 'showQuality'. + */ + public boolean getShowQuality() + { + return this._showQuality; + } //-- boolean getShowQuality() + + /** + * Returns the value of field 'showSequenceFeatures'. + * + * @return boolean + * @return the value of field 'showSequenceFeatures'. + */ + public boolean getShowSequenceFeatures() + { + return this._showSequenceFeatures; + } //-- boolean getShowSequenceFeatures() + + /** + * Returns the value of field 'showText'. + * + * @return boolean + * @return the value of field 'showText'. + */ + public boolean getShowText() + { + return this._showText; + } //-- boolean getShowText() + + /** + * Returns the value of field 'startRes'. + * + * @return int + * @return the value of field 'startRes'. + */ + public int getStartRes() + { + return this._startRes; + } //-- int getStartRes() + + /** + * Returns the value of field 'startSeq'. + * + * @return int + * @return the value of field 'startSeq'. + */ + public int getStartSeq() + { + return this._startSeq; + } //-- int getStartSeq() + + /** + * Returns the value of field 'title'. + * + * @return String + * @return the value of field 'title'. + */ + public java.lang.String getTitle() + { + return this._title; + } //-- java.lang.String getTitle() + + /** + * Returns the value of field 'width'. + * + * @return int + * @return the value of field 'width'. + */ + public int getWidth() + { + return this._width; + } //-- int getWidth() + + /** + * Returns the value of field 'wrapAlignment'. + * + * @return boolean + * @return the value of field 'wrapAlignment'. + */ + public boolean getWrapAlignment() + { + return this._wrapAlignment; + } //-- boolean getWrapAlignment() + + /** + * Returns the value of field 'xpos'. + * + * @return int + * @return the value of field 'xpos'. + */ + public int getXpos() + { + return this._xpos; + } //-- int getXpos() + + /** + * Returns the value of field 'ypos'. + * + * @return int + * @return the value of field 'ypos'. + */ + public int getYpos() + { + return this._ypos; + } //-- int getYpos() + + /** + * Method hasConsThreshold + * + * + * + * @return boolean + */ + public boolean hasConsThreshold() + { + return this._has_consThreshold; + } //-- boolean hasConsThreshold() + + /** + * Method hasConservationSelected + * + * + * + * @return boolean + */ + public boolean hasConservationSelected() + { + return this._has_conservationSelected; + } //-- boolean hasConservationSelected() + + /** + * Method hasFontSize + * + * + * + * @return boolean + */ + public boolean hasFontSize() + { + return this._has_fontSize; + } //-- boolean hasFontSize() + + /** + * Method hasFontStyle + * + * + * + * @return boolean + */ + public boolean hasFontStyle() + { + return this._has_fontStyle; + } //-- boolean hasFontStyle() + + /** + * Method hasHeight + * + * + * + * @return boolean + */ + public boolean hasHeight() + { + return this._has_height; + } //-- boolean hasHeight() + + /** + * Method hasPidSelected + * + * + * + * @return boolean + */ + public boolean hasPidSelected() + { + return this._has_pidSelected; + } //-- boolean hasPidSelected() + + /** + * Method hasPidThreshold + * + * + * + * @return boolean + */ + public boolean hasPidThreshold() + { + return this._has_pidThreshold; + } //-- boolean hasPidThreshold() + + /** + * Method hasRenderGaps + * + * + * + * @return boolean + */ + public boolean hasRenderGaps() + { + return this._has_renderGaps; + } //-- boolean hasRenderGaps() + + /** + * Method hasShowAnnotation + * + * + * + * @return boolean + */ + public boolean hasShowAnnotation() + { + return this._has_showAnnotation; + } //-- boolean hasShowAnnotation() + + /** + * Method hasShowBoxes + * + * + * + * @return boolean + */ + public boolean hasShowBoxes() + { + return this._has_showBoxes; + } //-- boolean hasShowBoxes() + + /** + * Method hasShowColourText + * + * + * + * @return boolean + */ + public boolean hasShowColourText() + { + return this._has_showColourText; + } //-- boolean hasShowColourText() + + /** + * Method hasShowConservation + * + * + * + * @return boolean + */ + public boolean hasShowConservation() + { + return this._has_showConservation; + } //-- boolean hasShowConservation() + + /** + * Method hasShowFullId + * + * + * + * @return boolean + */ + public boolean hasShowFullId() + { + return this._has_showFullId; + } //-- boolean hasShowFullId() + + /** + * Method hasShowIdentity + * + * + * + * @return boolean + */ + public boolean hasShowIdentity() + { + return this._has_showIdentity; + } //-- boolean hasShowIdentity() + + /** + * Method hasShowQuality + * + * + * + * @return boolean + */ + public boolean hasShowQuality() + { + return this._has_showQuality; + } //-- boolean hasShowQuality() + + /** + * Method hasShowSequenceFeatures + * + * + * + * @return boolean + */ + public boolean hasShowSequenceFeatures() + { + return this._has_showSequenceFeatures; + } //-- boolean hasShowSequenceFeatures() + + /** + * Method hasShowText + * + * + * + * @return boolean + */ + public boolean hasShowText() + { + return this._has_showText; + } //-- boolean hasShowText() + + /** + * Method hasStartRes + * + * + * + * @return boolean + */ + public boolean hasStartRes() + { + return this._has_startRes; + } //-- boolean hasStartRes() + + /** + * Method hasStartSeq + * + * + * + * @return boolean + */ + public boolean hasStartSeq() + { + return this._has_startSeq; + } //-- boolean hasStartSeq() + + /** + * Method hasWidth + * + * + * + * @return boolean + */ + public boolean hasWidth() + { + return this._has_width; + } //-- boolean hasWidth() + + /** + * Method hasWrapAlignment + * + * + * + * @return boolean + */ + public boolean hasWrapAlignment() + { + return this._has_wrapAlignment; + } //-- boolean hasWrapAlignment() + + /** + * Method hasXpos + * + * + * + * @return boolean + */ + public boolean hasXpos() + { + return this._has_xpos; + } //-- boolean hasXpos() + + /** + * Method hasYpos + * + * + * + * @return boolean + */ + public boolean hasYpos() + { + return this._has_ypos; + } //-- boolean hasYpos() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'bgColour'. + * + * @param bgColour the value of field 'bgColour'. + */ + public void setBgColour(java.lang.String bgColour) + { + this._bgColour = bgColour; + } //-- void setBgColour(java.lang.String) + + /** + * Sets the value of field 'consThreshold'. + * + * @param consThreshold the value of field 'consThreshold'. + */ + public void setConsThreshold(int consThreshold) + { + this._consThreshold = consThreshold; + this._has_consThreshold = true; + } //-- void setConsThreshold(int) + + /** + * Sets the value of field 'conservationSelected'. + * + * @param conservationSelected the value of field + * 'conservationSelected'. + */ + public void setConservationSelected(boolean conservationSelected) + { + this._conservationSelected = conservationSelected; + this._has_conservationSelected = true; + } //-- void setConservationSelected(boolean) + + /** + * Sets the value of field 'fontName'. + * + * @param fontName the value of field 'fontName'. + */ + public void setFontName(java.lang.String fontName) + { + this._fontName = fontName; + } //-- void setFontName(java.lang.String) + + /** + * Sets the value of field 'fontSize'. + * + * @param fontSize the value of field 'fontSize'. + */ + public void setFontSize(int fontSize) + { + this._fontSize = fontSize; + this._has_fontSize = true; + } //-- void setFontSize(int) + + /** + * Sets the value of field 'fontStyle'. + * + * @param fontStyle the value of field 'fontStyle'. + */ + public void setFontStyle(int fontStyle) + { + this._fontStyle = fontStyle; + this._has_fontStyle = true; + } //-- void setFontStyle(int) + + /** + * Sets the value of field 'height'. + * + * @param height the value of field 'height'. + */ + public void setHeight(int height) + { + this._height = height; + this._has_height = true; + } //-- void setHeight(int) + + /** + * Sets the value of field 'pidSelected'. + * + * @param pidSelected the value of field 'pidSelected'. + */ + public void setPidSelected(boolean pidSelected) + { + this._pidSelected = pidSelected; + this._has_pidSelected = true; + } //-- void setPidSelected(boolean) + + /** + * Sets the value of field 'pidThreshold'. + * + * @param pidThreshold the value of field 'pidThreshold'. + */ + public void setPidThreshold(int pidThreshold) + { + this._pidThreshold = pidThreshold; + this._has_pidThreshold = true; + } //-- void setPidThreshold(int) + + /** + * Sets the value of field 'renderGaps'. + * + * @param renderGaps the value of field 'renderGaps'. + */ + public void setRenderGaps(boolean renderGaps) + { + this._renderGaps = renderGaps; + this._has_renderGaps = true; + } //-- void setRenderGaps(boolean) + + /** + * Sets the value of field 'showAnnotation'. + * + * @param showAnnotation the value of field 'showAnnotation'. + */ + public void setShowAnnotation(boolean showAnnotation) + { + this._showAnnotation = showAnnotation; + this._has_showAnnotation = true; + } //-- void setShowAnnotation(boolean) + + /** + * Sets the value of field 'showBoxes'. + * + * @param showBoxes the value of field 'showBoxes'. + */ + public void setShowBoxes(boolean showBoxes) + { + this._showBoxes = showBoxes; + this._has_showBoxes = true; + } //-- void setShowBoxes(boolean) + + /** + * Sets the value of field 'showColourText'. + * + * @param showColourText the value of field 'showColourText'. + */ + public void setShowColourText(boolean showColourText) + { + this._showColourText = showColourText; + this._has_showColourText = true; + } //-- void setShowColourText(boolean) + + /** + * Sets the value of field 'showConservation'. + * + * @param showConservation the value of field 'showConservation' + */ + public void setShowConservation(boolean showConservation) + { + this._showConservation = showConservation; + this._has_showConservation = true; + } //-- void setShowConservation(boolean) + + /** + * Sets the value of field 'showFullId'. + * + * @param showFullId the value of field 'showFullId'. + */ + public void setShowFullId(boolean showFullId) + { + this._showFullId = showFullId; + this._has_showFullId = true; + } //-- void setShowFullId(boolean) + + /** + * Sets the value of field 'showIdentity'. + * + * @param showIdentity the value of field 'showIdentity'. + */ + public void setShowIdentity(boolean showIdentity) + { + this._showIdentity = showIdentity; + this._has_showIdentity = true; + } //-- void setShowIdentity(boolean) + + /** + * Sets the value of field 'showQuality'. + * + * @param showQuality the value of field 'showQuality'. + */ + public void setShowQuality(boolean showQuality) + { + this._showQuality = showQuality; + this._has_showQuality = true; + } //-- void setShowQuality(boolean) + + /** + * Sets the value of field 'showSequenceFeatures'. + * + * @param showSequenceFeatures the value of field + * 'showSequenceFeatures'. + */ + public void setShowSequenceFeatures(boolean showSequenceFeatures) + { + this._showSequenceFeatures = showSequenceFeatures; + this._has_showSequenceFeatures = true; + } //-- void setShowSequenceFeatures(boolean) + + /** + * Sets the value of field 'showText'. + * + * @param showText the value of field 'showText'. + */ + public void setShowText(boolean showText) + { + this._showText = showText; + this._has_showText = true; + } //-- void setShowText(boolean) + + /** + * Sets the value of field 'startRes'. + * + * @param startRes the value of field 'startRes'. + */ + public void setStartRes(int startRes) + { + this._startRes = startRes; + this._has_startRes = true; + } //-- void setStartRes(int) + + /** + * Sets the value of field 'startSeq'. + * + * @param startSeq the value of field 'startSeq'. + */ + public void setStartSeq(int startSeq) + { + this._startSeq = startSeq; + this._has_startSeq = true; + } //-- void setStartSeq(int) + + /** + * Sets the value of field 'title'. + * + * @param title the value of field 'title'. + */ + public void setTitle(java.lang.String title) + { + this._title = title; + } //-- void setTitle(java.lang.String) + + /** + * Sets the value of field 'width'. + * + * @param width the value of field 'width'. + */ + public void setWidth(int width) + { + this._width = width; + this._has_width = true; + } //-- void setWidth(int) + + /** + * Sets the value of field 'wrapAlignment'. + * + * @param wrapAlignment the value of field 'wrapAlignment'. + */ + public void setWrapAlignment(boolean wrapAlignment) + { + this._wrapAlignment = wrapAlignment; + this._has_wrapAlignment = true; + } //-- void setWrapAlignment(boolean) + + /** + * Sets the value of field 'xpos'. + * + * @param xpos the value of field 'xpos'. + */ + public void setXpos(int xpos) + { + this._xpos = xpos; + this._has_xpos = true; + } //-- void setXpos(int) + + /** + * Sets the value of field 'ypos'. + * + * @param ypos the value of field 'ypos'. + */ + public void setYpos(int ypos) + { + this._ypos = ypos; + this._has_ypos = true; + } //-- void setYpos(int) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Object + */ + public static java.lang.Object unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Viewport) Unmarshaller.unmarshal(jalview.schemabinding.version2.Viewport.class, reader); + } //-- java.lang.Object unmarshal(java.io.Reader) + + /** + * Method validate + * + */ + public void validate() + throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } //-- void validate() + +} diff --git a/src/jalview/schemabinding/version2/ViewportDescriptor.java b/src/jalview/schemabinding/version2/ViewportDescriptor.java new file mode 100755 index 0000000..66a3d77 --- /dev/null +++ b/src/jalview/schemabinding/version2/ViewportDescriptor.java @@ -0,0 +1,1221 @@ +/* + * This class was automatically generated with + * Castor 0.9.6, using an XML + * Schema. + * $Id$ + */ + +package jalview.schemabinding.version2; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.mapping.AccessMode; +import org.exolab.castor.xml.TypeValidator; +import org.exolab.castor.xml.XMLFieldDescriptor; +import org.exolab.castor.xml.validators.*; + +/** + * Class ViewportDescriptor. + * + * @version $Revision$ $Date$ + */ +public class ViewportDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public ViewportDescriptor() { + super(); + nsURI = "www.jalview.org"; + xmlName = "Viewport"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.xml.XMLFieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _conservationSelected + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_conservationSelected", "conservationSelected", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasConservationSelected()) + return null; + return (target.getConservationSelected() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteConservationSelected(); + return; + } + target.setConservationSelected( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _conservationSelected + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _pidSelected + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_pidSelected", "pidSelected", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasPidSelected()) + return null; + return (target.getPidSelected() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deletePidSelected(); + return; + } + target.setPidSelected( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _pidSelected + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _bgColour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_bgColour", "bgColour", 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 + { + Viewport target = (Viewport) object; + return target.getBgColour(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + target.setBgColour( (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: _bgColour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _consThreshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_consThreshold", "consThreshold", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasConsThreshold()) + return null; + return new java.lang.Integer(target.getConsThreshold()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteConsThreshold(); + return; + } + target.setConsThreshold( ((java.lang.Integer)value).intValue()); + } + 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: _consThreshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _pidThreshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_pidThreshold", "pidThreshold", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasPidThreshold()) + return null; + return new java.lang.Integer(target.getPidThreshold()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deletePidThreshold(); + return; + } + target.setPidThreshold( ((java.lang.Integer)value).intValue()); + } + 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: _pidThreshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _title + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", 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 + { + Viewport target = (Viewport) object; + return target.getTitle(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + target.setTitle( (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: _title + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _showFullId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showFullId", "showFullId", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasShowFullId()) + return null; + return (target.getShowFullId() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowFullId(); + return; + } + target.setShowFullId( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _showFullId + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _showText + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showText", "showText", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasShowText()) + return null; + return (target.getShowText() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowText(); + return; + } + target.setShowText( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _showText + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _showColourText + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showColourText", "showColourText", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasShowColourText()) + return null; + return (target.getShowColourText() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowColourText(); + return; + } + target.setShowColourText( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _showColourText + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _showBoxes + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showBoxes", "showBoxes", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasShowBoxes()) + return null; + return (target.getShowBoxes() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowBoxes(); + return; + } + target.setShowBoxes( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _showBoxes + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _wrapAlignment + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_wrapAlignment", "wrapAlignment", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasWrapAlignment()) + return null; + return (target.getWrapAlignment() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteWrapAlignment(); + return; + } + target.setWrapAlignment( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _wrapAlignment + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _renderGaps + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_renderGaps", "renderGaps", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasRenderGaps()) + return null; + return (target.getRenderGaps() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteRenderGaps(); + return; + } + target.setRenderGaps( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _renderGaps + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _showSequenceFeatures + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showSequenceFeatures", "showSequenceFeatures", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasShowSequenceFeatures()) + return null; + return (target.getShowSequenceFeatures() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowSequenceFeatures(); + return; + } + target.setShowSequenceFeatures( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _showSequenceFeatures + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _showAnnotation + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showAnnotation", "showAnnotation", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasShowAnnotation()) + return null; + return (target.getShowAnnotation() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowAnnotation(); + return; + } + target.setShowAnnotation( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _showAnnotation + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _showConservation + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showConservation", "showConservation", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasShowConservation()) + return null; + return (target.getShowConservation() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowConservation(); + return; + } + target.setShowConservation( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _showConservation + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _showQuality + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showQuality", "showQuality", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasShowQuality()) + return null; + return (target.getShowQuality() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowQuality(); + return; + } + target.setShowQuality( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _showQuality + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _showIdentity + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showIdentity", "showIdentity", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasShowIdentity()) + return null; + return (target.getShowIdentity() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteShowIdentity(); + return; + } + target.setShowIdentity( ((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); + addFieldDescriptor(desc); + + //-- validation code for: _showIdentity + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _xpos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_xpos", "xpos", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasXpos()) + return null; + return new java.lang.Integer(target.getXpos()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteXpos(); + return; + } + target.setXpos( ((java.lang.Integer)value).intValue()); + } + 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: _xpos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _ypos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_ypos", "ypos", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasYpos()) + return null; + return new java.lang.Integer(target.getYpos()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteYpos(); + return; + } + target.setYpos( ((java.lang.Integer)value).intValue()); + } + 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: _ypos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _width + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_width", "width", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasWidth()) + return null; + return new java.lang.Integer(target.getWidth()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteWidth(); + return; + } + target.setWidth( ((java.lang.Integer)value).intValue()); + } + 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: _width + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _height + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_height", "height", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasHeight()) + return null; + return new java.lang.Integer(target.getHeight()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteHeight(); + return; + } + target.setHeight( ((java.lang.Integer)value).intValue()); + } + 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: _height + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _startRes + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_startRes", "startRes", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasStartRes()) + return null; + return new java.lang.Integer(target.getStartRes()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteStartRes(); + return; + } + target.setStartRes( ((java.lang.Integer)value).intValue()); + } + 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: _startRes + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _startSeq + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_startSeq", "startSeq", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasStartSeq()) + return null; + return new java.lang.Integer(target.getStartSeq()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteStartSeq(); + return; + } + target.setStartSeq( ((java.lang.Integer)value).intValue()); + } + 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: _startSeq + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _fontName + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_fontName", "fontName", 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 + { + Viewport target = (Viewport) object; + return target.getFontName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + target.setFontName( (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: _fontName + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _fontSize + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_fontSize", "fontSize", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasFontSize()) + return null; + return new java.lang.Integer(target.getFontSize()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteFontSize(); + return; + } + target.setFontSize( ((java.lang.Integer)value).intValue()); + } + 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: _fontSize + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _fontStyle + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_fontStyle", "fontStyle", org.exolab.castor.xml.NodeType.Attribute); + handler = (new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if(!target.hasFontStyle()) + return null; + return new java.lang.Integer(target.getFontStyle()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteFontStyle(); + return; + } + target.setFontStyle( ((java.lang.Integer)value).intValue()); + } + 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: _fontStyle + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator= new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } //-- jalview.schemabinding.version2.ViewportDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Viewport.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} -- 1.7.10.2