From: jprocter Date: Fri, 18 May 2007 11:19:24 +0000 (+0000) Subject: removed old Mapping object dependency X-Git-Tag: Release_0.2~129 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=561e4251325edd3a70a0f3ffc6ef79bc62a3a107;p=vamsas.git removed old Mapping object dependency git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@391 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/uk/ac/vamsas/objects/EmptyDocumentUpdater.java b/src/uk/ac/vamsas/objects/EmptyDocumentUpdater.java index 394ffd8..b5a7168 100644 --- a/src/uk/ac/vamsas/objects/EmptyDocumentUpdater.java +++ b/src/uk/ac/vamsas/objects/EmptyDocumentUpdater.java @@ -42,7 +42,7 @@ public class EmptyDocumentUpdater implements IDocumentUpdater public void update(MapList vobj) {} - public void update(Mapping vobj) {} + public void update(SequenceMapping vobj) {} public void update(Newick vobj) {} diff --git a/src/uk/ac/vamsas/objects/IDocumentUpdater.java b/src/uk/ac/vamsas/objects/IDocumentUpdater.java index 1ee0798..579e4b5 100644 --- a/src/uk/ac/vamsas/objects/IDocumentUpdater.java +++ b/src/uk/ac/vamsas/objects/IDocumentUpdater.java @@ -42,7 +42,7 @@ public interface IDocumentUpdater public void update(MapList vobj); - public void update(Mapping vobj); + public void update(SequenceMapping vobj); public void update(Newick vobj); diff --git a/src/uk/ac/vamsas/objects/core/DataSet.java b/src/uk/ac/vamsas/objects/core/DataSet.java index 2b2004a..cdc1dc1 100644 --- a/src/uk/ac/vamsas/objects/core/DataSet.java +++ b/src/uk/ac/vamsas/objects/core/DataSet.java @@ -39,6 +39,11 @@ implements java.io.Serializable private java.util.Vector _sequenceList; /** + * Field _sequenceMappingList. + */ + private java.util.Vector _sequenceMappingList; + + /** * Field _dataSetAnnotationsList. */ private java.util.Vector _dataSetAnnotationsList; @@ -66,6 +71,7 @@ implements java.io.Serializable public DataSet() { super(); this._sequenceList = new java.util.Vector(); + this._sequenceMappingList = new java.util.Vector(); this._dataSetAnnotationsList = new java.util.Vector(); this._alignmentList = new java.util.Vector(); this._treeList = new java.util.Vector(); @@ -163,6 +169,34 @@ implements java.io.Serializable /** * * + * @param vSequenceMapping + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addSequenceMapping( + final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping) + throws java.lang.IndexOutOfBoundsException { + this._sequenceMappingList.addElement(vSequenceMapping); + } + + /** + * + * + * @param index + * @param vSequenceMapping + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addSequenceMapping( + final int index, + final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping) + throws java.lang.IndexOutOfBoundsException { + this._sequenceMappingList.add(index, vSequenceMapping); + } + + /** + * + * * @param vTree * @throws java.lang.IndexOutOfBoundsException if the index * given is outside the bounds of the collection @@ -222,6 +256,17 @@ implements java.io.Serializable } /** + * Method enumerateSequenceMapping. + * + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.SequenceMapping elements + */ + public java.util.Enumeration enumerateSequenceMapping( + ) { + return this._sequenceMappingList.elements(); + } + + /** * Method enumerateTree. * * @return an Enumeration over all @@ -263,6 +308,13 @@ implements java.io.Serializable } else if (temp._sequenceList != null) return false; + if (this._sequenceMappingList != null) { + if (temp._sequenceMappingList == null) return false; + else if (!(this._sequenceMappingList.equals(temp._sequenceMappingList))) + return false; + } + else if (temp._sequenceMappingList != null) + return false; if (this._dataSetAnnotationsList != null) { if (temp._dataSetAnnotationsList == null) return false; else if (!(this._dataSetAnnotationsList.equals(temp._dataSetAnnotationsList))) @@ -492,6 +544,64 @@ implements java.io.Serializable } /** + * Method getSequenceMapping. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the + * uk.ac.vamsas.objects.core.SequenceMapping at the given index + */ + public uk.ac.vamsas.objects.core.SequenceMapping getSequenceMapping( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._sequenceMappingList.size()) { + throw new IndexOutOfBoundsException("getSequenceMapping: Index value '" + index + "' not in range [0.." + (this._sequenceMappingList.size() - 1) + "]"); + } + + return (uk.ac.vamsas.objects.core.SequenceMapping) _sequenceMappingList.get(index); + } + + /** + * Method getSequenceMapping.Returns the contents of the + * collection in an Array.

Note: Just in case the + * collection contents are changing in another thread, we pass + * a 0-length Array of the correct type into the API call. + * This way we know that the Array returned is of + * exactly the correct length. + * + * @return this collection as an Array + */ + public uk.ac.vamsas.objects.core.SequenceMapping[] getSequenceMapping( + ) { + uk.ac.vamsas.objects.core.SequenceMapping[] array = new uk.ac.vamsas.objects.core.SequenceMapping[0]; + return (uk.ac.vamsas.objects.core.SequenceMapping[]) this._sequenceMappingList.toArray(array); + } + + /** + * Method getSequenceMappingAsReference.Returns a reference to + * '_sequenceMappingList'. No type checking is performed on any + * modifications to the Vector. + * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getSequenceMappingAsReference( + ) { + return this._sequenceMappingList; + } + + /** + * Method getSequenceMappingCount. + * + * @return the size of this collection + */ + public int getSequenceMappingCount( + ) { + return this._sequenceMappingList.size(); + } + + /** * Method getTree. * * @param index @@ -567,6 +677,9 @@ implements java.io.Serializable if (_sequenceList != null) { result = 37 * result + _sequenceList.hashCode(); } + if (_sequenceMappingList != null) { + result = 37 * result + _sequenceMappingList.hashCode(); + } if (_dataSetAnnotationsList != null) { result = 37 * result + _dataSetAnnotationsList.hashCode(); } @@ -677,6 +790,13 @@ implements java.io.Serializable /** */ + public void removeAllSequenceMapping( + ) { + this._sequenceMappingList.clear(); + } + + /** + */ public void removeAllTree( ) { this._treeList.clear(); @@ -731,6 +851,30 @@ implements java.io.Serializable } /** + * Method removeSequenceMapping. + * + * @param vSequenceMapping + * @return true if the object was removed from the collection. + */ + public boolean removeSequenceMapping( + final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping) { + boolean removed = _sequenceMappingList.remove(vSequenceMapping); + return removed; + } + + /** + * Method removeSequenceMappingAt. + * + * @param index + * @return the element removed from the collection + */ + public uk.ac.vamsas.objects.core.SequenceMapping removeSequenceMappingAt( + final int index) { + java.lang.Object obj = this._sequenceMappingList.remove(index); + return (uk.ac.vamsas.objects.core.SequenceMapping) obj; + } + + /** * Method removeTree. * * @param vTree @@ -963,6 +1107,67 @@ implements java.io.Serializable * * * @param index + * @param vSequenceMapping + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setSequenceMapping( + final int index, + final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._sequenceMappingList.size()) { + throw new IndexOutOfBoundsException("setSequenceMapping: Index value '" + index + "' not in range [0.." + (this._sequenceMappingList.size() - 1) + "]"); + } + + this._sequenceMappingList.set(index, vSequenceMapping); + } + + /** + * + * + * @param vSequenceMappingArray + */ + public void setSequenceMapping( + final uk.ac.vamsas.objects.core.SequenceMapping[] vSequenceMappingArray) { + //-- copy array + _sequenceMappingList.clear(); + + for (int i = 0; i < vSequenceMappingArray.length; i++) { + this._sequenceMappingList.add(vSequenceMappingArray[i]); + } + } + + /** + * Sets the value of '_sequenceMappingList' by copying the + * given Vector. All elements will be checked for type safety. + * + * @param vSequenceMappingList the Vector to copy. + */ + public void setSequenceMapping( + final java.util.Vector vSequenceMappingList) { + // copy vector + this._sequenceMappingList.clear(); + + this._sequenceMappingList.addAll(vSequenceMappingList); + } + + /** + * Sets the value of '_sequenceMappingList' by setting it to + * the given Vector. No type checking is performed. + * @deprecated + * + * @param sequenceMappingVector the Vector to set. + */ + public void setSequenceMappingAsReference( + final java.util.Vector sequenceMappingVector) { + this._sequenceMappingList = sequenceMappingVector; + } + + /** + * + * + * @param index * @param vTree * @throws java.lang.IndexOutOfBoundsException if the index * given is outside the bounds of the collection diff --git a/src/uk/ac/vamsas/objects/core/Range.java b/src/uk/ac/vamsas/objects/core/Range.java new file mode 100644 index 0000000..11d84d3 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Range.java @@ -0,0 +1,372 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; + +/** + * Class Range. + * + * @version $Revision$ $Date$ + */ +public class Range extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _seqAStart. + */ + private int _seqAStart; + + /** + * keeps track of state for field: _seqAStart + */ + private boolean _has_seqAStart; + + /** + * Field _seqAEnd. + */ + private int _seqAEnd; + + /** + * keeps track of state for field: _seqAEnd + */ + private boolean _has_seqAEnd; + + /** + * Field _seqBStart. + */ + private int _seqBStart; + + /** + * keeps track of state for field: _seqBStart + */ + private boolean _has_seqBStart; + + /** + * Field _seqBEnd. + */ + private int _seqBEnd; + + /** + * keeps track of state for field: _seqBEnd + */ + private boolean _has_seqBEnd; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Range() { + super(); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + */ + public void deleteSeqAEnd( + ) { + this._has_seqAEnd= false; + } + + /** + */ + public void deleteSeqAStart( + ) { + this._has_seqAStart= false; + } + + /** + */ + public void deleteSeqBEnd( + ) { + this._has_seqBEnd= false; + } + + /** + */ + public void deleteSeqBStart( + ) { + this._has_seqBStart= false; + } + + /** + * Overrides the java.lang.Object.equals method. + * + * @param obj + * @return true if the objects are equal. + */ + public boolean equals( + final java.lang.Object obj) { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Range) { + + Range temp = (Range)obj; + if (this._seqAStart != temp._seqAStart) + return false; + if (this._has_seqAStart != temp._has_seqAStart) + return false; + if (this._seqAEnd != temp._seqAEnd) + return false; + if (this._has_seqAEnd != temp._has_seqAEnd) + return false; + if (this._seqBStart != temp._seqBStart) + return false; + if (this._has_seqBStart != temp._has_seqBStart) + return false; + if (this._seqBEnd != temp._seqBEnd) + return false; + if (this._has_seqBEnd != temp._has_seqBEnd) + return false; + return true; + } + return false; + } + + /** + * Returns the value of field 'seqAEnd'. + * + * @return the value of field 'SeqAEnd'. + */ + public int getSeqAEnd( + ) { + return this._seqAEnd; + } + + /** + * Returns the value of field 'seqAStart'. + * + * @return the value of field 'SeqAStart'. + */ + public int getSeqAStart( + ) { + return this._seqAStart; + } + + /** + * Returns the value of field 'seqBEnd'. + * + * @return the value of field 'SeqBEnd'. + */ + public int getSeqBEnd( + ) { + return this._seqBEnd; + } + + /** + * Returns the value of field 'seqBStart'. + * + * @return the value of field 'SeqBStart'. + */ + public int getSeqBStart( + ) { + return this._seqBStart; + } + + /** + * Method hasSeqAEnd. + * + * @return true if at least one SeqAEnd has been added + */ + public boolean hasSeqAEnd( + ) { + return this._has_seqAEnd; + } + + /** + * Method hasSeqAStart. + * + * @return true if at least one SeqAStart has been added + */ + public boolean hasSeqAStart( + ) { + return this._has_seqAStart; + } + + /** + * Method hasSeqBEnd. + * + * @return true if at least one SeqBEnd has been added + */ + public boolean hasSeqBEnd( + ) { + return this._has_seqBEnd; + } + + /** + * Method hasSeqBStart. + * + * @return true if at least one SeqBStart has been added + */ + public boolean hasSeqBStart( + ) { + return this._has_seqBStart; + } + + /** + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 + * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + result = 37 * result + _seqAStart; + result = 37 * result + _seqAEnd; + result = 37 * result + _seqBStart; + result = 37 * result + _seqBEnd; + + return result; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid( + ) { + try { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'seqAEnd'. + * + * @param seqAEnd the value of field 'seqAEnd'. + */ + public void setSeqAEnd( + final int seqAEnd) { + this._seqAEnd = seqAEnd; + this._has_seqAEnd = true; + } + + /** + * Sets the value of field 'seqAStart'. + * + * @param seqAStart the value of field 'seqAStart'. + */ + public void setSeqAStart( + final int seqAStart) { + this._seqAStart = seqAStart; + this._has_seqAStart = true; + } + + /** + * Sets the value of field 'seqBEnd'. + * + * @param seqBEnd the value of field 'seqBEnd'. + */ + public void setSeqBEnd( + final int seqBEnd) { + this._seqBEnd = seqBEnd; + this._has_seqBEnd = true; + } + + /** + * Sets the value of field 'seqBStart'. + * + * @param seqBStart the value of field 'seqBStart'. + */ + public void setSeqBStart( + final int seqBStart) { + this._seqBStart = seqBStart; + this._has_seqBStart = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Range + */ + public static uk.ac.vamsas.objects.core.Range unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.Range) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Range.class, reader); + } + + /** + * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void validate( + ) + throws org.exolab.castor.xml.ValidationException { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } + +} diff --git a/src/uk/ac/vamsas/objects/core/SequenceMapping.java b/src/uk/ac/vamsas/objects/core/SequenceMapping.java new file mode 100644 index 0000000..e7776a7 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/SequenceMapping.java @@ -0,0 +1,505 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; + +/** + * Class SequenceMapping. + * + * @version $Revision$ $Date$ + */ +public class SequenceMapping extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _sequenceA. + */ + private java.lang.Object _sequenceA; + + /** + * Field _sequenceB. + */ + private java.lang.Object _sequenceB; + + /** + * Field _id. + */ + private java.lang.String _id; + + /** + * Field _rangeList. + */ + private java.util.Vector _rangeList; + + /** + * Field _provenance. + */ + private uk.ac.vamsas.objects.core.Provenance _provenance; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SequenceMapping() { + super(); + this._rangeList = new java.util.Vector(); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * + * + * @param vRange + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addRange( + final uk.ac.vamsas.objects.core.Range vRange) + throws java.lang.IndexOutOfBoundsException { + this._rangeList.addElement(vRange); + } + + /** + * + * + * @param index + * @param vRange + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void addRange( + final int index, + final uk.ac.vamsas.objects.core.Range vRange) + throws java.lang.IndexOutOfBoundsException { + this._rangeList.add(index, vRange); + } + + /** + * Method enumerateRange. + * + * @return an Enumeration over all + * uk.ac.vamsas.objects.core.Range elements + */ + public java.util.Enumeration enumerateRange( + ) { + return this._rangeList.elements(); + } + + /** + * Overrides the java.lang.Object.equals method. + * + * @param obj + * @return true if the objects are equal. + */ + public boolean equals( + final java.lang.Object obj) { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof SequenceMapping) { + + SequenceMapping temp = (SequenceMapping)obj; + if (this._sequenceA != null) { + if (temp._sequenceA == null) return false; + else if (!(this._sequenceA.equals(temp._sequenceA))) + return false; + } + else if (temp._sequenceA != null) + return false; + if (this._sequenceB != null) { + if (temp._sequenceB == null) return false; + else if (!(this._sequenceB.equals(temp._sequenceB))) + return false; + } + else if (temp._sequenceB != null) + return false; + if (this._id != null) { + if (temp._id == null) return false; + else if (!(this._id.equals(temp._id))) + return false; + } + else if (temp._id != null) + return false; + if (this._rangeList != null) { + if (temp._rangeList == null) return false; + else if (!(this._rangeList.equals(temp._rangeList))) + return false; + } + else if (temp._rangeList != null) + return false; + if (this._provenance != null) { + if (temp._provenance == null) return false; + else if (!(this._provenance.equals(temp._provenance))) + return false; + } + else if (temp._provenance != null) + return false; + return true; + } + return false; + } + + /** + * Returns the value of field 'id'. + * + * @return the value of field 'Id'. + */ + public java.lang.String getId( + ) { + return this._id; + } + + /** + * Returns the value of field 'provenance'. + * + * @return the value of field 'Provenance'. + */ + public uk.ac.vamsas.objects.core.Provenance getProvenance( + ) { + return this._provenance; + } + + /** + * Method getRange. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + * @return the value of the uk.ac.vamsas.objects.core.Range at + * the given index + */ + public uk.ac.vamsas.objects.core.Range getRange( + final int index) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._rangeList.size()) { + throw new IndexOutOfBoundsException("getRange: Index value '" + index + "' not in range [0.." + (this._rangeList.size() - 1) + "]"); + } + + return (uk.ac.vamsas.objects.core.Range) _rangeList.get(index); + } + + /** + * Method getRange.Returns the contents of the collection in an + * Array.

Note: Just in case the collection contents are + * changing in another thread, we pass a 0-length Array of the + * correct type into the API call. This way we know + * that the Array returned is of exactly the correct length. + * + * @return this collection as an Array + */ + public uk.ac.vamsas.objects.core.Range[] getRange( + ) { + uk.ac.vamsas.objects.core.Range[] array = new uk.ac.vamsas.objects.core.Range[0]; + return (uk.ac.vamsas.objects.core.Range[]) this._rangeList.toArray(array); + } + + /** + * Method getRangeAsReference.Returns a reference to + * '_rangeList'. No type checking is performed on any + * modifications to the Vector. + * + * @return a reference to the Vector backing this class + */ + public java.util.Vector getRangeAsReference( + ) { + return this._rangeList; + } + + /** + * Method getRangeCount. + * + * @return the size of this collection + */ + public int getRangeCount( + ) { + return this._rangeList.size(); + } + + /** + * Returns the value of field 'sequenceA'. + * + * @return the value of field 'SequenceA'. + */ + public java.lang.Object getSequenceA( + ) { + return this._sequenceA; + } + + /** + * Returns the value of field 'sequenceB'. + * + * @return the value of field 'SequenceB'. + */ + public java.lang.Object getSequenceB( + ) { + return this._sequenceB; + } + + /** + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 + * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + if (_sequenceA != null) { + result = 37 * result + _sequenceA.hashCode(); + } + if (_sequenceB != null) { + result = 37 * result + _sequenceB.hashCode(); + } + if (_id != null) { + result = 37 * result + _id.hashCode(); + } + if (_rangeList != null) { + result = 37 * result + _rangeList.hashCode(); + } + if (_provenance != null) { + result = 37 * result + _provenance.hashCode(); + } + + return result; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid( + ) { + try { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void marshal( + final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + */ + public void marshal( + final org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, handler); + } + + /** + */ + public void removeAllRange( + ) { + this._rangeList.clear(); + } + + /** + * Method removeRange. + * + * @param vRange + * @return true if the object was removed from the collection. + */ + public boolean removeRange( + final uk.ac.vamsas.objects.core.Range vRange) { + boolean removed = _rangeList.remove(vRange); + return removed; + } + + /** + * Method removeRangeAt. + * + * @param index + * @return the element removed from the collection + */ + public uk.ac.vamsas.objects.core.Range removeRangeAt( + final int index) { + java.lang.Object obj = this._rangeList.remove(index); + return (uk.ac.vamsas.objects.core.Range) obj; + } + + /** + * Sets the value of field 'id'. + * + * @param id the value of field 'id'. + */ + public void setId( + final java.lang.String id) { + this._id = id; + } + + /** + * Sets the value of field 'provenance'. + * + * @param provenance the value of field 'provenance'. + */ + public void setProvenance( + final uk.ac.vamsas.objects.core.Provenance provenance) { + this._provenance = provenance; + } + + /** + * + * + * @param index + * @param vRange + * @throws java.lang.IndexOutOfBoundsException if the index + * given is outside the bounds of the collection + */ + public void setRange( + final int index, + final uk.ac.vamsas.objects.core.Range vRange) + throws java.lang.IndexOutOfBoundsException { + // check bounds for index + if (index < 0 || index >= this._rangeList.size()) { + throw new IndexOutOfBoundsException("setRange: Index value '" + index + "' not in range [0.." + (this._rangeList.size() - 1) + "]"); + } + + this._rangeList.set(index, vRange); + } + + /** + * + * + * @param vRangeArray + */ + public void setRange( + final uk.ac.vamsas.objects.core.Range[] vRangeArray) { + //-- copy array + _rangeList.clear(); + + for (int i = 0; i < vRangeArray.length; i++) { + this._rangeList.add(vRangeArray[i]); + } + } + + /** + * Sets the value of '_rangeList' by copying the given Vector. + * All elements will be checked for type safety. + * + * @param vRangeList the Vector to copy. + */ + public void setRange( + final java.util.Vector vRangeList) { + // copy vector + this._rangeList.clear(); + + this._rangeList.addAll(vRangeList); + } + + /** + * Sets the value of '_rangeList' by setting it to the given + * Vector. No type checking is performed. + * @deprecated + * + * @param rangeVector the Vector to set. + */ + public void setRangeAsReference( + final java.util.Vector rangeVector) { + this._rangeList = rangeVector; + } + + /** + * Sets the value of field 'sequenceA'. + * + * @param sequenceA the value of field 'sequenceA'. + */ + public void setSequenceA( + final java.lang.Object sequenceA) { + this._sequenceA = sequenceA; + } + + /** + * Sets the value of field 'sequenceB'. + * + * @param sequenceB the value of field 'sequenceB'. + */ + public void setSequenceB( + final java.lang.Object sequenceB) { + this._sequenceB = sequenceB; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled + * uk.ac.vamsas.objects.core.SequenceMapping + */ + public static uk.ac.vamsas.objects.core.SequenceMapping unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + return (uk.ac.vamsas.objects.core.SequenceMapping) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.SequenceMapping.class, reader); + } + + /** + * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + */ + public void validate( + ) + throws org.exolab.castor.xml.ValidationException { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } + +} diff --git a/src/uk/ac/vamsas/objects/core/SequenceType.java b/src/uk/ac/vamsas/objects/core/SequenceType.java index 4c057a4..6b25c6f 100644 --- a/src/uk/ac/vamsas/objects/core/SequenceType.java +++ b/src/uk/ac/vamsas/objects/core/SequenceType.java @@ -68,11 +68,6 @@ implements java.io.Serializable */ private java.util.Vector _propertyList; - /** - * Field _mappingList. - */ - private java.util.Vector _mappingList; - //----------------/ //- Constructors -/ @@ -81,7 +76,6 @@ implements java.io.Serializable public SequenceType() { super(); this._propertyList = new java.util.Vector(); - this._mappingList = new java.util.Vector(); } @@ -92,34 +86,6 @@ implements java.io.Serializable /** * * - * @param vMapping - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addMapping( - final uk.ac.vamsas.objects.core.Mapping vMapping) - throws java.lang.IndexOutOfBoundsException { - this._mappingList.addElement(vMapping); - } - - /** - * - * - * @param index - * @param vMapping - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addMapping( - final int index, - final uk.ac.vamsas.objects.core.Mapping vMapping) - throws java.lang.IndexOutOfBoundsException { - this._mappingList.add(index, vMapping); - } - - /** - * - * * @param vProperty * @throws java.lang.IndexOutOfBoundsException if the index * given is outside the bounds of the collection @@ -160,17 +126,6 @@ implements java.io.Serializable } /** - * Method enumerateMapping. - * - * @return an Enumeration over all - * uk.ac.vamsas.objects.core.Mapping elements - */ - public java.util.Enumeration enumerateMapping( - ) { - return this._mappingList.elements(); - } - - /** * Method enumerateProperty. * * @return an Enumeration over all @@ -234,13 +189,6 @@ implements java.io.Serializable } else if (temp._propertyList != null) return false; - if (this._mappingList != null) { - if (temp._mappingList == null) return false; - else if (!(this._mappingList.equals(temp._mappingList))) - return false; - } - else if (temp._mappingList != null) - return false; return true; } return false; @@ -267,63 +215,6 @@ implements java.io.Serializable } /** - * Method getMapping. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the uk.ac.vamsas.objects.core.Mapping - * at the given index - */ - public uk.ac.vamsas.objects.core.Mapping getMapping( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._mappingList.size()) { - throw new IndexOutOfBoundsException("getMapping: Index value '" + index + "' not in range [0.." + (this._mappingList.size() - 1) + "]"); - } - - return (uk.ac.vamsas.objects.core.Mapping) _mappingList.get(index); - } - - /** - * Method getMapping.Returns the contents of the collection in - * an Array.

Note: Just in case the collection contents - * are changing in another thread, we pass a 0-length Array of - * the correct type into the API call. This way we know - * that the Array returned is of exactly the correct length. - * - * @return this collection as an Array - */ - public uk.ac.vamsas.objects.core.Mapping[] getMapping( - ) { - uk.ac.vamsas.objects.core.Mapping[] array = new uk.ac.vamsas.objects.core.Mapping[0]; - return (uk.ac.vamsas.objects.core.Mapping[]) this._mappingList.toArray(array); - } - - /** - * Method getMappingAsReference.Returns a reference to - * '_mappingList'. No type checking is performed on any - * modifications to the Vector. - * - * @return a reference to the Vector backing this class - */ - public java.util.Vector getMappingAsReference( - ) { - return this._mappingList; - } - - /** - * Method getMappingCount. - * - * @return the size of this collection - */ - public int getMappingCount( - ) { - return this._mappingList.size(); - } - - /** * Returns the value of field 'name'. * * @return the value of field 'Name'. @@ -457,9 +348,6 @@ implements java.io.Serializable if (_propertyList != null) { result = 37 * result + _propertyList.hashCode(); } - if (_mappingList != null) { - result = 37 * result + _mappingList.hashCode(); - } return result; } @@ -513,43 +401,12 @@ implements java.io.Serializable /** */ - public void removeAllMapping( - ) { - this._mappingList.clear(); - } - - /** - */ public void removeAllProperty( ) { this._propertyList.clear(); } /** - * Method removeMapping. - * - * @param vMapping - * @return true if the object was removed from the collection. - */ - public boolean removeMapping( - final uk.ac.vamsas.objects.core.Mapping vMapping) { - boolean removed = _mappingList.remove(vMapping); - return removed; - } - - /** - * Method removeMappingAt. - * - * @param index - * @return the element removed from the collection - */ - public uk.ac.vamsas.objects.core.Mapping removeMappingAt( - final int index) { - java.lang.Object obj = this._mappingList.remove(index); - return (uk.ac.vamsas.objects.core.Mapping) obj; - } - - /** * Method removeProperty. * * @param vProperty @@ -595,67 +452,6 @@ implements java.io.Serializable } /** - * - * - * @param index - * @param vMapping - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setMapping( - final int index, - final uk.ac.vamsas.objects.core.Mapping vMapping) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._mappingList.size()) { - throw new IndexOutOfBoundsException("setMapping: Index value '" + index + "' not in range [0.." + (this._mappingList.size() - 1) + "]"); - } - - this._mappingList.set(index, vMapping); - } - - /** - * - * - * @param vMappingArray - */ - public void setMapping( - final uk.ac.vamsas.objects.core.Mapping[] vMappingArray) { - //-- copy array - _mappingList.clear(); - - for (int i = 0; i < vMappingArray.length; i++) { - this._mappingList.add(vMappingArray[i]); - } - } - - /** - * Sets the value of '_mappingList' by copying the given - * Vector. All elements will be checked for type safety. - * - * @param vMappingList the Vector to copy. - */ - public void setMapping( - final java.util.Vector vMappingList) { - // copy vector - this._mappingList.clear(); - - this._mappingList.addAll(vMappingList); - } - - /** - * Sets the value of '_mappingList' by setting it to the given - * Vector. No type checking is performed. - * @deprecated - * - * @param mappingVector the Vector to set. - */ - public void setMappingAsReference( - final java.util.Vector mappingVector) { - this._mappingList = mappingVector; - } - - /** * Sets the value of field 'name'. * * @param name the value of field 'name'. diff --git a/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java index 01b4887..29c2ead 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/DataSetDescriptor.java @@ -149,6 +149,48 @@ public class DataSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescri { //-- local scope } desc.setValidator(fieldValidator); + //-- _sequenceMappingList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.SequenceMapping.class, "_sequenceMappingList", "sequenceMapping", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DataSet target = (DataSet) object; + return target.getSequenceMapping(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) object; + target.addSequenceMapping( (uk.ac.vamsas.objects.core.SequenceMapping) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + DataSet target = (DataSet) object; + target.removeAllSequenceMapping(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.SequenceMapping(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _sequenceMappingList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); //-- _dataSetAnnotationsList desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.DataSetAnnotations.class, "_dataSetAnnotationsList", "DataSetAnnotations", org.exolab.castor.xml.NodeType.Element); handler = new org.exolab.castor.xml.XMLFieldHandler() { diff --git a/src/uk/ac/vamsas/objects/core/descriptors/RangeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/RangeDescriptor.java new file mode 100644 index 0000000..3053d50 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/RangeDescriptor.java @@ -0,0 +1,334 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.Range; + +/** + * Class RangeDescriptor. + * + * @version $Revision$ $Date$ + */ +public class RangeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * 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 RangeDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "range"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _seqAStart + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_seqAStart", "seqAStart", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Range target = (Range) object; + if (!target.hasSeqAStart()) { return null; } + return new java.lang.Integer(target.getSeqAStart()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Range target = (Range) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteSeqAStart(); + return; + } + target.setSeqAStart( ((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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _seqAStart + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- _seqAEnd + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_seqAEnd", "seqAEnd", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Range target = (Range) object; + if (!target.hasSeqAEnd()) { return null; } + return new java.lang.Integer(target.getSeqAEnd()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Range target = (Range) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteSeqAEnd(); + return; + } + target.setSeqAEnd( ((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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _seqAEnd + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- _seqBStart + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_seqBStart", "seqBStart", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Range target = (Range) object; + if (!target.hasSeqBStart()) { return null; } + return new java.lang.Integer(target.getSeqBStart()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Range target = (Range) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteSeqBStart(); + return; + } + target.setSeqBStart( ((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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _seqBStart + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- _seqBEnd + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_seqBEnd", "seqBEnd", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Range target = (Range) object; + if (!target.hasSeqBEnd()) { return null; } + return new java.lang.Integer(target.getSeqBEnd()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Range target = (Range) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteSeqBEnd(); + return; + } + target.setSeqBEnd( ((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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _seqBEnd + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.Range.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SequenceMappingDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SequenceMappingDescriptor.java new file mode 100644 index 0000000..69ae934 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/descriptors/SequenceMappingDescriptor.java @@ -0,0 +1,355 @@ +/* + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core.descriptors; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +import uk.ac.vamsas.objects.core.SequenceMapping; + +/** + * Class SequenceMappingDescriptor. + * + * @version $Revision$ $Date$ + */ +public class SequenceMappingDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * 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 SequenceMappingDescriptor() { + super(); + _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"; + _xmlName = "sequenceMapping"; + _elementDefinition = true; + + //-- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- _sequenceA + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_sequenceA", "sequenceA", org.exolab.castor.xml.NodeType.Attribute); + desc.setReference(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceMapping target = (SequenceMapping) object; + return target.getSequenceA(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceMapping target = (SequenceMapping) object; + target.setSequenceA( (java.lang.Object) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.Object(); + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _sequenceA + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.IdRefValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdRefValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _sequenceB + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_sequenceB", "sequenceB", org.exolab.castor.xml.NodeType.Attribute); + desc.setReference(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceMapping target = (SequenceMapping) object; + return target.getSequenceB(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceMapping target = (SequenceMapping) object; + target.setSequenceB( (java.lang.Object) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new java.lang.Object(); + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _sequenceB + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + org.exolab.castor.xml.validators.IdRefValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdRefValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); + this._identity = desc; + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceMapping target = (SequenceMapping) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceMapping target = (SequenceMapping) 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 new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _rangeList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Range.class, "_rangeList", "range", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceMapping target = (SequenceMapping) object; + return target.getRange(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceMapping target = (SequenceMapping) object; + target.addRange( (uk.ac.vamsas.objects.core.Range) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { + try { + SequenceMapping target = (SequenceMapping) object; + target.removeAllRange(); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Range(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _rangeList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _provenance + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + SequenceMapping target = (SequenceMapping) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceMapping target = (SequenceMapping) object; + target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value); + } catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) { + return new uk.ac.vamsas.objects.core.Provenance(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _provenance + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode( + ) { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no + * identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity( + ) { + return _identity; + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass( + ) { + return uk.ac.vamsas.objects.core.SequenceMapping.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix( + ) { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and + * unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI( + ) { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator( + ) { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName( + ) { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that + * of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition( + ) { + return _elementDefinition; + } + +} diff --git a/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java index aed534e..c6e9bf7 100644 --- a/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java +++ b/src/uk/ac/vamsas/objects/core/descriptors/SequenceTypeDescriptor.java @@ -312,48 +312,6 @@ public class SequenceTypeDescriptor extends org.exolab.castor.xml.util.XMLClassD { //-- local scope } desc.setValidator(fieldValidator); - //-- _mappingList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Mapping.class, "_mappingList", "mapping", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - SequenceType target = (SequenceType) object; - return target.getMapping(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceType target = (SequenceType) object; - target.addMapping( (uk.ac.vamsas.objects.core.Mapping) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - SequenceType target = (SequenceType) object; - target.removeAllMapping(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new uk.ac.vamsas.objects.core.Mapping(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _mappingList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope - } - desc.setValidator(fieldValidator); }