From: jprocter Date: Thu, 14 Dec 2006 18:16:15 +0000 (+0000) Subject: refactored org to uk X-Git-Tag: Release_0.2~245 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a06295cc0912455e0bc53b26cb4e0134e6759d0f;p=vamsas.git refactored org to uk git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@275 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/uk/ac/vamsas/objects/core/.castor.cdr b/src/uk/ac/vamsas/objects/core/.castor.cdr new file mode 100644 index 0000000..8ec2cf3 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/.castor.cdr @@ -0,0 +1,3 @@ +-- listing properties -- +org.vamsas.objects.core.LockFile=org.vamsas.objects.core.LockFileDescr... +org.vamsas.objects.core.VamsasDocument=org.vamsas.objects.core.VamsasDocumen... diff --git a/src/uk/ac/vamsas/objects/core/Alignment.java b/src/uk/ac/vamsas/objects/core/Alignment.java new file mode 100644 index 0000000..b3ded14 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Alignment.java @@ -0,0 +1,979 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:Alignment.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Alignment. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class Alignment extends uk.ac.vamsas.client.Vobject +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; + + /** + * Primary Key for vamsas object referencing + * + */ + private java.lang.String _id; + + /** + * Field _modifiable + */ + private java.lang.String _modifiable; + + /** + * This is annotation over the coordinate frame + * defined by all the columns in the alignment. + * + */ + private java.util.Vector _alignmentAnnotationList; + + /** + * Field _treeList + */ + private java.util.Vector _treeList; + + /** + * Field _alignmentSequenceList + */ + private java.util.Vector _alignmentSequenceList; + + /** + * typical properties may be additional + * alignment score objects + */ + private java.util.Vector _propertyList; + + /** + * Field _provenance + */ + private uk.ac.vamsas.objects.core.Provenance _provenance; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Alignment() + { + super(); + _alignmentAnnotationList = new Vector(); + _treeList = new Vector(); + _alignmentSequenceList = new Vector(); + _propertyList = new Vector(); + } //-- uk.ac.vamsas.objects.core.Alignment() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addAlignmentAnnotation + * + * + * + * @param vAlignmentAnnotation + */ + public void addAlignmentAnnotation(uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) + throws java.lang.IndexOutOfBoundsException + { + _alignmentAnnotationList.addElement(vAlignmentAnnotation); + } //-- void addAlignmentAnnotation(uk.ac.vamsas.objects.core.AlignmentAnnotation) + + /** + * Method addAlignmentAnnotation + * + * + * + * @param index + * @param vAlignmentAnnotation + */ + public void addAlignmentAnnotation(int index, uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) + throws java.lang.IndexOutOfBoundsException + { + _alignmentAnnotationList.insertElementAt(vAlignmentAnnotation, index); + } //-- void addAlignmentAnnotation(int, uk.ac.vamsas.objects.core.AlignmentAnnotation) + + /** + * Method addAlignmentSequence + * + * + * + * @param vAlignmentSequence + */ + public void addAlignmentSequence(uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) + throws java.lang.IndexOutOfBoundsException + { + _alignmentSequenceList.addElement(vAlignmentSequence); + } //-- void addAlignmentSequence(uk.ac.vamsas.objects.core.AlignmentSequence) + + /** + * Method addAlignmentSequence + * + * + * + * @param index + * @param vAlignmentSequence + */ + public void addAlignmentSequence(int index, uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) + throws java.lang.IndexOutOfBoundsException + { + _alignmentSequenceList.insertElementAt(vAlignmentSequence, index); + } //-- void addAlignmentSequence(int, uk.ac.vamsas.objects.core.AlignmentSequence) + + /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(uk.ac.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, uk.ac.vamsas.objects.core.Property) + + /** + * Method addTree + * + * + * + * @param vTree + */ + public void addTree(uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + _treeList.addElement(vTree); + } //-- void addTree(uk.ac.vamsas.objects.core.Tree) + + /** + * Method addTree + * + * + * + * @param index + * @param vTree + */ + public void addTree(int index, uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + _treeList.insertElementAt(vTree, index); + } //-- void addTree(int, uk.ac.vamsas.objects.core.Tree) + + /** + * Method deleteAligned + * + */ + public void deleteAligned() + { + this._has_aligned= false; + } //-- void deleteAligned() + + /** + * Method enumerateAlignmentAnnotation + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAlignmentAnnotation() + { + return _alignmentAnnotationList.elements(); + } //-- java.util.Enumeration enumerateAlignmentAnnotation() + + /** + * Method enumerateAlignmentSequence + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAlignmentSequence() + { + return _alignmentSequenceList.elements(); + } //-- java.util.Enumeration enumerateAlignmentSequence() + + /** + * Method enumerateProperty + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateProperty() + { + return _propertyList.elements(); + } //-- java.util.Enumeration enumerateProperty() + + /** + * Method enumerateTree + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateTree() + { + return _treeList.elements(); + } //-- java.util.Enumeration enumerateTree() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Alignment) { + + Alignment temp = (Alignment)obj; + if (this._gapChar != null) { + if (temp._gapChar == null) return false; + else if (!(this._gapChar.equals(temp._gapChar))) + return false; + } + else if (temp._gapChar != null) + return false; + if (this._aligned != temp._aligned) + return false; + if (this._has_aligned != temp._has_aligned) + 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._modifiable != null) { + if (temp._modifiable == null) return false; + else if (!(this._modifiable.equals(temp._modifiable))) + return false; + } + else if (temp._modifiable != null) + return false; + if (this._alignmentAnnotationList != null) { + if (temp._alignmentAnnotationList == null) return false; + else if (!(this._alignmentAnnotationList.equals(temp._alignmentAnnotationList))) + return false; + } + else if (temp._alignmentAnnotationList != null) + return false; + if (this._treeList != null) { + if (temp._treeList == null) return false; + else if (!(this._treeList.equals(temp._treeList))) + return false; + } + else if (temp._treeList != null) + return false; + if (this._alignmentSequenceList != null) { + if (temp._alignmentSequenceList == null) return false; + else if (!(this._alignmentSequenceList.equals(temp._alignmentSequenceList))) + return false; + } + else if (temp._alignmentSequenceList != null) + return false; + if (this._propertyList != null) { + if (temp._propertyList == null) return false; + else if (!(this._propertyList.equals(temp._propertyList))) + return false; + } + else if (temp._propertyList != 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; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'aligned'. + * + * @return boolean + * @return the value of field 'aligned'. + */ + public boolean getAligned() + { + return this._aligned; + } //-- boolean getAligned() + + /** + * Method getAlignmentAnnotation + * + * + * + * @param index + * @return AlignmentAnnotation + */ + public uk.ac.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _alignmentAnnotationList.size())) { + throw new IndexOutOfBoundsException("getAlignmentAnnotation: Index value '"+index+"' not in range [0.."+_alignmentAnnotationList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(int) + + /** + * Method getAlignmentAnnotation + * + * + * + * @return AlignmentAnnotation + */ + public uk.ac.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation() + { + int size = _alignmentAnnotationList.size(); + uk.ac.vamsas.objects.core.AlignmentAnnotation[] mArray = new uk.ac.vamsas.objects.core.AlignmentAnnotation[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation() + + /** + * Method getAlignmentAnnotationCount + * + * + * + * @return int + */ + public int getAlignmentAnnotationCount() + { + return _alignmentAnnotationList.size(); + } //-- int getAlignmentAnnotationCount() + + /** + * Method getAlignmentSequence + * + * + * + * @param index + * @return AlignmentSequence + */ + public uk.ac.vamsas.objects.core.AlignmentSequence getAlignmentSequence(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _alignmentSequenceList.size())) { + throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.AlignmentSequence getAlignmentSequence(int) + + /** + * Method getAlignmentSequence + * + * + * + * @return AlignmentSequence + */ + public uk.ac.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence() + { + int size = _alignmentSequenceList.size(); + uk.ac.vamsas.objects.core.AlignmentSequence[] mArray = new uk.ac.vamsas.objects.core.AlignmentSequence[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence() + + /** + * Method getAlignmentSequenceCount + * + * + * + * @return int + */ + public int getAlignmentSequenceCount() + { + return _alignmentSequenceList.size(); + } //-- int getAlignmentSequenceCount() + + /** + * 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() + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @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 'modifiable'. + * + * @return String + * @return the value of field 'modifiable'. + */ + public java.lang.String getModifiable() + { + return this._modifiable; + } //-- java.lang.String getModifiable() + + /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public uk.ac.vamsas.objects.core.Property getProperty(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public uk.ac.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + uk.ac.vamsas.objects.core.Property[] mArray = new uk.ac.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Property[] getProperty() + + /** + * Method getPropertyCount + * + * + * + * @return int + */ + public int getPropertyCount() + { + return _propertyList.size(); + } //-- int getPropertyCount() + + /** + * Returns the value of field 'provenance'. + * + * @return Provenance + * @return the value of field 'provenance'. + */ + public uk.ac.vamsas.objects.core.Provenance getProvenance() + { + return this._provenance; + } //-- uk.ac.vamsas.objects.core.Provenance getProvenance() + + /** + * Method getTree + * + * + * + * @param index + * @return Tree + */ + public uk.ac.vamsas.objects.core.Tree getTree(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _treeList.size())) { + throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Tree) _treeList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Tree getTree(int) + + /** + * Method getTree + * + * + * + * @return Tree + */ + public uk.ac.vamsas.objects.core.Tree[] getTree() + { + int size = _treeList.size(); + uk.ac.vamsas.objects.core.Tree[] mArray = new uk.ac.vamsas.objects.core.Tree[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Tree) _treeList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Tree[] getTree() + + /** + * Method getTreeCount + * + * + * + * @return int + */ + public int getTreeCount() + { + return _treeList.size(); + } //-- int getTreeCount() + + /** + * 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 removeAlignmentAnnotation + * + * + * + * @param index + * @return AlignmentAnnotation + */ + public uk.ac.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotation(int index) + { + java.lang.Object obj = _alignmentAnnotationList.elementAt(index); + _alignmentAnnotationList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.AlignmentAnnotation) obj; + } //-- uk.ac.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotation(int) + + /** + * Method removeAlignmentSequence + * + * + * + * @param index + * @return AlignmentSequence + */ + public uk.ac.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int index) + { + java.lang.Object obj = _alignmentSequenceList.elementAt(index); + _alignmentSequenceList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.AlignmentSequence) obj; + } //-- uk.ac.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int) + + /** + * Method removeAllAlignmentAnnotation + * + */ + public void removeAllAlignmentAnnotation() + { + _alignmentAnnotationList.removeAllElements(); + } //-- void removeAllAlignmentAnnotation() + + /** + * Method removeAllAlignmentSequence + * + */ + public void removeAllAlignmentSequence() + { + _alignmentSequenceList.removeAllElements(); + } //-- void removeAllAlignmentSequence() + + /** + * Method removeAllProperty + * + */ + public void removeAllProperty() + { + _propertyList.removeAllElements(); + } //-- void removeAllProperty() + + /** + * Method removeAllTree + * + */ + public void removeAllTree() + { + _treeList.removeAllElements(); + } //-- void removeAllTree() + + /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public uk.ac.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Property) obj; + } //-- uk.ac.vamsas.objects.core.Property removeProperty(int) + + /** + * Method removeTree + * + * + * + * @param index + * @return Tree + */ + public uk.ac.vamsas.objects.core.Tree removeTree(int index) + { + java.lang.Object obj = _treeList.elementAt(index); + _treeList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Tree) obj; + } //-- uk.ac.vamsas.objects.core.Tree removeTree(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 setAlignmentAnnotation + * + * + * + * @param index + * @param vAlignmentAnnotation + */ + public void setAlignmentAnnotation(int index, uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _alignmentAnnotationList.size())) { + throw new IndexOutOfBoundsException("setAlignmentAnnotation: Index value '"+index+"' not in range [0.."+_alignmentAnnotationList.size()+ "]"); + } + _alignmentAnnotationList.setElementAt(vAlignmentAnnotation, index); + } //-- void setAlignmentAnnotation(int, uk.ac.vamsas.objects.core.AlignmentAnnotation) + + /** + * Method setAlignmentAnnotation + * + * + * + * @param alignmentAnnotationArray + */ + public void setAlignmentAnnotation(uk.ac.vamsas.objects.core.AlignmentAnnotation[] alignmentAnnotationArray) + { + //-- copy array + _alignmentAnnotationList.removeAllElements(); + for (int i = 0; i < alignmentAnnotationArray.length; i++) { + _alignmentAnnotationList.addElement(alignmentAnnotationArray[i]); + } + } //-- void setAlignmentAnnotation(uk.ac.vamsas.objects.core.AlignmentAnnotation) + + /** + * Method setAlignmentSequence + * + * + * + * @param index + * @param vAlignmentSequence + */ + public void setAlignmentSequence(int index, uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _alignmentSequenceList.size())) { + throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]"); + } + _alignmentSequenceList.setElementAt(vAlignmentSequence, index); + } //-- void setAlignmentSequence(int, uk.ac.vamsas.objects.core.AlignmentSequence) + + /** + * Method setAlignmentSequence + * + * + * + * @param alignmentSequenceArray + */ + public void setAlignmentSequence(uk.ac.vamsas.objects.core.AlignmentSequence[] alignmentSequenceArray) + { + //-- copy array + _alignmentSequenceList.removeAllElements(); + for (int i = 0; i < alignmentSequenceArray.length; i++) { + _alignmentSequenceList.addElement(alignmentSequenceArray[i]); + } + } //-- void setAlignmentSequence(uk.ac.vamsas.objects.core.AlignmentSequence) + + /** + * 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) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @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 'modifiable'. + * + * @param modifiable the value of field 'modifiable'. + */ + public void setModifiable(java.lang.String modifiable) + { + this._modifiable = modifiable; + } //-- void setModifiable(java.lang.String) + + /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + _propertyList.setElementAt(vProperty, index); + } //-- void setProperty(int, uk.ac.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(uk.ac.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(uk.ac.vamsas.objects.core.Property) + + /** + * Sets the value of field 'provenance'. + * + * @param provenance the value of field 'provenance'. + */ + public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) + { + this._provenance = provenance; + } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + + /** + * Method setTree + * + * + * + * @param index + * @param vTree + */ + public void setTree(int index, uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _treeList.size())) { + throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + } + _treeList.setElementAt(vTree, index); + } //-- void setTree(int, uk.ac.vamsas.objects.core.Tree) + + /** + * Method setTree + * + * + * + * @param treeArray + */ + public void setTree(uk.ac.vamsas.objects.core.Tree[] treeArray) + { + //-- copy array + _treeList.removeAllElements(); + for (int i = 0; i < treeArray.length; i++) { + _treeList.addElement(treeArray[i]); + } + } //-- void setTree(uk.ac.vamsas.objects.core.Tree) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Alignment + */ + public static uk.ac.vamsas.objects.core.Alignment unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Alignment) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Alignment.class, reader); + } //-- uk.ac.vamsas.objects.core.Alignment 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/uk/ac/vamsas/objects/core/AlignmentAnnotation.java b/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java new file mode 100644 index 0000000..0177f31 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/AlignmentAnnotation.java @@ -0,0 +1,249 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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; + +/** + * This is annotation over the coordinate frame + * defined by all the columns in the alignment. + * + * + * @version $Revision$ $Date$ + */ +public class AlignmentAnnotation extends uk.ac.vamsas.objects.core.RangeAnnotation +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * TODO: decide if this flag is + * redundant - when true it would suggest that + * the annotationElement values together form a + * graph + */ + private boolean _graph; + + /** + * keeps track of state for field: _graph + */ + private boolean _has_graph; + + /** + * Field _provenance + */ + private uk.ac.vamsas.objects.core.Provenance _provenance; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AlignmentAnnotation() + { + super(); + } //-- uk.ac.vamsas.objects.core.AlignmentAnnotation() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteGraph + * + */ + public void deleteGraph() + { + this._has_graph= false; + } //-- void deleteGraph() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof AlignmentAnnotation) { + + AlignmentAnnotation temp = (AlignmentAnnotation)obj; + if (this._graph != temp._graph) + return false; + if (this._has_graph != temp._has_graph) + 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; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'graph'. The field 'graph' has + * the following description: TODO: decide if this flag is + * redundant - when true it would suggest that + * the annotationElement values together form a + * graph + * + * @return boolean + * @return the value of field 'graph'. + */ + public boolean getGraph() + { + return this._graph; + } //-- boolean getGraph() + + /** + * Returns the value of field 'provenance'. + * + * @return Provenance + * @return the value of field 'provenance'. + */ + public uk.ac.vamsas.objects.core.Provenance getProvenance() + { + return this._provenance; + } //-- uk.ac.vamsas.objects.core.Provenance getProvenance() + + /** + * Method hasGraph + * + * + * + * @return boolean + */ + public boolean hasGraph() + { + return this._has_graph; + } //-- boolean hasGraph() + + /** + * 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 'graph'. The field 'graph' has the + * following description: TODO: decide if this flag is + * redundant - when true it would suggest that + * the annotationElement values together form a + * 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 'provenance'. + * + * @param provenance the value of field 'provenance'. + */ + public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) + { + this._provenance = provenance; + } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return RangeType + */ + public static uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.AlignmentAnnotation) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentAnnotation.class, reader); + } //-- uk.ac.vamsas.objects.core.RangeType 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/uk/ac/vamsas/objects/core/AlignmentAnnotationDescriptor.java b/src/uk/ac/vamsas/objects/core/AlignmentAnnotationDescriptor.java new file mode 100644 index 0000000..a91bedb --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/AlignmentAnnotationDescriptor.java @@ -0,0 +1,255 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 AlignmentAnnotationDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AlignmentAnnotationDescriptor extends uk.ac.vamsas.objects.core.RangeAnnotationDescriptor { + + + //--------------------------/ + //- 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 AlignmentAnnotationDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.RangeAnnotationDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "AlignmentAnnotation"; + + //-- 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 + + //-- _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 + { + AlignmentAnnotation target = (AlignmentAnnotation) 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 { + AlignmentAnnotation target = (AlignmentAnnotation) 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); + desc.setMultivalued(false); + 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); + //-- initialize element descriptors + + //-- _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 + { + AlignmentAnnotation target = (AlignmentAnnotation) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AlignmentAnnotation target = (AlignmentAnnotation) 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.org"); + 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); + } //-- uk.ac.vamsas.objects.core.AlignmentAnnotationDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.AlignmentAnnotation.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/uk/ac/vamsas/objects/core/AlignmentDescriptor.java b/src/uk/ac/vamsas/objects/core/AlignmentDescriptor.java new file mode 100644 index 0000000..16c60ca --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/AlignmentDescriptor.java @@ -0,0 +1,503 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:AlignmentDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +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 = "http://www.vamsas.org"; + xmlName = "Alignment"; + + //-- 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 + + //-- _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 + { + Alignment target = (Alignment) object; + return target.getGapChar(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) 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); + desc.setMultivalued(false); + 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 + { + Alignment target = (Alignment) 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 { + Alignment target = (Alignment) 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); + desc.setMultivalued(false); + 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); + //-- _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 + { + Alignment target = (Alignment) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) 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 + } + desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", 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 + { + Alignment target = (Alignment) object; + return target.getModifiable(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.setModifiable( (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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _modifiable + 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 + + //-- _alignmentAnnotationList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.AlignmentAnnotation.class, "_alignmentAnnotationList", "AlignmentAnnotation", 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.getAlignmentAnnotation(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.addAlignmentAnnotation( (uk.ac.vamsas.objects.core.AlignmentAnnotation) 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.AlignmentAnnotation(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _alignmentAnnotationList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _treeList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.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 + { + Alignment target = (Alignment) object; + return target.getTree(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.addTree( (uk.ac.vamsas.objects.core.Tree) 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.Tree(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.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); + //-- _alignmentSequenceList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.AlignmentSequence.class, "_alignmentSequenceList", "alignmentSequence", 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.getAlignmentSequence(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.addAlignmentSequence( (uk.ac.vamsas.objects.core.AlignmentSequence) 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.AlignmentSequence(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _alignmentSequenceList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.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 + { + Alignment target = (Alignment) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.addProperty( (uk.ac.vamsas.objects.core.Property) 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.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.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); + //-- _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 + { + Alignment target = (Alignment) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) 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.org"); + 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); + } //-- uk.ac.vamsas.objects.core.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 uk.ac.vamsas.objects.core.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/uk/ac/vamsas/objects/core/AlignmentSequence.java b/src/uk/ac/vamsas/objects/core/AlignmentSequence.java new file mode 100644 index 0000000..6e611a3 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/AlignmentSequence.java @@ -0,0 +1,385 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:AlignmentSequence.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 AlignmentSequence. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class AlignmentSequence extends uk.ac.vamsas.objects.core.SequenceType +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Primary Key for vamsas object + * referencing + */ + private java.lang.String _id; + + /** + * Dataset Sequence from which + * this alignment sequence is taken from + * + */ + private java.lang.Object _refid; + + /** + * Field _alignmentSequenceAnnotationList + */ + private java.util.Vector _alignmentSequenceAnnotationList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AlignmentSequence() + { + super(); + _alignmentSequenceAnnotationList = new Vector(); + } //-- uk.ac.vamsas.objects.core.AlignmentSequence() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addAlignmentSequenceAnnotation + * + * + * + * @param vAlignmentSequenceAnnotation + */ + public void addAlignmentSequenceAnnotation(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) + throws java.lang.IndexOutOfBoundsException + { + _alignmentSequenceAnnotationList.addElement(vAlignmentSequenceAnnotation); + } //-- void addAlignmentSequenceAnnotation(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) + + /** + * Method addAlignmentSequenceAnnotation + * + * + * + * @param index + * @param vAlignmentSequenceAnnotation + */ + public void addAlignmentSequenceAnnotation(int index, uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) + throws java.lang.IndexOutOfBoundsException + { + _alignmentSequenceAnnotationList.insertElementAt(vAlignmentSequenceAnnotation, index); + } //-- void addAlignmentSequenceAnnotation(int, uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) + + /** + * Method enumerateAlignmentSequenceAnnotation + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAlignmentSequenceAnnotation() + { + return _alignmentSequenceAnnotationList.elements(); + } //-- java.util.Enumeration enumerateAlignmentSequenceAnnotation() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof AlignmentSequence) { + + AlignmentSequence temp = (AlignmentSequence)obj; + 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._refid != null) { + if (temp._refid == null) return false; + else if (!(this._refid.equals(temp._refid))) + return false; + } + else if (temp._refid != null) + return false; + if (this._alignmentSequenceAnnotationList != null) { + if (temp._alignmentSequenceAnnotationList == null) return false; + else if (!(this._alignmentSequenceAnnotationList.equals(temp._alignmentSequenceAnnotationList))) + return false; + } + else if (temp._alignmentSequenceAnnotationList != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Method getAlignmentSequenceAnnotation + * + * + * + * @param index + * @return AlignmentSequenceAnnotation + */ + public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation getAlignmentSequenceAnnotation(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _alignmentSequenceAnnotationList.size())) { + throw new IndexOutOfBoundsException("getAlignmentSequenceAnnotation: Index value '"+index+"' not in range [0.."+_alignmentSequenceAnnotationList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) _alignmentSequenceAnnotationList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation getAlignmentSequenceAnnotation(int) + + /** + * Method getAlignmentSequenceAnnotation + * + * + * + * @return AlignmentSequenceAnnotation + */ + public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] getAlignmentSequenceAnnotation() + { + int size = _alignmentSequenceAnnotationList.size(); + uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] mArray = new uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) _alignmentSequenceAnnotationList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] getAlignmentSequenceAnnotation() + + /** + * Method getAlignmentSequenceAnnotationCount + * + * + * + * @return int + */ + public int getAlignmentSequenceAnnotationCount() + { + return _alignmentSequenceAnnotationList.size(); + } //-- int getAlignmentSequenceAnnotationCount() + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * @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 'refid'. The field 'refid' has + * the following description: Dataset Sequence from which + * this alignment sequence is taken from + * + * + * @return Object + * @return the value of field 'refid'. + */ + public java.lang.Object getRefid() + { + return this._refid; + } //-- java.lang.Object getRefid() + + /** + * 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 removeAlignmentSequenceAnnotation + * + * + * + * @param index + * @return AlignmentSequenceAnnotation + */ + public uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation removeAlignmentSequenceAnnotation(int index) + { + java.lang.Object obj = _alignmentSequenceAnnotationList.elementAt(index); + _alignmentSequenceAnnotationList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) obj; + } //-- uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation removeAlignmentSequenceAnnotation(int) + + /** + * Method removeAllAlignmentSequenceAnnotation + * + */ + public void removeAllAlignmentSequenceAnnotation() + { + _alignmentSequenceAnnotationList.removeAllElements(); + } //-- void removeAllAlignmentSequenceAnnotation() + + /** + * Method setAlignmentSequenceAnnotation + * + * + * + * @param index + * @param vAlignmentSequenceAnnotation + */ + public void setAlignmentSequenceAnnotation(int index, uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _alignmentSequenceAnnotationList.size())) { + throw new IndexOutOfBoundsException("setAlignmentSequenceAnnotation: Index value '"+index+"' not in range [0.."+_alignmentSequenceAnnotationList.size()+ "]"); + } + _alignmentSequenceAnnotationList.setElementAt(vAlignmentSequenceAnnotation, index); + } //-- void setAlignmentSequenceAnnotation(int, uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) + + /** + * Method setAlignmentSequenceAnnotation + * + * + * + * @param alignmentSequenceAnnotationArray + */ + public void setAlignmentSequenceAnnotation(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation[] alignmentSequenceAnnotationArray) + { + //-- copy array + _alignmentSequenceAnnotationList.removeAllElements(); + for (int i = 0; i < alignmentSequenceAnnotationArray.length; i++) { + _alignmentSequenceAnnotationList.addElement(alignmentSequenceAnnotationArray[i]); + } + } //-- void setAlignmentSequenceAnnotation(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * @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 'refid'. The field 'refid' has the + * following description: Dataset Sequence from which + * this alignment sequence is taken from + * + * + * @param refid the value of field 'refid'. + */ + public void setRefid(java.lang.Object refid) + { + this._refid = refid; + } //-- void setRefid(java.lang.Object) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return SequenceType + */ + public static uk.ac.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.AlignmentSequence) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentSequence.class, reader); + } //-- uk.ac.vamsas.objects.core.SequenceType 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/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java b/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java new file mode 100644 index 0000000..4be2cf6 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotation.java @@ -0,0 +1,256 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 AlignmentSequenceAnnotation. + * + * @version $Revision$ $Date$ + */ +public class AlignmentSequenceAnnotation extends uk.ac.vamsas.objects.core.RangeAnnotation +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * TODO: + * decide if this flag is + * redundant - when true it + * would suggest that the + * annotationElement values + * together form a graph + * + */ + private boolean _graph; + + /** + * keeps track of state for field: _graph + */ + private boolean _has_graph; + + /** + * Field _provenance + */ + private uk.ac.vamsas.objects.core.Provenance _provenance; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AlignmentSequenceAnnotation() + { + super(); + } //-- uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteGraph + * + */ + public void deleteGraph() + { + this._has_graph= false; + } //-- void deleteGraph() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof AlignmentSequenceAnnotation) { + + AlignmentSequenceAnnotation temp = (AlignmentSequenceAnnotation)obj; + if (this._graph != temp._graph) + return false; + if (this._has_graph != temp._has_graph) + 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; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'graph'. The field 'graph' has + * the following description: TODO: + * decide if this flag is + * redundant - when true it + * would suggest that the + * annotationElement values + * together form a graph + * + * + * @return boolean + * @return the value of field 'graph'. + */ + public boolean getGraph() + { + return this._graph; + } //-- boolean getGraph() + + /** + * Returns the value of field 'provenance'. + * + * @return Provenance + * @return the value of field 'provenance'. + */ + public uk.ac.vamsas.objects.core.Provenance getProvenance() + { + return this._provenance; + } //-- uk.ac.vamsas.objects.core.Provenance getProvenance() + + /** + * Method hasGraph + * + * + * + * @return boolean + */ + public boolean hasGraph() + { + return this._has_graph; + } //-- boolean hasGraph() + + /** + * 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 'graph'. The field 'graph' has the + * following description: TODO: + * decide if this flag is + * redundant - when true it + * would suggest that the + * annotationElement values + * together form a 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 'provenance'. + * + * @param provenance the value of field 'provenance'. + */ + public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) + { + this._provenance = provenance; + } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return RangeType + */ + public static uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class, reader); + } //-- uk.ac.vamsas.objects.core.RangeType 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/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotationDescriptor.java b/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotationDescriptor.java new file mode 100644 index 0000000..8099f4e --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/AlignmentSequenceAnnotationDescriptor.java @@ -0,0 +1,255 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 AlignmentSequenceAnnotationDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AlignmentSequenceAnnotationDescriptor extends uk.ac.vamsas.objects.core.RangeAnnotationDescriptor { + + + //--------------------------/ + //- 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 AlignmentSequenceAnnotationDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.RangeAnnotationDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "AlignmentSequenceAnnotation"; + + //-- 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 + + //-- _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 + { + AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) 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 { + AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) 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); + desc.setMultivalued(false); + 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); + //-- initialize element descriptors + + //-- _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 + { + AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AlignmentSequenceAnnotation target = (AlignmentSequenceAnnotation) 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.org"); + 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); + } //-- uk.ac.vamsas.objects.core.AlignmentSequenceAnnotationDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.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/uk/ac/vamsas/objects/core/AlignmentSequenceDescriptor.java b/src/uk/ac/vamsas/objects/core/AlignmentSequenceDescriptor.java new file mode 100644 index 0000000..48fd08f --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/AlignmentSequenceDescriptor.java @@ -0,0 +1,282 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:AlignmentSequenceDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 AlignmentSequenceDescriptor. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class AlignmentSequenceDescriptor extends uk.ac.vamsas.objects.core.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 AlignmentSequenceDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.SequenceTypeDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "alignmentSequence"; + + //-- 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 + + //-- _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 + { + AlignmentSequence target = (AlignmentSequence) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AlignmentSequence target = (AlignmentSequence) 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 + } + desc.setValidator(fieldValidator); + //-- _refid + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_refid", "refid", 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 + { + AlignmentSequence target = (AlignmentSequence) object; + return target.getRefid(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AlignmentSequence target = (AlignmentSequence) object; + target.setRefid( (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: _refid + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _alignmentSequenceAnnotationList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation.class, "_alignmentSequenceAnnotationList", "AlignmentSequenceAnnotation", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AlignmentSequence target = (AlignmentSequence) object; + return target.getAlignmentSequenceAnnotation(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AlignmentSequence target = (AlignmentSequence) object; + target.addAlignmentSequenceAnnotation( (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) 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.AlignmentSequenceAnnotation(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _alignmentSequenceAnnotationList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- uk.ac.vamsas.objects.core.AlignmentSequenceDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.AlignmentSequence.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/uk/ac/vamsas/objects/core/AnnotationElement.java b/src/uk/ac/vamsas/objects/core/AnnotationElement.java new file mode 100644 index 0000000..42969e3 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/AnnotationElement.java @@ -0,0 +1,673 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:AnnotationElement.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 AnnotationElement. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class AnnotationElement extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * position with respect to the coordinate frame defined by a + * rangeType specification + */ + private int _position; + + /** + * keeps track of state for field: _position + */ + private boolean _has_position; + + /** + * true means the annotation element appears between the + * specified position and the next + */ + private boolean _after = false; + + /** + * keeps track of state for field: _after + */ + private boolean _has_after; + + /** + * Primary Key for vamsas object referencing + */ + private java.lang.String _id; + + /** + * Free text at this position + */ + private java.lang.String _description; + + /** + * Discrete symbol - possibly graphically represented + * + */ + private java.util.Vector _glyphList; + + /** + * Ordered set of float values - an application may treat + * the values together as a vector with common support for a + * set of + * annotation elements - but this is, again, not validated so + * applications + * should deal gracefully with varying numbers of dimensions + * + */ + private java.util.Vector _valueList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AnnotationElement() + { + super(); + _glyphList = new Vector(); + _valueList = new Vector(); + } //-- uk.ac.vamsas.objects.core.AnnotationElement() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addGlyph + * + * + * + * @param vGlyph + */ + public void addGlyph(uk.ac.vamsas.objects.core.Glyph vGlyph) + throws java.lang.IndexOutOfBoundsException + { + _glyphList.addElement(vGlyph); + } //-- void addGlyph(uk.ac.vamsas.objects.core.Glyph) + + /** + * Method addGlyph + * + * + * + * @param index + * @param vGlyph + */ + public void addGlyph(int index, uk.ac.vamsas.objects.core.Glyph vGlyph) + throws java.lang.IndexOutOfBoundsException + { + _glyphList.insertElementAt(vGlyph, index); + } //-- void addGlyph(int, uk.ac.vamsas.objects.core.Glyph) + + /** + * Method addValue + * + * + * + * @param vValue + */ + public void addValue(float vValue) + throws java.lang.IndexOutOfBoundsException + { + _valueList.addElement(new java.lang.Float(vValue)); + } //-- void addValue(float) + + /** + * Method addValue + * + * + * + * @param index + * @param vValue + */ + public void addValue(int index, float vValue) + throws java.lang.IndexOutOfBoundsException + { + _valueList.insertElementAt(new java.lang.Float(vValue), index); + } //-- void addValue(int, float) + + /** + * Method deleteAfter + * + */ + public void deleteAfter() + { + this._has_after= false; + } //-- void deleteAfter() + + /** + * Method deletePosition + * + */ + public void deletePosition() + { + this._has_position= false; + } //-- void deletePosition() + + /** + * Method enumerateGlyph + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateGlyph() + { + return _glyphList.elements(); + } //-- java.util.Enumeration enumerateGlyph() + + /** + * Method enumerateValue + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateValue() + { + return _valueList.elements(); + } //-- java.util.Enumeration enumerateValue() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof AnnotationElement) { + + AnnotationElement temp = (AnnotationElement)obj; + if (this._position != temp._position) + return false; + if (this._has_position != temp._has_position) + return false; + if (this._after != temp._after) + return false; + if (this._has_after != temp._has_after) + 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._description != null) { + if (temp._description == null) return false; + else if (!(this._description.equals(temp._description))) + return false; + } + else if (temp._description != null) + return false; + if (this._glyphList != null) { + if (temp._glyphList == null) return false; + else if (!(this._glyphList.equals(temp._glyphList))) + return false; + } + else if (temp._glyphList != null) + return false; + if (this._valueList != null) { + if (temp._valueList == null) return false; + else if (!(this._valueList.equals(temp._valueList))) + return false; + } + else if (temp._valueList != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'after'. The field 'after' has + * the following description: true means the annotation element + * appears between the + * specified position and the next + * + * @return boolean + * @return the value of field 'after'. + */ + public boolean getAfter() + { + return this._after; + } //-- boolean getAfter() + + /** + * Returns the value of field 'description'. The field + * 'description' has the following description: Free text at + * this position + * + * @return String + * @return the value of field 'description'. + */ + public java.lang.String getDescription() + { + return this._description; + } //-- java.lang.String getDescription() + + /** + * Method getGlyph + * + * + * + * @param index + * @return Glyph + */ + public uk.ac.vamsas.objects.core.Glyph getGlyph(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _glyphList.size())) { + throw new IndexOutOfBoundsException("getGlyph: Index value '"+index+"' not in range [0.."+_glyphList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Glyph) _glyphList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Glyph getGlyph(int) + + /** + * Method getGlyph + * + * + * + * @return Glyph + */ + public uk.ac.vamsas.objects.core.Glyph[] getGlyph() + { + int size = _glyphList.size(); + uk.ac.vamsas.objects.core.Glyph[] mArray = new uk.ac.vamsas.objects.core.Glyph[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Glyph) _glyphList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Glyph[] getGlyph() + + /** + * Method getGlyphCount + * + * + * + * @return int + */ + public int getGlyphCount() + { + return _glyphList.size(); + } //-- int getGlyphCount() + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * @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 'position'. The field 'position' + * has the following description: position with respect to the + * coordinate frame defined by a + * rangeType specification + * + * @return int + * @return the value of field 'position'. + */ + public int getPosition() + { + return this._position; + } //-- int getPosition() + + /** + * Method getValue + * + * + * + * @param index + * @return float + */ + public float getValue(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _valueList.size())) { + throw new IndexOutOfBoundsException("getValue: Index value '"+index+"' not in range [0.."+_valueList.size()+ "]"); + } + + return ((java.lang.Float)_valueList.elementAt(index)).floatValue(); + } //-- float getValue(int) + + /** + * Method getValue + * + * + * + * @return float + */ + public float[] getValue() + { + int size = _valueList.size(); + float[] mArray = new float[size]; + for (int index = 0; index < size; index++) { + mArray[index] = ((java.lang.Float)_valueList.elementAt(index)).floatValue(); + } + return mArray; + } //-- float[] getValue() + + /** + * Method getValueCount + * + * + * + * @return int + */ + public int getValueCount() + { + return _valueList.size(); + } //-- int getValueCount() + + /** + * Method hasAfter + * + * + * + * @return boolean + */ + public boolean hasAfter() + { + return this._has_after; + } //-- boolean hasAfter() + + /** + * Method hasPosition + * + * + * + * @return boolean + */ + public boolean hasPosition() + { + return this._has_position; + } //-- boolean hasPosition() + + /** + * 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 removeAllGlyph + * + */ + public void removeAllGlyph() + { + _glyphList.removeAllElements(); + } //-- void removeAllGlyph() + + /** + * Method removeAllValue + * + */ + public void removeAllValue() + { + _valueList.removeAllElements(); + } //-- void removeAllValue() + + /** + * Method removeGlyph + * + * + * + * @param index + * @return Glyph + */ + public uk.ac.vamsas.objects.core.Glyph removeGlyph(int index) + { + java.lang.Object obj = _glyphList.elementAt(index); + _glyphList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Glyph) obj; + } //-- uk.ac.vamsas.objects.core.Glyph removeGlyph(int) + + /** + * Method removeValue + * + * + * + * @param index + * @return float + */ + public float removeValue(int index) + { + java.lang.Object obj = _valueList.elementAt(index); + _valueList.removeElementAt(index); + return ((java.lang.Float)obj).floatValue(); + } //-- float removeValue(int) + + /** + * Sets the value of field 'after'. The field 'after' has the + * following description: true means the annotation element + * appears between the + * specified position and the next + * + * @param after the value of field 'after'. + */ + public void setAfter(boolean after) + { + this._after = after; + this._has_after = true; + } //-- void setAfter(boolean) + + /** + * Sets the value of field 'description'. The field + * 'description' has the following description: Free text at + * this position + * + * @param description the value of field 'description'. + */ + public void setDescription(java.lang.String description) + { + this._description = description; + } //-- void setDescription(java.lang.String) + + /** + * Method setGlyph + * + * + * + * @param index + * @param vGlyph + */ + public void setGlyph(int index, uk.ac.vamsas.objects.core.Glyph vGlyph) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _glyphList.size())) { + throw new IndexOutOfBoundsException("setGlyph: Index value '"+index+"' not in range [0.."+_glyphList.size()+ "]"); + } + _glyphList.setElementAt(vGlyph, index); + } //-- void setGlyph(int, uk.ac.vamsas.objects.core.Glyph) + + /** + * Method setGlyph + * + * + * + * @param glyphArray + */ + public void setGlyph(uk.ac.vamsas.objects.core.Glyph[] glyphArray) + { + //-- copy array + _glyphList.removeAllElements(); + for (int i = 0; i < glyphArray.length; i++) { + _glyphList.addElement(glyphArray[i]); + } + } //-- void setGlyph(uk.ac.vamsas.objects.core.Glyph) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * @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 'position'. The field 'position' has + * the following description: position with respect to the + * coordinate frame defined by a + * rangeType specification + * + * @param position the value of field 'position'. + */ + public void setPosition(int position) + { + this._position = position; + this._has_position = true; + } //-- void setPosition(int) + + /** + * Method setValue + * + * + * + * @param index + * @param vValue + */ + public void setValue(int index, float vValue) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _valueList.size())) { + throw new IndexOutOfBoundsException("setValue: Index value '"+index+"' not in range [0.."+_valueList.size()+ "]"); + } + _valueList.setElementAt(new java.lang.Float(vValue), index); + } //-- void setValue(int, float) + + /** + * Method setValue + * + * + * + * @param valueArray + */ + public void setValue(float[] valueArray) + { + //-- copy array + _valueList.removeAllElements(); + for (int i = 0; i < valueArray.length; i++) { + _valueList.addElement(new java.lang.Float(valueArray[i])); + } + } //-- void setValue(float) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return AnnotationElement + */ + public static uk.ac.vamsas.objects.core.AnnotationElement unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.AnnotationElement) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AnnotationElement.class, reader); + } //-- uk.ac.vamsas.objects.core.AnnotationElement 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/uk/ac/vamsas/objects/core/AnnotationElementDescriptor.java b/src/uk/ac/vamsas/objects/core/AnnotationElementDescriptor.java new file mode 100644 index 0000000..117f585 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/AnnotationElementDescriptor.java @@ -0,0 +1,405 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:AnnotationElementDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +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 = "http://www.vamsas.org"; + xmlName = "annotationElement"; + + //-- 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 + + //-- _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); + desc.setMultivalued(false); + 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); + //-- _after + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_after", "after", 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.hasAfter()) + return null; + return (target.getAfter() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteAfter(); + return; + } + target.setAfter( ((java.lang.Boolean)value).booleanValue()); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _after + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + 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 + { + AnnotationElement target = (AnnotationElement) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) 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 + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _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("http://www.vamsas.org"); + desc.setMultivalued(false); + 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); + //-- _glyphList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Glyph.class, "_glyphList", "glyph", 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; + return target.getGlyph(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AnnotationElement target = (AnnotationElement) object; + target.addGlyph( (uk.ac.vamsas.objects.core.Glyph) 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.Glyph(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _glyphList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _valueList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_valueList", "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; + return 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.addValue( ((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("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _valueList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + FloatValidator typeValidator = new FloatValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + } //-- uk.ac.vamsas.objects.core.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 uk.ac.vamsas.objects.core.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/uk/ac/vamsas/objects/core/AppData.java b/src/uk/ac/vamsas/objects/core/AppData.java new file mode 100644 index 0000000..857f0a8 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/AppData.java @@ -0,0 +1,239 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 AppData. + * + * @version $Revision$ $Date$ + */ +public class AppData extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Internal choice value storage + */ + private java.lang.Object _choiceValue; + + /** + * Field _data + */ + private byte[] _data; + + /** + * Field _dataReference + */ + private java.lang.String _dataReference; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AppData() + { + super(); + } //-- uk.ac.vamsas.objects.core.AppData() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof AppData) { + + AppData temp = (AppData)obj; + if (this._choiceValue != null) { + if (temp._choiceValue == null) return false; + else if (!(this._choiceValue.equals(temp._choiceValue))) + return false; + } + else if (temp._choiceValue != null) + return false; + if (this._data != null) { + if (temp._data == null) return false; + else if (!(this._data.equals(temp._data))) + return false; + } + else if (temp._data != null) + return false; + if (this._dataReference != null) { + if (temp._dataReference == null) return false; + else if (!(this._dataReference.equals(temp._dataReference))) + return false; + } + else if (temp._dataReference != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'choiceValue'. The field + * 'choiceValue' has the following description: Internal choice + * value storage + * + * @return Object + * @return the value of field 'choiceValue'. + */ + public java.lang.Object getChoiceValue() + { + return this._choiceValue; + } //-- java.lang.Object getChoiceValue() + + /** + * Returns the value of field 'data'. + * + * @return byte + * @return the value of field 'data'. + */ + public byte[] getData() + { + return this._data; + } //-- byte[] getData() + + /** + * Returns the value of field 'dataReference'. + * + * @return String + * @return the value of field 'dataReference'. + */ + public java.lang.String getDataReference() + { + return this._dataReference; + } //-- java.lang.String getDataReference() + + /** + * 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 'data'. + * + * @param data the value of field 'data'. + */ + public void setData(byte[] data) + { + this._data = data; + this._choiceValue = data; + } //-- void setData(byte) + + /** + * Sets the value of field 'dataReference'. + * + * @param dataReference the value of field 'dataReference'. + */ + public void setDataReference(java.lang.String dataReference) + { + this._dataReference = dataReference; + this._choiceValue = dataReference; + } //-- void setDataReference(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return AppData + */ + public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.AppData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.AppData.class, reader); + } //-- uk.ac.vamsas.objects.core.AppData 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/uk/ac/vamsas/objects/core/AppDataDescriptor.java b/src/uk/ac/vamsas/objects/core/AppDataDescriptor.java new file mode 100644 index 0000000..49c6be0 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/AppDataDescriptor.java @@ -0,0 +1,250 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 AppDataDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AppDataDescriptor 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 AppDataDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "appData"; + + //-- set grouping compositor + setCompositorAsChoice(); + 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 + + //-- initialize element descriptors + + //-- _data + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(byte[].class, "_data", "data", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AppData target = (AppData) object; + return target.getData(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AppData target = (AppData) object; + target.setData( (byte[]) 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("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _data + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _dataReference + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dataReference", "dataReference", 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 + { + AppData target = (AppData) object; + return target.getDataReference(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AppData target = (AppData) object; + target.setDataReference( (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("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _dataReference + 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); + } //-- uk.ac.vamsas.objects.core.AppDataDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.AppData.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/uk/ac/vamsas/objects/core/ApplicationData.java b/src/uk/ac/vamsas/objects/core/ApplicationData.java new file mode 100644 index 0000000..1e204e6 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/ApplicationData.java @@ -0,0 +1,572 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:ApplicationData.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 ApplicationData. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class ApplicationData extends uk.ac.vamsas.objects.core.AppData +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Version string describing the application specific + * data storage version used + */ + private java.lang.String _version; + + /** + * Canonical name of application + */ + private java.lang.String _name; + + /** + * Field _userList + */ + private java.util.Vector _userList; + + /** + * Field _common + */ + private uk.ac.vamsas.objects.core.Common _common; + + /** + * Field _instanceList + */ + private java.util.Vector _instanceList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public ApplicationData() + { + super(); + _userList = new Vector(); + _instanceList = new Vector(); + } //-- uk.ac.vamsas.objects.core.ApplicationData() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addInstance + * + * + * + * @param vInstance + */ + public void addInstance(uk.ac.vamsas.objects.core.Instance vInstance) + throws java.lang.IndexOutOfBoundsException + { + _instanceList.addElement(vInstance); + } //-- void addInstance(uk.ac.vamsas.objects.core.Instance) + + /** + * Method addInstance + * + * + * + * @param index + * @param vInstance + */ + public void addInstance(int index, uk.ac.vamsas.objects.core.Instance vInstance) + throws java.lang.IndexOutOfBoundsException + { + _instanceList.insertElementAt(vInstance, index); + } //-- void addInstance(int, uk.ac.vamsas.objects.core.Instance) + + /** + * Method addUser + * + * + * + * @param vUser + */ + public void addUser(uk.ac.vamsas.objects.core.User vUser) + throws java.lang.IndexOutOfBoundsException + { + _userList.addElement(vUser); + } //-- void addUser(uk.ac.vamsas.objects.core.User) + + /** + * Method addUser + * + * + * + * @param index + * @param vUser + */ + public void addUser(int index, uk.ac.vamsas.objects.core.User vUser) + throws java.lang.IndexOutOfBoundsException + { + _userList.insertElementAt(vUser, index); + } //-- void addUser(int, uk.ac.vamsas.objects.core.User) + + /** + * Method enumerateInstance + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateInstance() + { + return _instanceList.elements(); + } //-- java.util.Enumeration enumerateInstance() + + /** + * Method enumerateUser + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateUser() + { + return _userList.elements(); + } //-- java.util.Enumeration enumerateUser() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof ApplicationData) { + + ApplicationData temp = (ApplicationData)obj; + if (this._version != null) { + if (temp._version == null) return false; + else if (!(this._version.equals(temp._version))) + return false; + } + else if (temp._version != null) + return false; + if (this._name != null) { + if (temp._name == null) return false; + else if (!(this._name.equals(temp._name))) + return false; + } + else if (temp._name != null) + return false; + if (this._userList != null) { + if (temp._userList == null) return false; + else if (!(this._userList.equals(temp._userList))) + return false; + } + else if (temp._userList != null) + return false; + if (this._common != null) { + if (temp._common == null) return false; + else if (!(this._common.equals(temp._common))) + return false; + } + else if (temp._common != null) + return false; + if (this._instanceList != null) { + if (temp._instanceList == null) return false; + else if (!(this._instanceList.equals(temp._instanceList))) + return false; + } + else if (temp._instanceList != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'common'. + * + * @return Common + * @return the value of field 'common'. + */ + public uk.ac.vamsas.objects.core.Common getCommon() + { + return this._common; + } //-- uk.ac.vamsas.objects.core.Common getCommon() + + /** + * Method getInstance + * + * + * + * @param index + * @return Instance + */ + public uk.ac.vamsas.objects.core.Instance getInstance(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _instanceList.size())) { + throw new IndexOutOfBoundsException("getInstance: Index value '"+index+"' not in range [0.."+_instanceList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Instance) _instanceList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Instance getInstance(int) + + /** + * Method getInstance + * + * + * + * @return Instance + */ + public uk.ac.vamsas.objects.core.Instance[] getInstance() + { + int size = _instanceList.size(); + uk.ac.vamsas.objects.core.Instance[] mArray = new uk.ac.vamsas.objects.core.Instance[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Instance) _instanceList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Instance[] getInstance() + + /** + * Method getInstanceCount + * + * + * + * @return int + */ + public int getInstanceCount() + { + return _instanceList.size(); + } //-- int getInstanceCount() + + /** + * Returns the value of field 'name'. The field 'name' has the + * following description: Canonical name of application + * + * @return String + * @return the value of field 'name'. + */ + public java.lang.String getName() + { + return this._name; + } //-- java.lang.String getName() + + /** + * Method getUser + * + * + * + * @param index + * @return User + */ + public uk.ac.vamsas.objects.core.User getUser(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _userList.size())) { + throw new IndexOutOfBoundsException("getUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.User) _userList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.User getUser(int) + + /** + * Method getUser + * + * + * + * @return User + */ + public uk.ac.vamsas.objects.core.User[] getUser() + { + int size = _userList.size(); + uk.ac.vamsas.objects.core.User[] mArray = new uk.ac.vamsas.objects.core.User[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.User) _userList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.User[] getUser() + + /** + * Method getUserCount + * + * + * + * @return int + */ + public int getUserCount() + { + return _userList.size(); + } //-- int getUserCount() + + /** + * Returns the value of field 'version'. The field 'version' + * has the following description: Version string describing the + * application specific + * data storage version used + * + * @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) + + /** + * Method removeAllInstance + * + */ + public void removeAllInstance() + { + _instanceList.removeAllElements(); + } //-- void removeAllInstance() + + /** + * Method removeAllUser + * + */ + public void removeAllUser() + { + _userList.removeAllElements(); + } //-- void removeAllUser() + + /** + * Method removeInstance + * + * + * + * @param index + * @return Instance + */ + public uk.ac.vamsas.objects.core.Instance removeInstance(int index) + { + java.lang.Object obj = _instanceList.elementAt(index); + _instanceList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Instance) obj; + } //-- uk.ac.vamsas.objects.core.Instance removeInstance(int) + + /** + * Method removeUser + * + * + * + * @param index + * @return User + */ + public uk.ac.vamsas.objects.core.User removeUser(int index) + { + java.lang.Object obj = _userList.elementAt(index); + _userList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.User) obj; + } //-- uk.ac.vamsas.objects.core.User removeUser(int) + + /** + * Sets the value of field 'common'. + * + * @param common the value of field 'common'. + */ + public void setCommon(uk.ac.vamsas.objects.core.Common common) + { + this._common = common; + } //-- void setCommon(uk.ac.vamsas.objects.core.Common) + + /** + * Method setInstance + * + * + * + * @param index + * @param vInstance + */ + public void setInstance(int index, uk.ac.vamsas.objects.core.Instance vInstance) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _instanceList.size())) { + throw new IndexOutOfBoundsException("setInstance: Index value '"+index+"' not in range [0.."+_instanceList.size()+ "]"); + } + _instanceList.setElementAt(vInstance, index); + } //-- void setInstance(int, uk.ac.vamsas.objects.core.Instance) + + /** + * Method setInstance + * + * + * + * @param instanceArray + */ + public void setInstance(uk.ac.vamsas.objects.core.Instance[] instanceArray) + { + //-- copy array + _instanceList.removeAllElements(); + for (int i = 0; i < instanceArray.length; i++) { + _instanceList.addElement(instanceArray[i]); + } + } //-- void setInstance(uk.ac.vamsas.objects.core.Instance) + + /** + * Sets the value of field 'name'. The field 'name' has the + * following description: Canonical name of application + * + * @param name the value of field 'name'. + */ + public void setName(java.lang.String name) + { + this._name = name; + } //-- void setName(java.lang.String) + + /** + * Method setUser + * + * + * + * @param index + * @param vUser + */ + public void setUser(int index, uk.ac.vamsas.objects.core.User vUser) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _userList.size())) { + throw new IndexOutOfBoundsException("setUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]"); + } + _userList.setElementAt(vUser, index); + } //-- void setUser(int, uk.ac.vamsas.objects.core.User) + + /** + * Method setUser + * + * + * + * @param userArray + */ + public void setUser(uk.ac.vamsas.objects.core.User[] userArray) + { + //-- copy array + _userList.removeAllElements(); + for (int i = 0; i < userArray.length; i++) { + _userList.addElement(userArray[i]); + } + } //-- void setUser(uk.ac.vamsas.objects.core.User) + + /** + * Sets the value of field 'version'. The field 'version' has + * the following description: Version string describing the + * application specific + * data storage version used + * + * @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 AppData + */ + public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.ApplicationData) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.ApplicationData.class, reader); + } //-- uk.ac.vamsas.objects.core.AppData 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/uk/ac/vamsas/objects/core/ApplicationDataDescriptor.java b/src/uk/ac/vamsas/objects/core/ApplicationDataDescriptor.java new file mode 100644 index 0000000..412820b --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/ApplicationDataDescriptor.java @@ -0,0 +1,359 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:ApplicationDataDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 ApplicationDataDescriptor. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class ApplicationDataDescriptor extends uk.ac.vamsas.objects.core.AppDataDescriptor { + + + //--------------------------/ + //- 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 ApplicationDataDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.AppDataDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "ApplicationData"; + + //-- 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 + + //-- _version + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "version", 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 + { + ApplicationData target = (ApplicationData) object; + return target.getVersion(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ApplicationData target = (ApplicationData) 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.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); + //-- _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 + { + ApplicationData target = (ApplicationData) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ApplicationData target = (ApplicationData) 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); + 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); + //-- initialize element descriptors + + //-- _userList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.User.class, "_userList", "User", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + ApplicationData target = (ApplicationData) object; + return target.getUser(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ApplicationData target = (ApplicationData) object; + target.addUser( (uk.ac.vamsas.objects.core.User) 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.User(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _userList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _common + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Common.class, "_common", "Common", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + ApplicationData target = (ApplicationData) object; + return target.getCommon(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ApplicationData target = (ApplicationData) object; + target.setCommon( (uk.ac.vamsas.objects.core.Common) 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.Common(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _common + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _instanceList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Instance.class, "_instanceList", "Instance", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + ApplicationData target = (ApplicationData) object; + return target.getInstance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + ApplicationData target = (ApplicationData) object; + target.addInstance( (uk.ac.vamsas.objects.core.Instance) 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.Instance(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _instanceList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- uk.ac.vamsas.objects.core.ApplicationDataDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.ApplicationData.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/uk/ac/vamsas/objects/core/Attachment.java b/src/uk/ac/vamsas/objects/core/Attachment.java new file mode 100644 index 0000000..d0ed365 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Attachment.java @@ -0,0 +1,330 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Attachment. + * + * @version $Revision$ $Date$ + */ +public class Attachment extends uk.ac.vamsas.objects.core.AppData +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * true implies data will be decompresses with Zip + * before presenting to application + */ + private boolean _compressed = false; + + /** + * keeps track of state for field: _compressed + */ + private boolean _has_compressed; + + /** + * Type of arbitrary data - TODO: decide format - use + * (extended) MIME types ? + */ + private java.lang.String _type; + + /** + * Object the arbitrary data is associated with + * + */ + private java.lang.Object _objectref; + + /** + * Primary Key for vamsas object referencing + * + */ + private java.lang.String _id; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Attachment() + { + super(); + } //-- uk.ac.vamsas.objects.core.Attachment() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteCompressed + * + */ + public void deleteCompressed() + { + this._has_compressed= false; + } //-- void deleteCompressed() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Attachment) { + + Attachment temp = (Attachment)obj; + if (this._compressed != temp._compressed) + return false; + if (this._has_compressed != temp._has_compressed) + return false; + if (this._type != null) { + if (temp._type == null) return false; + else if (!(this._type.equals(temp._type))) + return false; + } + else if (temp._type != null) + return false; + if (this._objectref != null) { + if (temp._objectref == null) return false; + else if (!(this._objectref.equals(temp._objectref))) + return false; + } + else if (temp._objectref != 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; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'compressed'. The field + * 'compressed' has the following description: true implies + * data will be decompresses with Zip + * before presenting to application + * + * @return boolean + * @return the value of field 'compressed'. + */ + public boolean getCompressed() + { + return this._compressed; + } //-- boolean getCompressed() + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @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 'objectref'. The field + * 'objectref' has the following description: Object the + * arbitrary data is associated with + * + * + * @return Object + * @return the value of field 'objectref'. + */ + public java.lang.Object getObjectref() + { + return this._objectref; + } //-- java.lang.Object getObjectref() + + /** + * Returns the value of field 'type'. The field 'type' has the + * following description: Type of arbitrary data - TODO: decide + * format - use + * (extended) MIME types ? + * + * @return String + * @return the value of field 'type'. + */ + public java.lang.String getType() + { + return this._type; + } //-- java.lang.String getType() + + /** + * Method hasCompressed + * + * + * + * @return boolean + */ + public boolean hasCompressed() + { + return this._has_compressed; + } //-- boolean hasCompressed() + + /** + * 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 'compressed'. The field 'compressed' + * has the following description: true implies data will be + * decompresses with Zip + * before presenting to application + * + * @param compressed the value of field 'compressed'. + */ + public void setCompressed(boolean compressed) + { + this._compressed = compressed; + this._has_compressed = true; + } //-- void setCompressed(boolean) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @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 'objectref'. The field 'objectref' + * has the following description: Object the arbitrary data is + * associated with + * + * + * @param objectref the value of field 'objectref'. + */ + public void setObjectref(java.lang.Object objectref) + { + this._objectref = objectref; + } //-- void setObjectref(java.lang.Object) + + /** + * Sets the value of field 'type'. The field 'type' has the + * following description: Type of arbitrary data - TODO: decide + * format - use + * (extended) MIME types ? + * + * @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 AppData + */ + public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Attachment) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Attachment.class, reader); + } //-- uk.ac.vamsas.objects.core.AppData 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/uk/ac/vamsas/objects/core/AttachmentDescriptor.java b/src/uk/ac/vamsas/objects/core/AttachmentDescriptor.java new file mode 100644 index 0000000..830655d --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/AttachmentDescriptor.java @@ -0,0 +1,325 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 AttachmentDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AttachmentDescriptor extends uk.ac.vamsas.objects.core.AppDataDescriptor { + + + //--------------------------/ + //- 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 AttachmentDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.AppDataDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "Attachment"; + 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 + + //-- _compressed + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_compressed", "compressed", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Attachment target = (Attachment) object; + if(!target.hasCompressed()) + return null; + return (target.getCompressed() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Attachment target = (Attachment) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteCompressed(); + return; + } + target.setCompressed( ((java.lang.Boolean)value).booleanValue()); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _compressed + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + 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 + { + Attachment target = (Attachment) object; + return target.getType(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Attachment target = (Attachment) 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); + desc.setMultivalued(false); + 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); + //-- _objectref + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_objectref", "objectref", 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 + { + Attachment target = (Attachment) object; + return target.getObjectref(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Attachment target = (Attachment) object; + target.setObjectref( (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: _objectref + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + 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 + { + Attachment target = (Attachment) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Attachment target = (Attachment) 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 + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } //-- uk.ac.vamsas.objects.core.AttachmentDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Attachment.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/uk/ac/vamsas/objects/core/Common.java b/src/uk/ac/vamsas/objects/core/Common.java new file mode 100644 index 0000000..fcc9883 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Common.java @@ -0,0 +1,141 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Common. + * + * @version $Revision$ $Date$ + */ +public class Common extends uk.ac.vamsas.objects.core.AppData +implements java.io.Serializable +{ + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Common() + { + super(); + } //-- uk.ac.vamsas.objects.core.Common() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Common) { + + Common temp = (Common)obj; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * 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 AppData + */ + public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Common) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Common.class, reader); + } //-- uk.ac.vamsas.objects.core.AppData 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/uk/ac/vamsas/objects/core/CommonDescriptor.java b/src/uk/ac/vamsas/objects/core/CommonDescriptor.java new file mode 100644 index 0000000..6f2cc14 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/CommonDescriptor.java @@ -0,0 +1,167 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 CommonDescriptor. + * + * @version $Revision$ $Date$ + */ +public class CommonDescriptor extends uk.ac.vamsas.objects.core.AppDataDescriptor { + + + //--------------------------/ + //- 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 CommonDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.AppDataDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "Common"; + } //-- uk.ac.vamsas.objects.core.CommonDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Common.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/uk/ac/vamsas/objects/core/DataSet.java b/src/uk/ac/vamsas/objects/core/DataSet.java new file mode 100644 index 0000000..a215b61 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/DataSet.java @@ -0,0 +1,850 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:DataSet.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 DataSet. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class DataSet extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Primary Key for vamsas object referencing + */ + private java.lang.String _id; + + /** + * Field _sequenceList + */ + private java.util.Vector _sequenceList; + + /** + * Field _dataSetAnnotationsList + */ + private java.util.Vector _dataSetAnnotationsList; + + /** + * Field _alignmentList + */ + private java.util.Vector _alignmentList; + + /** + * Field _treeList + */ + private java.util.Vector _treeList; + + /** + * Field _provenance + */ + private uk.ac.vamsas.objects.core.Provenance _provenance; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public DataSet() + { + super(); + _sequenceList = new Vector(); + _dataSetAnnotationsList = new Vector(); + _alignmentList = new Vector(); + _treeList = new Vector(); + } //-- uk.ac.vamsas.objects.core.DataSet() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addAlignment + * + * + * + * @param vAlignment + */ + public void addAlignment(uk.ac.vamsas.objects.core.Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException + { + _alignmentList.addElement(vAlignment); + } //-- void addAlignment(uk.ac.vamsas.objects.core.Alignment) + + /** + * Method addAlignment + * + * + * + * @param index + * @param vAlignment + */ + public void addAlignment(int index, uk.ac.vamsas.objects.core.Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException + { + _alignmentList.insertElementAt(vAlignment, index); + } //-- void addAlignment(int, uk.ac.vamsas.objects.core.Alignment) + + /** + * Method addDataSetAnnotations + * + * + * + * @param vDataSetAnnotations + */ + public void addDataSetAnnotations(uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) + throws java.lang.IndexOutOfBoundsException + { + _dataSetAnnotationsList.addElement(vDataSetAnnotations); + } //-- void addDataSetAnnotations(uk.ac.vamsas.objects.core.DataSetAnnotations) + + /** + * Method addDataSetAnnotations + * + * + * + * @param index + * @param vDataSetAnnotations + */ + public void addDataSetAnnotations(int index, uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) + throws java.lang.IndexOutOfBoundsException + { + _dataSetAnnotationsList.insertElementAt(vDataSetAnnotations, index); + } //-- void addDataSetAnnotations(int, uk.ac.vamsas.objects.core.DataSetAnnotations) + + /** + * Method addSequence + * + * + * + * @param vSequence + */ + public void addSequence(uk.ac.vamsas.objects.core.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + _sequenceList.addElement(vSequence); + } //-- void addSequence(uk.ac.vamsas.objects.core.Sequence) + + /** + * Method addSequence + * + * + * + * @param index + * @param vSequence + */ + public void addSequence(int index, uk.ac.vamsas.objects.core.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + _sequenceList.insertElementAt(vSequence, index); + } //-- void addSequence(int, uk.ac.vamsas.objects.core.Sequence) + + /** + * Method addTree + * + * + * + * @param vTree + */ + public void addTree(uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + _treeList.addElement(vTree); + } //-- void addTree(uk.ac.vamsas.objects.core.Tree) + + /** + * Method addTree + * + * + * + * @param index + * @param vTree + */ + public void addTree(int index, uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + _treeList.insertElementAt(vTree, index); + } //-- void addTree(int, uk.ac.vamsas.objects.core.Tree) + + /** + * Method enumerateAlignment + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAlignment() + { + return _alignmentList.elements(); + } //-- java.util.Enumeration enumerateAlignment() + + /** + * Method enumerateDataSetAnnotations + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateDataSetAnnotations() + { + return _dataSetAnnotationsList.elements(); + } //-- java.util.Enumeration enumerateDataSetAnnotations() + + /** + * Method enumerateSequence + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateSequence() + { + return _sequenceList.elements(); + } //-- java.util.Enumeration enumerateSequence() + + /** + * Method enumerateTree + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateTree() + { + return _treeList.elements(); + } //-- java.util.Enumeration enumerateTree() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof DataSet) { + + DataSet temp = (DataSet)obj; + 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._sequenceList != null) { + if (temp._sequenceList == null) return false; + else if (!(this._sequenceList.equals(temp._sequenceList))) + return false; + } + else if (temp._sequenceList != null) + return false; + if (this._dataSetAnnotationsList != null) { + if (temp._dataSetAnnotationsList == null) return false; + else if (!(this._dataSetAnnotationsList.equals(temp._dataSetAnnotationsList))) + return false; + } + else if (temp._dataSetAnnotationsList != null) + return false; + if (this._alignmentList != null) { + if (temp._alignmentList == null) return false; + else if (!(this._alignmentList.equals(temp._alignmentList))) + return false; + } + else if (temp._alignmentList != null) + return false; + if (this._treeList != null) { + if (temp._treeList == null) return false; + else if (!(this._treeList.equals(temp._treeList))) + return false; + } + else if (temp._treeList != 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; + } //-- boolean equals(java.lang.Object) + + /** + * Method getAlignment + * + * + * + * @param index + * @return Alignment + */ + public uk.ac.vamsas.objects.core.Alignment getAlignment(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _alignmentList.size())) { + throw new IndexOutOfBoundsException("getAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Alignment) _alignmentList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Alignment getAlignment(int) + + /** + * Method getAlignment + * + * + * + * @return Alignment + */ + public uk.ac.vamsas.objects.core.Alignment[] getAlignment() + { + int size = _alignmentList.size(); + uk.ac.vamsas.objects.core.Alignment[] mArray = new uk.ac.vamsas.objects.core.Alignment[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Alignment) _alignmentList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Alignment[] getAlignment() + + /** + * Method getAlignmentCount + * + * + * + * @return int + */ + public int getAlignmentCount() + { + return _alignmentList.size(); + } //-- int getAlignmentCount() + + /** + * Method getDataSetAnnotations + * + * + * + * @param index + * @return DataSetAnnotations + */ + public uk.ac.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _dataSetAnnotationsList.size())) { + throw new IndexOutOfBoundsException("getDataSetAnnotations: Index value '"+index+"' not in range [0.."+_dataSetAnnotationsList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(int) + + /** + * Method getDataSetAnnotations + * + * + * + * @return DataSetAnnotations + */ + public uk.ac.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations() + { + int size = _dataSetAnnotationsList.size(); + uk.ac.vamsas.objects.core.DataSetAnnotations[] mArray = new uk.ac.vamsas.objects.core.DataSetAnnotations[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations() + + /** + * Method getDataSetAnnotationsCount + * + * + * + * @return int + */ + public int getDataSetAnnotationsCount() + { + return _dataSetAnnotationsList.size(); + } //-- int getDataSetAnnotationsCount() + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * @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 'provenance'. + * + * @return Provenance + * @return the value of field 'provenance'. + */ + public uk.ac.vamsas.objects.core.Provenance getProvenance() + { + return this._provenance; + } //-- uk.ac.vamsas.objects.core.Provenance getProvenance() + + /** + * Method getSequence + * + * + * + * @param index + * @return Sequence + */ + public uk.ac.vamsas.objects.core.Sequence getSequence(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _sequenceList.size())) { + throw new IndexOutOfBoundsException("getSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Sequence) _sequenceList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Sequence getSequence(int) + + /** + * Method getSequence + * + * + * + * @return Sequence + */ + public uk.ac.vamsas.objects.core.Sequence[] getSequence() + { + int size = _sequenceList.size(); + uk.ac.vamsas.objects.core.Sequence[] mArray = new uk.ac.vamsas.objects.core.Sequence[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Sequence) _sequenceList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Sequence[] getSequence() + + /** + * Method getSequenceCount + * + * + * + * @return int + */ + public int getSequenceCount() + { + return _sequenceList.size(); + } //-- int getSequenceCount() + + /** + * Method getTree + * + * + * + * @param index + * @return Tree + */ + public uk.ac.vamsas.objects.core.Tree getTree(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _treeList.size())) { + throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Tree) _treeList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Tree getTree(int) + + /** + * Method getTree + * + * + * + * @return Tree + */ + public uk.ac.vamsas.objects.core.Tree[] getTree() + { + int size = _treeList.size(); + uk.ac.vamsas.objects.core.Tree[] mArray = new uk.ac.vamsas.objects.core.Tree[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Tree) _treeList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Tree[] 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 uk.ac.vamsas.objects.core.Alignment removeAlignment(int index) + { + java.lang.Object obj = _alignmentList.elementAt(index); + _alignmentList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Alignment) obj; + } //-- uk.ac.vamsas.objects.core.Alignment removeAlignment(int) + + /** + * Method removeAllAlignment + * + */ + public void removeAllAlignment() + { + _alignmentList.removeAllElements(); + } //-- void removeAllAlignment() + + /** + * Method removeAllDataSetAnnotations + * + */ + public void removeAllDataSetAnnotations() + { + _dataSetAnnotationsList.removeAllElements(); + } //-- void removeAllDataSetAnnotations() + + /** + * Method removeAllSequence + * + */ + public void removeAllSequence() + { + _sequenceList.removeAllElements(); + } //-- void removeAllSequence() + + /** + * Method removeAllTree + * + */ + public void removeAllTree() + { + _treeList.removeAllElements(); + } //-- void removeAllTree() + + /** + * Method removeDataSetAnnotations + * + * + * + * @param index + * @return DataSetAnnotations + */ + public uk.ac.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int index) + { + java.lang.Object obj = _dataSetAnnotationsList.elementAt(index); + _dataSetAnnotationsList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.DataSetAnnotations) obj; + } //-- uk.ac.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotations(int) + + /** + * Method removeSequence + * + * + * + * @param index + * @return Sequence + */ + public uk.ac.vamsas.objects.core.Sequence removeSequence(int index) + { + java.lang.Object obj = _sequenceList.elementAt(index); + _sequenceList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Sequence) obj; + } //-- uk.ac.vamsas.objects.core.Sequence removeSequence(int) + + /** + * Method removeTree + * + * + * + * @param index + * @return Tree + */ + public uk.ac.vamsas.objects.core.Tree removeTree(int index) + { + java.lang.Object obj = _treeList.elementAt(index); + _treeList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Tree) obj; + } //-- uk.ac.vamsas.objects.core.Tree removeTree(int) + + /** + * Method setAlignment + * + * + * + * @param index + * @param vAlignment + */ + public void setAlignment(int index, uk.ac.vamsas.objects.core.Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _alignmentList.size())) { + throw new IndexOutOfBoundsException("setAlignment: Index value '"+index+"' not in range [0.."+_alignmentList.size()+ "]"); + } + _alignmentList.setElementAt(vAlignment, index); + } //-- void setAlignment(int, uk.ac.vamsas.objects.core.Alignment) + + /** + * Method setAlignment + * + * + * + * @param alignmentArray + */ + public void setAlignment(uk.ac.vamsas.objects.core.Alignment[] alignmentArray) + { + //-- copy array + _alignmentList.removeAllElements(); + for (int i = 0; i < alignmentArray.length; i++) { + _alignmentList.addElement(alignmentArray[i]); + } + } //-- void setAlignment(uk.ac.vamsas.objects.core.Alignment) + + /** + * Method setDataSetAnnotations + * + * + * + * @param index + * @param vDataSetAnnotations + */ + public void setDataSetAnnotations(int index, uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _dataSetAnnotationsList.size())) { + throw new IndexOutOfBoundsException("setDataSetAnnotations: Index value '"+index+"' not in range [0.."+_dataSetAnnotationsList.size()+ "]"); + } + _dataSetAnnotationsList.setElementAt(vDataSetAnnotations, index); + } //-- void setDataSetAnnotations(int, uk.ac.vamsas.objects.core.DataSetAnnotations) + + /** + * Method setDataSetAnnotations + * + * + * + * @param dataSetAnnotationsArray + */ + public void setDataSetAnnotations(uk.ac.vamsas.objects.core.DataSetAnnotations[] dataSetAnnotationsArray) + { + //-- copy array + _dataSetAnnotationsList.removeAllElements(); + for (int i = 0; i < dataSetAnnotationsArray.length; i++) { + _dataSetAnnotationsList.addElement(dataSetAnnotationsArray[i]); + } + } //-- void setDataSetAnnotations(uk.ac.vamsas.objects.core.DataSetAnnotations) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * @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 'provenance'. + * + * @param provenance the value of field 'provenance'. + */ + public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) + { + this._provenance = provenance; + } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + + /** + * Method setSequence + * + * + * + * @param index + * @param vSequence + */ + public void setSequence(int index, uk.ac.vamsas.objects.core.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _sequenceList.size())) { + throw new IndexOutOfBoundsException("setSequence: Index value '"+index+"' not in range [0.."+_sequenceList.size()+ "]"); + } + _sequenceList.setElementAt(vSequence, index); + } //-- void setSequence(int, uk.ac.vamsas.objects.core.Sequence) + + /** + * Method setSequence + * + * + * + * @param sequenceArray + */ + public void setSequence(uk.ac.vamsas.objects.core.Sequence[] sequenceArray) + { + //-- copy array + _sequenceList.removeAllElements(); + for (int i = 0; i < sequenceArray.length; i++) { + _sequenceList.addElement(sequenceArray[i]); + } + } //-- void setSequence(uk.ac.vamsas.objects.core.Sequence) + + /** + * Method setTree + * + * + * + * @param index + * @param vTree + */ + public void setTree(int index, uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _treeList.size())) { + throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + } + _treeList.setElementAt(vTree, index); + } //-- void setTree(int, uk.ac.vamsas.objects.core.Tree) + + /** + * Method setTree + * + * + * + * @param treeArray + */ + public void setTree(uk.ac.vamsas.objects.core.Tree[] treeArray) + { + //-- copy array + _treeList.removeAllElements(); + for (int i = 0; i < treeArray.length; i++) { + _treeList.addElement(treeArray[i]); + } + } //-- void setTree(uk.ac.vamsas.objects.core.Tree) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return DataSet + */ + public static uk.ac.vamsas.objects.core.DataSet unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.DataSet) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DataSet.class, reader); + } //-- uk.ac.vamsas.objects.core.DataSet 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/uk/ac/vamsas/objects/core/DataSetAnnotations.java b/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java new file mode 100644 index 0000000..f6ccd0e --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/DataSetAnnotations.java @@ -0,0 +1,217 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:DataSetAnnotations.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 DataSetAnnotations. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class DataSetAnnotations extends uk.ac.vamsas.objects.core.RangeAnnotation +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * annotation is associated with a + * particular dataset sequence + */ + private java.lang.Object _seqRef; + + /** + * Field _provenance + */ + private uk.ac.vamsas.objects.core.Provenance _provenance; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public DataSetAnnotations() + { + super(); + } //-- uk.ac.vamsas.objects.core.DataSetAnnotations() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof DataSetAnnotations) { + + DataSetAnnotations temp = (DataSetAnnotations)obj; + if (this._seqRef != null) { + if (temp._seqRef == null) return false; + else if (!(this._seqRef.equals(temp._seqRef))) + return false; + } + else if (temp._seqRef != 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; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'provenance'. + * + * @return Provenance + * @return the value of field 'provenance'. + */ + public uk.ac.vamsas.objects.core.Provenance getProvenance() + { + return this._provenance; + } //-- uk.ac.vamsas.objects.core.Provenance getProvenance() + + /** + * Returns the value of field 'seqRef'. The field 'seqRef' has + * the following description: annotation is associated with a + * particular dataset sequence + * + * @return Object + * @return the value of field 'seqRef'. + */ + public java.lang.Object getSeqRef() + { + return this._seqRef; + } //-- java.lang.Object getSeqRef() + + /** + * 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 'provenance'. + * + * @param provenance the value of field 'provenance'. + */ + public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) + { + this._provenance = provenance; + } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + + /** + * Sets the value of field 'seqRef'. The field 'seqRef' has the + * following description: annotation is associated with a + * particular dataset sequence + * + * @param seqRef the value of field 'seqRef'. + */ + public void setSeqRef(java.lang.Object seqRef) + { + this._seqRef = seqRef; + } //-- void setSeqRef(java.lang.Object) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return RangeType + */ + public static uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.DataSetAnnotations) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DataSetAnnotations.class, reader); + } //-- uk.ac.vamsas.objects.core.RangeType 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/uk/ac/vamsas/objects/core/DataSetAnnotationsDescriptor.java b/src/uk/ac/vamsas/objects/core/DataSetAnnotationsDescriptor.java new file mode 100644 index 0000000..3425525 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/DataSetAnnotationsDescriptor.java @@ -0,0 +1,249 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:DataSetAnnotationsDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 DataSetAnnotationsDescriptor. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class DataSetAnnotationsDescriptor extends uk.ac.vamsas.objects.core.RangeAnnotationDescriptor { + + + //--------------------------/ + //- 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 DataSetAnnotationsDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.RangeAnnotationDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "DataSetAnnotations"; + + //-- 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 + + //-- _seqRef + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_seqRef", "seqRef", 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 + { + DataSetAnnotations target = (DataSetAnnotations) object; + return target.getSeqRef(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSetAnnotations target = (DataSetAnnotations) object; + target.setSeqRef( (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: _seqRef + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _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 + { + DataSetAnnotations target = (DataSetAnnotations) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSetAnnotations target = (DataSetAnnotations) 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.org"); + 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); + } //-- uk.ac.vamsas.objects.core.DataSetAnnotationsDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.DataSetAnnotations.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/uk/ac/vamsas/objects/core/DataSetDescriptor.java b/src/uk/ac/vamsas/objects/core/DataSetDescriptor.java new file mode 100644 index 0000000..8e1fd5f --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/DataSetDescriptor.java @@ -0,0 +1,385 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:DataSetDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 DataSetDescriptor. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class DataSetDescriptor 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 DataSetDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "DataSet"; + + //-- 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 + + //-- _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 + { + DataSet target = (DataSet) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) 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 + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _sequenceList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.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 + { + DataSet target = (DataSet) object; + return target.getSequence(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) object; + target.addSequence( (uk.ac.vamsas.objects.core.Sequence) 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.Sequence(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + 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); + //-- _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() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DataSet target = (DataSet) object; + return target.getDataSetAnnotations(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) object; + target.addDataSetAnnotations( (uk.ac.vamsas.objects.core.DataSetAnnotations) 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.DataSetAnnotations(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _dataSetAnnotationsList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _alignmentList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.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 + { + DataSet target = (DataSet) object; + return target.getAlignment(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) object; + target.addAlignment( (uk.ac.vamsas.objects.core.Alignment) 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.Alignment(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + 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(uk.ac.vamsas.objects.core.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 + { + DataSet target = (DataSet) object; + return target.getTree(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) object; + target.addTree( (uk.ac.vamsas.objects.core.Tree) 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.Tree(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.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); + //-- _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 + { + DataSet target = (DataSet) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DataSet target = (DataSet) 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.org"); + 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); + } //-- uk.ac.vamsas.objects.core.DataSetDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.DataSet.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/uk/ac/vamsas/objects/core/DbRef.java b/src/uk/ac/vamsas/objects/core/DbRef.java new file mode 100644 index 0000000..2d064f0 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/DbRef.java @@ -0,0 +1,806 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:DbRef.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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; + +/** + * Store a list of database references + * for this sequence record - with optional mapping + * from database sequence to the given sequence record + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class DbRef extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * TODO Database Naming + * Convention: either start using LSID (so + * change type to URI) or leave this as an + * uncontrolled/unspecified string ID + * + */ + private java.lang.String _source; + + /** + * Version must be specified - + * + */ + private java.lang.String _version; + + /** + * TODO: make some specification + * of the database field from which this + * accessionId is taken from - should that be a + * special property of the dbRef object ? + * + */ + private java.lang.String _accessionId; + + /** + * Primary Key for vamsas object + * referencing + */ + private java.lang.String _id; + + /** + * From: Offset to first + * position in dataset sequence record that + * this database entry maps to To: Offset + * to last position in dataset sequence + * record that this database entry maps to + * Start: Offset to first last position in + * database entry that first (or offset) + * position in sequence maps to End: Offset + * to last position in database entry that + * last (offset) position in sequence maps + * to + */ + private java.util.Vector _mapList; + + /** + * Field _linkList + */ + private java.util.Vector _linkList; + + /** + * Field _propertyList + */ + private java.util.Vector _propertyList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public DbRef() + { + super(); + _mapList = new Vector(); + _linkList = new Vector(); + _propertyList = new Vector(); + } //-- uk.ac.vamsas.objects.core.DbRef() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addLink + * + * + * + * @param vLink + */ + public void addLink(uk.ac.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException + { + _linkList.addElement(vLink); + } //-- void addLink(uk.ac.vamsas.objects.core.Link) + + /** + * Method addLink + * + * + * + * @param index + * @param vLink + */ + public void addLink(int index, uk.ac.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException + { + _linkList.insertElementAt(vLink, index); + } //-- void addLink(int, uk.ac.vamsas.objects.core.Link) + + /** + * Method addMap + * + * + * + * @param vMap + */ + public void addMap(uk.ac.vamsas.objects.core.Map vMap) + throws java.lang.IndexOutOfBoundsException + { + _mapList.addElement(vMap); + } //-- void addMap(uk.ac.vamsas.objects.core.Map) + + /** + * Method addMap + * + * + * + * @param index + * @param vMap + */ + public void addMap(int index, uk.ac.vamsas.objects.core.Map vMap) + throws java.lang.IndexOutOfBoundsException + { + _mapList.insertElementAt(vMap, index); + } //-- void addMap(int, uk.ac.vamsas.objects.core.Map) + + /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(uk.ac.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, uk.ac.vamsas.objects.core.Property) + + /** + * Method enumerateLink + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateLink() + { + return _linkList.elements(); + } //-- java.util.Enumeration enumerateLink() + + /** + * Method enumerateMap + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateMap() + { + return _mapList.elements(); + } //-- java.util.Enumeration enumerateMap() + + /** + * Method enumerateProperty + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateProperty() + { + return _propertyList.elements(); + } //-- java.util.Enumeration enumerateProperty() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof DbRef) { + + DbRef temp = (DbRef)obj; + if (this._source != null) { + if (temp._source == null) return false; + else if (!(this._source.equals(temp._source))) + return false; + } + else if (temp._source != null) + return false; + if (this._version != null) { + if (temp._version == null) return false; + else if (!(this._version.equals(temp._version))) + return false; + } + else if (temp._version != null) + return false; + if (this._accessionId != null) { + if (temp._accessionId == null) return false; + else if (!(this._accessionId.equals(temp._accessionId))) + return false; + } + else if (temp._accessionId != 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._mapList != null) { + if (temp._mapList == null) return false; + else if (!(this._mapList.equals(temp._mapList))) + return false; + } + else if (temp._mapList != null) + return false; + if (this._linkList != null) { + if (temp._linkList == null) return false; + else if (!(this._linkList.equals(temp._linkList))) + return false; + } + else if (temp._linkList != null) + return false; + if (this._propertyList != null) { + if (temp._propertyList == null) return false; + else if (!(this._propertyList.equals(temp._propertyList))) + return false; + } + else if (temp._propertyList != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'accessionId'. The field + * 'accessionId' has the following description: TODO: make some + * specification + * of the database field from which this + * accessionId is taken from - should that be a + * special property of the dbRef object ? + * + * + * @return String + * @return the value of field 'accessionId'. + */ + public java.lang.String getAccessionId() + { + return this._accessionId; + } //-- java.lang.String getAccessionId() + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * @return String + * @return the value of field 'id'. + */ + public java.lang.String getId() + { + return this._id; + } //-- java.lang.String getId() + + /** + * Method getLink + * + * + * + * @param index + * @return Link + */ + public uk.ac.vamsas.objects.core.Link getLink(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _linkList.size())) { + throw new IndexOutOfBoundsException("getLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Link) _linkList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Link getLink(int) + + /** + * Method getLink + * + * + * + * @return Link + */ + public uk.ac.vamsas.objects.core.Link[] getLink() + { + int size = _linkList.size(); + uk.ac.vamsas.objects.core.Link[] mArray = new uk.ac.vamsas.objects.core.Link[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Link) _linkList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Link[] getLink() + + /** + * Method getLinkCount + * + * + * + * @return int + */ + public int getLinkCount() + { + return _linkList.size(); + } //-- int getLinkCount() + + /** + * Method getMap + * + * + * + * @param index + * @return Map + */ + public uk.ac.vamsas.objects.core.Map getMap(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _mapList.size())) { + throw new IndexOutOfBoundsException("getMap: Index value '"+index+"' not in range [0.."+_mapList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Map) _mapList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Map getMap(int) + + /** + * Method getMap + * + * + * + * @return Map + */ + public uk.ac.vamsas.objects.core.Map[] getMap() + { + int size = _mapList.size(); + uk.ac.vamsas.objects.core.Map[] mArray = new uk.ac.vamsas.objects.core.Map[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Map) _mapList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Map[] getMap() + + /** + * Method getMapCount + * + * + * + * @return int + */ + public int getMapCount() + { + return _mapList.size(); + } //-- int getMapCount() + + /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public uk.ac.vamsas.objects.core.Property getProperty(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public uk.ac.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + uk.ac.vamsas.objects.core.Property[] mArray = new uk.ac.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Property[] getProperty() + + /** + * Method getPropertyCount + * + * + * + * @return int + */ + public int getPropertyCount() + { + return _propertyList.size(); + } //-- int getPropertyCount() + + /** + * Returns the value of field 'source'. The field 'source' has + * the following description: TODO Database Naming + * Convention: either start using LSID (so + * change type to URI) or leave this as an + * uncontrolled/unspecified string ID + * + * + * @return String + * @return the value of field 'source'. + */ + public java.lang.String getSource() + { + return this._source; + } //-- java.lang.String getSource() + + /** + * Returns the value of field 'version'. The field 'version' + * has the following description: Version must be specified - + * + * + * @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) + + /** + * Method removeAllLink + * + */ + public void removeAllLink() + { + _linkList.removeAllElements(); + } //-- void removeAllLink() + + /** + * Method removeAllMap + * + */ + public void removeAllMap() + { + _mapList.removeAllElements(); + } //-- void removeAllMap() + + /** + * Method removeAllProperty + * + */ + public void removeAllProperty() + { + _propertyList.removeAllElements(); + } //-- void removeAllProperty() + + /** + * Method removeLink + * + * + * + * @param index + * @return Link + */ + public uk.ac.vamsas.objects.core.Link removeLink(int index) + { + java.lang.Object obj = _linkList.elementAt(index); + _linkList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Link) obj; + } //-- uk.ac.vamsas.objects.core.Link removeLink(int) + + /** + * Method removeMap + * + * + * + * @param index + * @return Map + */ + public uk.ac.vamsas.objects.core.Map removeMap(int index) + { + java.lang.Object obj = _mapList.elementAt(index); + _mapList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Map) obj; + } //-- uk.ac.vamsas.objects.core.Map removeMap(int) + + /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public uk.ac.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Property) obj; + } //-- uk.ac.vamsas.objects.core.Property removeProperty(int) + + /** + * Sets the value of field 'accessionId'. The field + * 'accessionId' has the following description: TODO: make some + * specification + * of the database field from which this + * accessionId is taken from - should that be a + * special property of the dbRef object ? + * + * + * @param accessionId the value of field 'accessionId'. + */ + public void setAccessionId(java.lang.String accessionId) + { + this._accessionId = accessionId; + } //-- void setAccessionId(java.lang.String) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * @param id the value of field 'id'. + */ + public void setId(java.lang.String id) + { + this._id = id; + } //-- void setId(java.lang.String) + + /** + * Method setLink + * + * + * + * @param index + * @param vLink + */ + public void setLink(int index, uk.ac.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _linkList.size())) { + throw new IndexOutOfBoundsException("setLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]"); + } + _linkList.setElementAt(vLink, index); + } //-- void setLink(int, uk.ac.vamsas.objects.core.Link) + + /** + * Method setLink + * + * + * + * @param linkArray + */ + public void setLink(uk.ac.vamsas.objects.core.Link[] linkArray) + { + //-- copy array + _linkList.removeAllElements(); + for (int i = 0; i < linkArray.length; i++) { + _linkList.addElement(linkArray[i]); + } + } //-- void setLink(uk.ac.vamsas.objects.core.Link) + + /** + * Method setMap + * + * + * + * @param index + * @param vMap + */ + public void setMap(int index, uk.ac.vamsas.objects.core.Map vMap) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _mapList.size())) { + throw new IndexOutOfBoundsException("setMap: Index value '"+index+"' not in range [0.."+_mapList.size()+ "]"); + } + _mapList.setElementAt(vMap, index); + } //-- void setMap(int, uk.ac.vamsas.objects.core.Map) + + /** + * Method setMap + * + * + * + * @param mapArray + */ + public void setMap(uk.ac.vamsas.objects.core.Map[] mapArray) + { + //-- copy array + _mapList.removeAllElements(); + for (int i = 0; i < mapArray.length; i++) { + _mapList.addElement(mapArray[i]); + } + } //-- void setMap(uk.ac.vamsas.objects.core.Map) + + /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + _propertyList.setElementAt(vProperty, index); + } //-- void setProperty(int, uk.ac.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(uk.ac.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(uk.ac.vamsas.objects.core.Property) + + /** + * Sets the value of field 'source'. The field 'source' has the + * following description: TODO Database Naming + * Convention: either start using LSID (so + * change type to URI) or leave this as an + * uncontrolled/unspecified string ID + * + * + * @param source the value of field 'source'. + */ + public void setSource(java.lang.String source) + { + this._source = source; + } //-- void setSource(java.lang.String) + + /** + * Sets the value of field 'version'. The field 'version' has + * the following description: Version must be specified - + * + * + * @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 DbRef + */ + public static uk.ac.vamsas.objects.core.DbRef unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.DbRef) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DbRef.class, reader); + } //-- uk.ac.vamsas.objects.core.DbRef 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/uk/ac/vamsas/objects/core/DbRefDescriptor.java b/src/uk/ac/vamsas/objects/core/DbRefDescriptor.java new file mode 100644 index 0000000..266acb8 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/DbRefDescriptor.java @@ -0,0 +1,430 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:DbRefDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 DbRefDescriptor. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class DbRefDescriptor 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 DbRefDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "dbRef"; + + //-- 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 + + //-- _source + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_source", "source", 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 + { + DbRef target = (DbRef) object; + return target.getSource(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) object; + target.setSource( (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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _source + 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); + //-- _version + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "version", 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 + { + DbRef target = (DbRef) object; + return target.getVersion(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) 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.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); + //-- _accessionId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_accessionId", "accessionId", 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 + { + DbRef target = (DbRef) object; + return target.getAccessionId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) object; + target.setAccessionId( (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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _accessionId + 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); + //-- _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 + { + DbRef target = (DbRef) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) 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 + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _mapList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Map.class, "_mapList", "map", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DbRef target = (DbRef) object; + return target.getMap(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) object; + target.addMap( (uk.ac.vamsas.objects.core.Map) 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.Map(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _mapList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _linkList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Link.class, "_linkList", "link", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + DbRef target = (DbRef) object; + return target.getLink(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) object; + target.addLink( (uk.ac.vamsas.objects.core.Link) 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.Link(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _linkList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.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 + { + DbRef target = (DbRef) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + DbRef target = (DbRef) object; + target.addProperty( (uk.ac.vamsas.objects.core.Property) 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.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.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); + } //-- uk.ac.vamsas.objects.core.DbRefDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.DbRef.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/uk/ac/vamsas/objects/core/Entry.java b/src/uk/ac/vamsas/objects/core/Entry.java new file mode 100644 index 0000000..350443c --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Entry.java @@ -0,0 +1,803 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:Entry.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Entry. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class Entry extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Primary Key for vamsas object referencing + * + */ + private java.lang.String _id; + + /** + * Who + */ + private java.lang.String _user; + + /** + * With which application + */ + private java.lang.String _app; + + /** + * Did what + */ + private java.lang.String _action; + + /** + * When + */ + private org.exolab.castor.types.Date _date; + + /** + * additional information + */ + private java.util.Vector _propertyList; + + /** + * parameter for the action + */ + private java.util.Vector _paramList; + + /** + * bioinformatic objects input to action + * + */ + private java.util.Vector _inputList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Entry() + { + super(); + _propertyList = new Vector(); + _paramList = new Vector(); + _inputList = new Vector(); + } //-- uk.ac.vamsas.objects.core.Entry() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addInput + * + * + * + * @param vInput + */ + public void addInput(uk.ac.vamsas.objects.core.Input vInput) + throws java.lang.IndexOutOfBoundsException + { + _inputList.addElement(vInput); + } //-- void addInput(uk.ac.vamsas.objects.core.Input) + + /** + * Method addInput + * + * + * + * @param index + * @param vInput + */ + public void addInput(int index, uk.ac.vamsas.objects.core.Input vInput) + throws java.lang.IndexOutOfBoundsException + { + _inputList.insertElementAt(vInput, index); + } //-- void addInput(int, uk.ac.vamsas.objects.core.Input) + + /** + * Method addParam + * + * + * + * @param vParam + */ + public void addParam(uk.ac.vamsas.objects.core.Param vParam) + throws java.lang.IndexOutOfBoundsException + { + _paramList.addElement(vParam); + } //-- void addParam(uk.ac.vamsas.objects.core.Param) + + /** + * Method addParam + * + * + * + * @param index + * @param vParam + */ + public void addParam(int index, uk.ac.vamsas.objects.core.Param vParam) + throws java.lang.IndexOutOfBoundsException + { + _paramList.insertElementAt(vParam, index); + } //-- void addParam(int, uk.ac.vamsas.objects.core.Param) + + /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(uk.ac.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, uk.ac.vamsas.objects.core.Property) + + /** + * Method enumerateInput + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateInput() + { + return _inputList.elements(); + } //-- java.util.Enumeration enumerateInput() + + /** + * Method enumerateParam + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateParam() + { + return _paramList.elements(); + } //-- java.util.Enumeration enumerateParam() + + /** + * Method enumerateProperty + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateProperty() + { + return _propertyList.elements(); + } //-- java.util.Enumeration enumerateProperty() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Entry) { + + Entry temp = (Entry)obj; + 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._user != null) { + if (temp._user == null) return false; + else if (!(this._user.equals(temp._user))) + return false; + } + else if (temp._user != null) + return false; + if (this._app != null) { + if (temp._app == null) return false; + else if (!(this._app.equals(temp._app))) + return false; + } + else if (temp._app != null) + return false; + if (this._action != null) { + if (temp._action == null) return false; + else if (!(this._action.equals(temp._action))) + return false; + } + else if (temp._action != null) + return false; + if (this._date != null) { + if (temp._date == null) return false; + else if (!(this._date.equals(temp._date))) + return false; + } + else if (temp._date != null) + return false; + if (this._propertyList != null) { + if (temp._propertyList == null) return false; + else if (!(this._propertyList.equals(temp._propertyList))) + return false; + } + else if (temp._propertyList != null) + return false; + if (this._paramList != null) { + if (temp._paramList == null) return false; + else if (!(this._paramList.equals(temp._paramList))) + return false; + } + else if (temp._paramList != null) + return false; + if (this._inputList != null) { + if (temp._inputList == null) return false; + else if (!(this._inputList.equals(temp._inputList))) + return false; + } + else if (temp._inputList != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'action'. The field 'action' has + * the following description: Did what + * + * @return String + * @return the value of field 'action'. + */ + public java.lang.String getAction() + { + return this._action; + } //-- java.lang.String getAction() + + /** + * Returns the value of field 'app'. The field 'app' has the + * following description: With which application + * + * @return String + * @return the value of field 'app'. + */ + public java.lang.String getApp() + { + return this._app; + } //-- java.lang.String getApp() + + /** + * Returns the value of field 'date'. The field 'date' has the + * following description: When + * + * @return Date + * @return the value of field 'date'. + */ + public org.exolab.castor.types.Date getDate() + { + return this._date; + } //-- org.exolab.castor.types.Date getDate() + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @return String + * @return the value of field 'id'. + */ + public java.lang.String getId() + { + return this._id; + } //-- java.lang.String getId() + + /** + * Method getInput + * + * + * + * @param index + * @return Input + */ + public uk.ac.vamsas.objects.core.Input getInput(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _inputList.size())) { + throw new IndexOutOfBoundsException("getInput: Index value '"+index+"' not in range [0.."+_inputList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Input) _inputList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Input getInput(int) + + /** + * Method getInput + * + * + * + * @return Input + */ + public uk.ac.vamsas.objects.core.Input[] getInput() + { + int size = _inputList.size(); + uk.ac.vamsas.objects.core.Input[] mArray = new uk.ac.vamsas.objects.core.Input[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Input) _inputList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Input[] getInput() + + /** + * Method getInputCount + * + * + * + * @return int + */ + public int getInputCount() + { + return _inputList.size(); + } //-- int getInputCount() + + /** + * Method getParam + * + * + * + * @param index + * @return Param + */ + public uk.ac.vamsas.objects.core.Param getParam(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _paramList.size())) { + throw new IndexOutOfBoundsException("getParam: Index value '"+index+"' not in range [0.."+_paramList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Param) _paramList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Param getParam(int) + + /** + * Method getParam + * + * + * + * @return Param + */ + public uk.ac.vamsas.objects.core.Param[] getParam() + { + int size = _paramList.size(); + uk.ac.vamsas.objects.core.Param[] mArray = new uk.ac.vamsas.objects.core.Param[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Param) _paramList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Param[] getParam() + + /** + * Method getParamCount + * + * + * + * @return int + */ + public int getParamCount() + { + return _paramList.size(); + } //-- int getParamCount() + + /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public uk.ac.vamsas.objects.core.Property getProperty(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public uk.ac.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + uk.ac.vamsas.objects.core.Property[] mArray = new uk.ac.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Property[] getProperty() + + /** + * Method getPropertyCount + * + * + * + * @return int + */ + public int getPropertyCount() + { + return _propertyList.size(); + } //-- int getPropertyCount() + + /** + * Returns the value of field 'user'. The field 'user' has the + * following description: Who + * + * @return String + * @return the value of field 'user'. + */ + public java.lang.String getUser() + { + return this._user; + } //-- java.lang.String getUser() + + /** + * 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 removeAllInput + * + */ + public void removeAllInput() + { + _inputList.removeAllElements(); + } //-- void removeAllInput() + + /** + * Method removeAllParam + * + */ + public void removeAllParam() + { + _paramList.removeAllElements(); + } //-- void removeAllParam() + + /** + * Method removeAllProperty + * + */ + public void removeAllProperty() + { + _propertyList.removeAllElements(); + } //-- void removeAllProperty() + + /** + * Method removeInput + * + * + * + * @param index + * @return Input + */ + public uk.ac.vamsas.objects.core.Input removeInput(int index) + { + java.lang.Object obj = _inputList.elementAt(index); + _inputList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Input) obj; + } //-- uk.ac.vamsas.objects.core.Input removeInput(int) + + /** + * Method removeParam + * + * + * + * @param index + * @return Param + */ + public uk.ac.vamsas.objects.core.Param removeParam(int index) + { + java.lang.Object obj = _paramList.elementAt(index); + _paramList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Param) obj; + } //-- uk.ac.vamsas.objects.core.Param removeParam(int) + + /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public uk.ac.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Property) obj; + } //-- uk.ac.vamsas.objects.core.Property removeProperty(int) + + /** + * Sets the value of field 'action'. The field 'action' has the + * following description: Did what + * + * @param action the value of field 'action'. + */ + public void setAction(java.lang.String action) + { + this._action = action; + } //-- void setAction(java.lang.String) + + /** + * Sets the value of field 'app'. The field 'app' has the + * following description: With which application + * + * @param app the value of field 'app'. + */ + public void setApp(java.lang.String app) + { + this._app = app; + } //-- void setApp(java.lang.String) + + /** + * Sets the value of field 'date'. The field 'date' has the + * following description: When + * + * @param date the value of field 'date'. + */ + public void setDate(org.exolab.castor.types.Date date) + { + this._date = date; + } //-- void setDate(org.exolab.castor.types.Date) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @param id the value of field 'id'. + */ + public void setId(java.lang.String id) + { + this._id = id; + } //-- void setId(java.lang.String) + + /** + * Method setInput + * + * + * + * @param index + * @param vInput + */ + public void setInput(int index, uk.ac.vamsas.objects.core.Input vInput) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _inputList.size())) { + throw new IndexOutOfBoundsException("setInput: Index value '"+index+"' not in range [0.."+_inputList.size()+ "]"); + } + _inputList.setElementAt(vInput, index); + } //-- void setInput(int, uk.ac.vamsas.objects.core.Input) + + /** + * Method setInput + * + * + * + * @param inputArray + */ + public void setInput(uk.ac.vamsas.objects.core.Input[] inputArray) + { + //-- copy array + _inputList.removeAllElements(); + for (int i = 0; i < inputArray.length; i++) { + _inputList.addElement(inputArray[i]); + } + } //-- void setInput(uk.ac.vamsas.objects.core.Input) + + /** + * Method setParam + * + * + * + * @param index + * @param vParam + */ + public void setParam(int index, uk.ac.vamsas.objects.core.Param vParam) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _paramList.size())) { + throw new IndexOutOfBoundsException("setParam: Index value '"+index+"' not in range [0.."+_paramList.size()+ "]"); + } + _paramList.setElementAt(vParam, index); + } //-- void setParam(int, uk.ac.vamsas.objects.core.Param) + + /** + * Method setParam + * + * + * + * @param paramArray + */ + public void setParam(uk.ac.vamsas.objects.core.Param[] paramArray) + { + //-- copy array + _paramList.removeAllElements(); + for (int i = 0; i < paramArray.length; i++) { + _paramList.addElement(paramArray[i]); + } + } //-- void setParam(uk.ac.vamsas.objects.core.Param) + + /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + _propertyList.setElementAt(vProperty, index); + } //-- void setProperty(int, uk.ac.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(uk.ac.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(uk.ac.vamsas.objects.core.Property) + + /** + * Sets the value of field 'user'. The field 'user' has the + * following description: Who + * + * @param user the value of field 'user'. + */ + public void setUser(java.lang.String user) + { + this._user = user; + } //-- void setUser(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Entry + */ + public static uk.ac.vamsas.objects.core.Entry unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Entry) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Entry.class, reader); + } //-- uk.ac.vamsas.objects.core.Entry 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/uk/ac/vamsas/objects/core/EntryDescriptor.java b/src/uk/ac/vamsas/objects/core/EntryDescriptor.java new file mode 100644 index 0000000..30c539b --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/EntryDescriptor.java @@ -0,0 +1,471 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:EntryDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 EntryDescriptor. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class EntryDescriptor 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 EntryDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "entry"; + + //-- 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 + + //-- _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 + { + Entry target = (Entry) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) 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 + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + //-- _user + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_user", "User", 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 + { + Entry target = (Entry) object; + return target.getUser(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.setUser( (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("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _user + 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); + //-- _app + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_app", "App", 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 + { + Entry target = (Entry) object; + return target.getApp(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.setApp( (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("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _app + 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); + //-- _action + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_action", "Action", 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 + { + Entry target = (Entry) object; + return target.getAction(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.setAction( (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("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _action + 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); + //-- _date + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.types.Date.class, "_date", "Date", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Entry target = (Entry) object; + return target.getDate(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.setDate( (org.exolab.castor.types.Date) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new org.exolab.castor.types.Date(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _date + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + DateTimeValidator typeValidator = new DateTimeValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.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 + { + Entry target = (Entry) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.addProperty( (uk.ac.vamsas.objects.core.Property) 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.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.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); + //-- _paramList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Param.class, "_paramList", "param", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Entry target = (Entry) object; + return target.getParam(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.addParam( (uk.ac.vamsas.objects.core.Param) 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.Param(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _paramList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _inputList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Input.class, "_inputList", "input", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Entry target = (Entry) object; + return target.getInput(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Entry target = (Entry) object; + target.addInput( (uk.ac.vamsas.objects.core.Input) 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.Input(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _inputList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- uk.ac.vamsas.objects.core.EntryDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Entry.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/uk/ac/vamsas/objects/core/Glyph.java b/src/uk/ac/vamsas/objects/core/Glyph.java new file mode 100644 index 0000000..8fd8feb --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Glyph.java @@ -0,0 +1,233 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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; + +/** + * Discrete symbol - possibly graphically represented + * + * + * @version $Revision$ $Date$ + */ +public class Glyph extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * internal content storage + */ + private java.lang.String _content = ""; + + /** + * specifies the symbol dictionary for this + * glyph - eg utf8 (the default), aasecstr_3 or + * kd_hydrophobicity - the content is not validated so + * applications must ensure they gracefully deal with + * invalid entries here + */ + private java.lang.String _dict = "utf8"; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Glyph() + { + super(); + setContent(""); + setDict("utf8"); + } //-- uk.ac.vamsas.objects.core.Glyph() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Glyph) { + + Glyph temp = (Glyph)obj; + if (this._content != null) { + if (temp._content == null) return false; + else if (!(this._content.equals(temp._content))) + return false; + } + else if (temp._content != null) + return false; + if (this._dict != null) { + if (temp._dict == null) return false; + else if (!(this._dict.equals(temp._dict))) + return false; + } + else if (temp._dict != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'content'. The field 'content' + * has the following description: internal content storage + * + * @return String + * @return the value of field 'content'. + */ + public java.lang.String getContent() + { + return this._content; + } //-- java.lang.String getContent() + + /** + * Returns the value of field 'dict'. The field 'dict' has the + * following description: specifies the symbol dictionary for + * this + * glyph - eg utf8 (the default), aasecstr_3 or + * kd_hydrophobicity - the content is not validated so + * applications must ensure they gracefully deal with + * invalid entries here + * + * @return String + * @return the value of field 'dict'. + */ + public java.lang.String getDict() + { + return this._dict; + } //-- java.lang.String getDict() + + /** + * 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 'content'. The field 'content' has + * the following description: internal content storage + * + * @param content the value of field 'content'. + */ + public void setContent(java.lang.String content) + { + this._content = content; + } //-- void setContent(java.lang.String) + + /** + * Sets the value of field 'dict'. The field 'dict' has the + * following description: specifies the symbol dictionary for + * this + * glyph - eg utf8 (the default), aasecstr_3 or + * kd_hydrophobicity - the content is not validated so + * applications must ensure they gracefully deal with + * invalid entries here + * + * @param dict the value of field 'dict'. + */ + public void setDict(java.lang.String dict) + { + this._dict = dict; + } //-- void setDict(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Glyph + */ + public static uk.ac.vamsas.objects.core.Glyph unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Glyph) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Glyph.class, reader); + } //-- uk.ac.vamsas.objects.core.Glyph 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/uk/ac/vamsas/objects/core/GlyphDescriptor.java b/src/uk/ac/vamsas/objects/core/GlyphDescriptor.java new file mode 100644 index 0000000..c28acfc --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/GlyphDescriptor.java @@ -0,0 +1,244 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 GlyphDescriptor. + * + * @version $Revision$ $Date$ + */ +public class GlyphDescriptor 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 GlyphDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "glyph"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Glyph target = (Glyph) object; + return target.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Glyph target = (Glyph) object; + target.setContent( (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: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize attribute descriptors + + //-- _dict + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dict", "dict", 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 + { + Glyph target = (Glyph) object; + return target.getDict(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Glyph target = (Glyph) object; + target.setDict( (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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _dict + 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 + + } //-- uk.ac.vamsas.objects.core.GlyphDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Glyph.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/uk/ac/vamsas/objects/core/Input.java b/src/uk/ac/vamsas/objects/core/Input.java new file mode 100644 index 0000000..db1af9e --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Input.java @@ -0,0 +1,219 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Input. + * + * @version $Revision$ $Date$ + */ +public class Input extends uk.ac.vamsas.objects.core.RangeType +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _name + */ + private java.lang.String _name; + + /** + * Reference Frame for rangeType specfication + * + */ + private java.lang.Object _objRef; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Input() + { + super(); + } //-- uk.ac.vamsas.objects.core.Input() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Input) { + + Input temp = (Input)obj; + if (this._name != null) { + if (temp._name == null) return false; + else if (!(this._name.equals(temp._name))) + return false; + } + else if (temp._name != null) + return false; + if (this._objRef != null) { + if (temp._objRef == null) return false; + else if (!(this._objRef.equals(temp._objRef))) + return false; + } + else if (temp._objRef != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * 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 'objRef'. The field 'objRef' has + * the following description: Reference Frame for rangeType + * specfication + * + * + * @return Object + * @return the value of field 'objRef'. + */ + public java.lang.Object getObjRef() + { + return this._objRef; + } //-- java.lang.Object getObjRef() + + /** + * 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 'objRef'. The field 'objRef' has the + * following description: Reference Frame for rangeType + * specfication + * + * + * @param objRef the value of field 'objRef'. + */ + public void setObjRef(java.lang.Object objRef) + { + this._objRef = objRef; + } //-- void setObjRef(java.lang.Object) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return RangeType + */ + public static uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Input) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Input.class, reader); + } //-- uk.ac.vamsas.objects.core.RangeType 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/uk/ac/vamsas/objects/core/InputDescriptor.java b/src/uk/ac/vamsas/objects/core/InputDescriptor.java new file mode 100644 index 0000000..413b38e --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/InputDescriptor.java @@ -0,0 +1,247 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 InputDescriptor. + * + * @version $Revision$ $Date$ + */ +public class InputDescriptor extends uk.ac.vamsas.objects.core.RangeTypeDescriptor { + + + //--------------------------/ + //- 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 InputDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.RangeTypeDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "input"; + 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 + + //-- _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 + { + Input target = (Input) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Input target = (Input) 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); + 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); + //-- _objRef + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_objRef", "objRef", 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 + { + Input target = (Input) object; + return target.getObjRef(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Input target = (Input) object; + target.setObjRef( (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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _objRef + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } //-- uk.ac.vamsas.objects.core.InputDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Input.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/uk/ac/vamsas/objects/core/Instance.java b/src/uk/ac/vamsas/objects/core/Instance.java new file mode 100644 index 0000000..6b7bfe5 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Instance.java @@ -0,0 +1,179 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Instance. + * + * @version $Revision$ $Date$ + */ +public class Instance extends uk.ac.vamsas.objects.core.AppData +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _urn + */ + private java.lang.String _urn; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Instance() + { + super(); + } //-- uk.ac.vamsas.objects.core.Instance() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Instance) { + + Instance temp = (Instance)obj; + if (this._urn != null) { + if (temp._urn == null) return false; + else if (!(this._urn.equals(temp._urn))) + return false; + } + else if (temp._urn != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'urn'. + * + * @return String + * @return the value of field 'urn'. + */ + public java.lang.String getUrn() + { + return this._urn; + } //-- java.lang.String getUrn() + + /** + * 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 'urn'. + * + * @param urn the value of field 'urn'. + */ + public void setUrn(java.lang.String urn) + { + this._urn = urn; + } //-- void setUrn(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return AppData + */ + public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Instance) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Instance.class, reader); + } //-- uk.ac.vamsas.objects.core.AppData 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/uk/ac/vamsas/objects/core/InstanceDescriptor.java b/src/uk/ac/vamsas/objects/core/InstanceDescriptor.java new file mode 100644 index 0000000..d4a0db2 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/InstanceDescriptor.java @@ -0,0 +1,213 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 InstanceDescriptor. + * + * @version $Revision$ $Date$ + */ +public class InstanceDescriptor extends uk.ac.vamsas.objects.core.AppDataDescriptor { + + + //--------------------------/ + //- 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 InstanceDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.AppDataDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "Instance"; + 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 + + //-- _urn + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_urn", "urn", 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 + { + Instance target = (Instance) object; + return target.getUrn(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Instance target = (Instance) object; + target.setUrn( (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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _urn + 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 + + } //-- uk.ac.vamsas.objects.core.InstanceDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Instance.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/uk/ac/vamsas/objects/core/Link.java b/src/uk/ac/vamsas/objects/core/Link.java new file mode 100644 index 0000000..ac155e8 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Link.java @@ -0,0 +1,217 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Link. + * + * @version $Revision$ $Date$ + */ +public class Link extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * internal content storage + */ + private java.lang.String _content = ""; + + /** + * The URI + */ + private java.lang.String _href; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Link() + { + super(); + setContent(""); + } //-- uk.ac.vamsas.objects.core.Link() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Link) { + + Link temp = (Link)obj; + if (this._content != null) { + if (temp._content == null) return false; + else if (!(this._content.equals(temp._content))) + return false; + } + else if (temp._content != null) + return false; + if (this._href != null) { + if (temp._href == null) return false; + else if (!(this._href.equals(temp._href))) + return false; + } + else if (temp._href != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'content'. The field 'content' + * has the following description: internal content storage + * + * @return String + * @return the value of field 'content'. + */ + public java.lang.String getContent() + { + return this._content; + } //-- java.lang.String getContent() + + /** + * Returns the value of field 'href'. The field 'href' has the + * following description: The URI + * + * @return String + * @return the value of field 'href'. + */ + public java.lang.String getHref() + { + return this._href; + } //-- java.lang.String getHref() + + /** + * 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 'content'. The field 'content' has + * the following description: internal content storage + * + * @param content the value of field 'content'. + */ + public void setContent(java.lang.String content) + { + this._content = content; + } //-- void setContent(java.lang.String) + + /** + * Sets the value of field 'href'. The field 'href' has the + * following description: The URI + * + * @param href the value of field 'href'. + */ + public void setHref(java.lang.String href) + { + this._href = href; + } //-- void setHref(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Link + */ + public static uk.ac.vamsas.objects.core.Link unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Link) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Link.class, reader); + } //-- uk.ac.vamsas.objects.core.Link 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/uk/ac/vamsas/objects/core/LinkDescriptor.java b/src/uk/ac/vamsas/objects/core/LinkDescriptor.java new file mode 100644 index 0000000..6f8e6c7 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/LinkDescriptor.java @@ -0,0 +1,240 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 LinkDescriptor. + * + * @version $Revision$ $Date$ + */ +public class LinkDescriptor 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 LinkDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "link"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Link target = (Link) object; + return target.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Link target = (Link) object; + target.setContent( (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: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize attribute descriptors + + //-- _href + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_href", "href", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Link target = (Link) object; + return target.getHref(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Link target = (Link) object; + target.setHref( (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: _href + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } //-- uk.ac.vamsas.objects.core.LinkDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Link.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/uk/ac/vamsas/objects/core/LockFile.java b/src/uk/ac/vamsas/objects/core/LockFile.java new file mode 100644 index 0000000..b187a92 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/LockFile.java @@ -0,0 +1,182 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:LockFile.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 LockFile. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class LockFile extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * internal content storage + */ + private java.lang.String _content = ""; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public LockFile() + { + super(); + setContent(""); + } //-- uk.ac.vamsas.objects.core.LockFile() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof LockFile) { + + LockFile temp = (LockFile)obj; + if (this._content != null) { + if (temp._content == null) return false; + else if (!(this._content.equals(temp._content))) + return false; + } + else if (temp._content != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'content'. The field 'content' + * has the following description: internal content storage + * + * @return String + * @return the value of field 'content'. + */ + public java.lang.String getContent() + { + return this._content; + } //-- java.lang.String getContent() + + /** + * 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 'content'. The field 'content' has + * the following description: internal content storage + * + * @param content the value of field 'content'. + */ + public void setContent(java.lang.String content) + { + this._content = content; + } //-- void setContent(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return LockFile + */ + public static uk.ac.vamsas.objects.core.LockFile unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.LockFile) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.LockFile.class, reader); + } //-- uk.ac.vamsas.objects.core.LockFile 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/uk/ac/vamsas/objects/core/LockFileDescriptor.java b/src/uk/ac/vamsas/objects/core/LockFileDescriptor.java new file mode 100644 index 0000000..a8cb965 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/LockFileDescriptor.java @@ -0,0 +1,207 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:LockFileDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 LockFileDescriptor. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class LockFileDescriptor 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 LockFileDescriptor() + { + super(); + nsURI = "http://www.vamsas.ac.uk/vamsasDocument"; + xmlName = "LockFile"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + LockFile target = (LockFile) object; + return target.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + LockFile target = (LockFile) object; + target.setContent( (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: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize attribute descriptors + + //-- initialize element descriptors + + } //-- uk.ac.vamsas.objects.core.LockFileDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.LockFile.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/uk/ac/vamsas/objects/core/Map.java b/src/uk/ac/vamsas/objects/core/Map.java new file mode 100644 index 0000000..882c2e4 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Map.java @@ -0,0 +1,151 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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; + +/** + * From: Offset to first + * position in dataset sequence record that + * this database entry maps to To: Offset + * to last position in dataset sequence + * record that this database entry maps to + * Start: Offset to first last position in + * database entry that first (or offset) + * position in sequence maps to End: Offset + * to last position in database entry that + * last (offset) position in sequence maps + * to + * + * @version $Revision$ $Date$ + */ +public class Map extends uk.ac.vamsas.objects.core.MapList +implements java.io.Serializable +{ + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Map() + { + super(); + } //-- uk.ac.vamsas.objects.core.Map() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Map) { + + Map temp = (Map)obj; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * 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 MapList + */ + public static uk.ac.vamsas.objects.core.MapList unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Map) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Map.class, reader); + } //-- uk.ac.vamsas.objects.core.MapList 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/uk/ac/vamsas/objects/core/MapDescriptor.java b/src/uk/ac/vamsas/objects/core/MapDescriptor.java new file mode 100644 index 0000000..b5db8a3 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/MapDescriptor.java @@ -0,0 +1,167 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 MapDescriptor. + * + * @version $Revision$ $Date$ + */ +public class MapDescriptor extends uk.ac.vamsas.objects.core.MapListDescriptor { + + + //--------------------------/ + //- 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 MapDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.MapListDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "map"; + } //-- uk.ac.vamsas.objects.core.MapDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Map.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/uk/ac/vamsas/objects/core/MapList.java b/src/uk/ac/vamsas/objects/core/MapList.java new file mode 100644 index 0000000..63d6a1e --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/MapList.java @@ -0,0 +1,404 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 MapList. + * + * @version $Revision$ $Date$ + */ +public class MapList extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Offset to first position in dataset sequence record that + * start + * position on 'onto' maps to + */ + private int _from = 0; + + /** + * keeps track of state for field: _from + */ + private boolean _has_from; + + /** + * Offset to last position in dataset sequence record that end + * position on 'onto' maps to + */ + private int _to = 0; + + /** + * keeps track of state for field: _to + */ + private boolean _has_to; + + /** + * Offset to first position in database entry that first (or + * offset) + * position in sequence maps to + */ + private int _start; + + /** + * keeps track of state for field: _start + */ + private boolean _has_start; + + /** + * Offset to last position in database entry that last (offset) + * position in sequence maps to + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public MapList() + { + super(); + } //-- uk.ac.vamsas.objects.core.MapList() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteEnd + * + */ + public void deleteEnd() + { + this._has_end= false; + } //-- void deleteEnd() + + /** + * Method deleteFrom + * + */ + public void deleteFrom() + { + this._has_from= false; + } //-- void deleteFrom() + + /** + * Method deleteStart + * + */ + public void deleteStart() + { + this._has_start= false; + } //-- void deleteStart() + + /** + * Method deleteTo + * + */ + public void deleteTo() + { + this._has_to= false; + } //-- void deleteTo() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof MapList) { + + MapList temp = (MapList)obj; + if (this._from != temp._from) + return false; + if (this._has_from != temp._has_from) + return false; + if (this._to != temp._to) + return false; + if (this._has_to != temp._has_to) + return false; + if (this._start != temp._start) + return false; + if (this._has_start != temp._has_start) + return false; + if (this._end != temp._end) + return false; + if (this._has_end != temp._has_end) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'end'. The field 'end' has the + * following description: Offset to last position in database + * entry that last (offset) + * position in sequence maps to + * + * @return int + * @return the value of field 'end'. + */ + public int getEnd() + { + return this._end; + } //-- int getEnd() + + /** + * Returns the value of field 'from'. The field 'from' has the + * following description: Offset to first position in dataset + * sequence record that start + * position on 'onto' maps to + * + * @return int + * @return the value of field 'from'. + */ + public int getFrom() + { + return this._from; + } //-- int getFrom() + + /** + * Returns the value of field 'start'. The field 'start' has + * the following description: Offset to first position in + * database entry that first (or offset) + * position in sequence maps to + * + * @return int + * @return the value of field 'start'. + */ + public int getStart() + { + return this._start; + } //-- int getStart() + + /** + * Returns the value of field 'to'. The field 'to' has the + * following description: Offset to last position in dataset + * sequence record that end + * position on 'onto' maps to + * + * @return int + * @return the value of field 'to'. + */ + public int getTo() + { + return this._to; + } //-- int getTo() + + /** + * Method hasEnd + * + * + * + * @return boolean + */ + public boolean hasEnd() + { + return this._has_end; + } //-- boolean hasEnd() + + /** + * Method hasFrom + * + * + * + * @return boolean + */ + public boolean hasFrom() + { + return this._has_from; + } //-- boolean hasFrom() + + /** + * Method hasStart + * + * + * + * @return boolean + */ + public boolean hasStart() + { + return this._has_start; + } //-- boolean hasStart() + + /** + * Method hasTo + * + * + * + * @return boolean + */ + public boolean hasTo() + { + return this._has_to; + } //-- boolean hasTo() + + /** + * 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 'end'. The field 'end' has the + * following description: Offset to last position in database + * entry that last (offset) + * position in sequence maps to + * + * @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 'from'. The field 'from' has the + * following description: Offset to first position in dataset + * sequence record that start + * position on 'onto' maps to + * + * @param from the value of field 'from'. + */ + public void setFrom(int from) + { + this._from = from; + this._has_from = true; + } //-- void setFrom(int) + + /** + * Sets the value of field 'start'. The field 'start' has the + * following description: Offset to first position in database + * entry that first (or offset) + * position in sequence maps to + * + * @param start the value of field 'start'. + */ + public void setStart(int start) + { + this._start = start; + this._has_start = true; + } //-- void setStart(int) + + /** + * Sets the value of field 'to'. The field 'to' has the + * following description: Offset to last position in dataset + * sequence record that end + * position on 'onto' maps to + * + * @param to the value of field 'to'. + */ + public void setTo(int to) + { + this._to = to; + this._has_to = true; + } //-- void setTo(int) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return MapList + */ + public static uk.ac.vamsas.objects.core.MapList unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.MapList) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.MapList.class, reader); + } //-- uk.ac.vamsas.objects.core.MapList 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/uk/ac/vamsas/objects/core/MapListDescriptor.java b/src/uk/ac/vamsas/objects/core/MapListDescriptor.java new file mode 100644 index 0000000..d199f33 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/MapListDescriptor.java @@ -0,0 +1,339 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 MapListDescriptor. + * + * @version $Revision$ $Date$ + */ +public class MapListDescriptor 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 MapListDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "mapList"; + 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 + + //-- _from + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_from", "from", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + MapList target = (MapList) object; + if(!target.hasFrom()) + return null; + return new java.lang.Integer(target.getFrom()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + MapList target = (MapList) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteFrom(); + return; + } + target.setFrom( ((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: _from + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + IntegerValidator typeValidator = new IntegerValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _to + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_to", "to", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + MapList target = (MapList) object; + if(!target.hasTo()) + return null; + return new java.lang.Integer(target.getTo()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + MapList target = (MapList) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteTo(); + return; + } + target.setTo( ((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: _to + 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 + { + MapList target = (MapList) 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 { + MapList target = (MapList) 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); + desc.setMultivalued(false); + 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 + { + MapList target = (MapList) 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 { + MapList target = (MapList) 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); + desc.setMultivalued(false); + 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); + //-- initialize element descriptors + + } //-- uk.ac.vamsas.objects.core.MapListDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.MapList.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/uk/ac/vamsas/objects/core/Mapping.java b/src/uk/ac/vamsas/objects/core/Mapping.java new file mode 100644 index 0000000..f5c3317 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Mapping.java @@ -0,0 +1,186 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Mapping. + * + * @version $Revision$ $Date$ + */ +public class Mapping extends uk.ac.vamsas.objects.core.MapList +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * object to which the mapping is being mapped + * + */ + private java.lang.Object _onto; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Mapping() + { + super(); + } //-- uk.ac.vamsas.objects.core.Mapping() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Mapping) { + + Mapping temp = (Mapping)obj; + if (this._onto != null) { + if (temp._onto == null) return false; + else if (!(this._onto.equals(temp._onto))) + return false; + } + else if (temp._onto != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'onto'. The field 'onto' has the + * following description: object to which the mapping is being + * mapped + * + * + * @return Object + * @return the value of field 'onto'. + */ + public java.lang.Object getOnto() + { + return this._onto; + } //-- java.lang.Object getOnto() + + /** + * 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 'onto'. The field 'onto' has the + * following description: object to which the mapping is being + * mapped + * + * + * @param onto the value of field 'onto'. + */ + public void setOnto(java.lang.Object onto) + { + this._onto = onto; + } //-- void setOnto(java.lang.Object) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return MapList + */ + public static uk.ac.vamsas.objects.core.MapList unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Mapping) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Mapping.class, reader); + } //-- uk.ac.vamsas.objects.core.MapList 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/uk/ac/vamsas/objects/core/MappingDescriptor.java b/src/uk/ac/vamsas/objects/core/MappingDescriptor.java new file mode 100644 index 0000000..703fcd1 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/MappingDescriptor.java @@ -0,0 +1,210 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 MappingDescriptor. + * + * @version $Revision$ $Date$ + */ +public class MappingDescriptor extends uk.ac.vamsas.objects.core.MapListDescriptor { + + + //--------------------------/ + //- 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 MappingDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.MapListDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "mapping"; + 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 + + //-- _onto + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_onto", "onto", 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 + { + Mapping target = (Mapping) object; + return target.getOnto(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Mapping target = (Mapping) object; + target.setOnto( (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: _onto + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- initialize element descriptors + + } //-- uk.ac.vamsas.objects.core.MappingDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Mapping.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/uk/ac/vamsas/objects/core/Newick.java b/src/uk/ac/vamsas/objects/core/Newick.java new file mode 100644 index 0000000..581bdca --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Newick.java @@ -0,0 +1,288 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:Newick.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Newick. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class Newick extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * internal content storage + */ + private java.lang.String _content = ""; + + /** + * Field _title + */ + private java.lang.String _title; + + /** + * Primary Key for vamsas object referencing + * + */ + private java.lang.String _id; + + /** + * Field _modifiable + */ + private java.lang.String _modifiable; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Newick() + { + super(); + setContent(""); + } //-- uk.ac.vamsas.objects.core.Newick() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Newick) { + + Newick temp = (Newick)obj; + if (this._content != null) { + if (temp._content == null) return false; + else if (!(this._content.equals(temp._content))) + return false; + } + else if (temp._content != null) + return false; + if (this._title != null) { + if (temp._title == null) return false; + else if (!(this._title.equals(temp._title))) + return false; + } + else if (temp._title != 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._modifiable != null) { + if (temp._modifiable == null) return false; + else if (!(this._modifiable.equals(temp._modifiable))) + return false; + } + else if (temp._modifiable != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'content'. The field 'content' + * has the following description: internal content storage + * + * @return String + * @return the value of field 'content'. + */ + public java.lang.String getContent() + { + return this._content; + } //-- java.lang.String getContent() + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @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 'modifiable'. + * + * @return String + * @return the value of field 'modifiable'. + */ + public java.lang.String getModifiable() + { + return this._modifiable; + } //-- java.lang.String getModifiable() + + /** + * 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() + + /** + * 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 'content'. The field 'content' has + * the following description: internal content storage + * + * @param content the value of field 'content'. + */ + public void setContent(java.lang.String content) + { + this._content = content; + } //-- void setContent(java.lang.String) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @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 'modifiable'. + * + * @param modifiable the value of field 'modifiable'. + */ + public void setModifiable(java.lang.String modifiable) + { + this._modifiable = modifiable; + } //-- void setModifiable(java.lang.String) + + /** + * 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) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Newick + */ + public static uk.ac.vamsas.objects.core.Newick unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Newick) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Newick.class, reader); + } //-- uk.ac.vamsas.objects.core.Newick 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/uk/ac/vamsas/objects/core/NewickDescriptor.java b/src/uk/ac/vamsas/objects/core/NewickDescriptor.java new file mode 100644 index 0000000..dbc4ef5 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/NewickDescriptor.java @@ -0,0 +1,315 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:NewickDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 NewickDescriptor. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class NewickDescriptor 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 NewickDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "newick"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Newick target = (Newick) object; + return target.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Newick target = (Newick) object; + target.setContent( (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: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- initialize attribute descriptors + + //-- _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 + { + Newick target = (Newick) object; + return target.getTitle(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Newick target = (Newick) 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.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); + //-- _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 + { + Newick target = (Newick) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Newick target = (Newick) 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 + } + desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", 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 + { + Newick target = (Newick) object; + return target.getModifiable(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Newick target = (Newick) object; + target.setModifiable( (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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _modifiable + 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 + + } //-- uk.ac.vamsas.objects.core.NewickDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Newick.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/uk/ac/vamsas/objects/core/Param.java b/src/uk/ac/vamsas/objects/core/Param.java new file mode 100644 index 0000000..99acc26 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Param.java @@ -0,0 +1,261 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Param. + * + * @version $Revision$ $Date$ + */ +public class Param extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * internal content storage + */ + private java.lang.String _content = ""; + + /** + * Field _name + */ + private java.lang.String _name; + + /** + * The type specifies how the property will be parsed. + * Empty property strings are allowed, and can be used to + * prototype the + * input to a document. TODO: specify allowed types + */ + private java.lang.String _type; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Param() + { + super(); + setContent(""); + } //-- uk.ac.vamsas.objects.core.Param() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Param) { + + Param temp = (Param)obj; + if (this._content != null) { + if (temp._content == null) return false; + else if (!(this._content.equals(temp._content))) + return false; + } + else if (temp._content != null) + return false; + if (this._name != null) { + if (temp._name == null) return false; + else if (!(this._name.equals(temp._name))) + return false; + } + else if (temp._name != null) + return false; + if (this._type != null) { + if (temp._type == null) return false; + else if (!(this._type.equals(temp._type))) + return false; + } + else if (temp._type != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'content'. The field 'content' + * has the following description: internal content storage + * + * @return String + * @return the value of field 'content'. + */ + public java.lang.String getContent() + { + return this._content; + } //-- java.lang.String getContent() + + /** + * 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 'type'. The field 'type' has the + * following description: The type specifies how the property + * will be parsed. + * Empty property strings are allowed, and can be used to + * prototype the + * input to a document. TODO: specify allowed types + * + * @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) + + /** + * Sets the value of field 'content'. The field 'content' has + * the following description: internal content storage + * + * @param content the value of field 'content'. + */ + public void setContent(java.lang.String content) + { + this._content = content; + } //-- void setContent(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 'type'. The field 'type' has the + * following description: The type specifies how the property + * will be parsed. + * Empty property strings are allowed, and can be used to + * prototype the + * input to a document. TODO: specify allowed types + * + * @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 Param + */ + public static uk.ac.vamsas.objects.core.Param unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Param) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Param.class, reader); + } //-- uk.ac.vamsas.objects.core.Param 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/uk/ac/vamsas/objects/core/ParamDescriptor.java b/src/uk/ac/vamsas/objects/core/ParamDescriptor.java new file mode 100644 index 0000000..503c1ca --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/ParamDescriptor.java @@ -0,0 +1,285 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 ParamDescriptor. + * + * @version $Revision$ $Date$ + */ +public class ParamDescriptor 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 ParamDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "param"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Param target = (Param) object; + return target.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Param target = (Param) object; + target.setContent( (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: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- 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 + { + Param target = (Param) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Param target = (Param) 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); + 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); + //-- _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 + { + Param target = (Param) object; + return target.getType(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Param target = (Param) 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); + desc.setMultivalued(false); + 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); + //-- initialize element descriptors + + } //-- uk.ac.vamsas.objects.core.ParamDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Param.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/uk/ac/vamsas/objects/core/Pos.java b/src/uk/ac/vamsas/objects/core/Pos.java new file mode 100644 index 0000000..dbf5d47 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Pos.java @@ -0,0 +1,204 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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; + +/** + * a position within the associated object's coordinate system + * + * + * @version $Revision$ $Date$ + */ +public class Pos extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _i + */ + private int _i; + + /** + * keeps track of state for field: _i + */ + private boolean _has_i; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Pos() + { + super(); + } //-- uk.ac.vamsas.objects.core.Pos() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteI + * + */ + public void deleteI() + { + this._has_i= false; + } //-- void deleteI() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Pos) { + + Pos temp = (Pos)obj; + if (this._i != temp._i) + return false; + if (this._has_i != temp._has_i) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'i'. + * + * @return int + * @return the value of field 'i'. + */ + public int getI() + { + return this._i; + } //-- int getI() + + /** + * Method hasI + * + * + * + * @return boolean + */ + public boolean hasI() + { + return this._has_i; + } //-- boolean hasI() + + /** + * 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 'i'. + * + * @param i the value of field 'i'. + */ + public void setI(int i) + { + this._i = i; + this._has_i = true; + } //-- void setI(int) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Pos + */ + public static uk.ac.vamsas.objects.core.Pos unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Pos) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Pos.class, reader); + } //-- uk.ac.vamsas.objects.core.Pos 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/uk/ac/vamsas/objects/core/PosDescriptor.java b/src/uk/ac/vamsas/objects/core/PosDescriptor.java new file mode 100644 index 0000000..758c8cb --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/PosDescriptor.java @@ -0,0 +1,213 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 PosDescriptor. + * + * @version $Revision$ $Date$ + */ +public class PosDescriptor 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 PosDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "pos"; + 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 + + //-- _i + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_i", "i", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Pos target = (Pos) object; + if(!target.hasI()) + return null; + return new java.lang.Integer(target.getI()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Pos target = (Pos) object; + // ignore null values for non optional primitives + if (value == null) return; + + target.setI( ((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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _i + 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 + + } //-- uk.ac.vamsas.objects.core.PosDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Pos.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/uk/ac/vamsas/objects/core/Property.java b/src/uk/ac/vamsas/objects/core/Property.java new file mode 100644 index 0000000..b8c4743 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Property.java @@ -0,0 +1,261 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * internal content storage + */ + private java.lang.String _content = ""; + + /** + * Field _name + */ + private java.lang.String _name; + + /** + * The type specifies how the property will be parsed. + * Empty property strings are allowed, and can be used to + * prototype the + * input to a document. TODO: specify allowed types + */ + private java.lang.String _type; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Property() + { + super(); + setContent(""); + } //-- uk.ac.vamsas.objects.core.Property() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Property) { + + Property temp = (Property)obj; + if (this._content != null) { + if (temp._content == null) return false; + else if (!(this._content.equals(temp._content))) + return false; + } + else if (temp._content != null) + return false; + if (this._name != null) { + if (temp._name == null) return false; + else if (!(this._name.equals(temp._name))) + return false; + } + else if (temp._name != null) + return false; + if (this._type != null) { + if (temp._type == null) return false; + else if (!(this._type.equals(temp._type))) + return false; + } + else if (temp._type != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'content'. The field 'content' + * has the following description: internal content storage + * + * @return String + * @return the value of field 'content'. + */ + public java.lang.String getContent() + { + return this._content; + } //-- java.lang.String getContent() + + /** + * 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 'type'. The field 'type' has the + * following description: The type specifies how the property + * will be parsed. + * Empty property strings are allowed, and can be used to + * prototype the + * input to a document. TODO: specify allowed types + * + * @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) + + /** + * Sets the value of field 'content'. The field 'content' has + * the following description: internal content storage + * + * @param content the value of field 'content'. + */ + public void setContent(java.lang.String content) + { + this._content = content; + } //-- void setContent(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 'type'. The field 'type' has the + * following description: The type specifies how the property + * will be parsed. + * Empty property strings are allowed, and can be used to + * prototype the + * input to a document. TODO: specify allowed types + * + * @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 Property + */ + public static uk.ac.vamsas.objects.core.Property unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Property) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Property.class, reader); + } //-- uk.ac.vamsas.objects.core.Property 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/uk/ac/vamsas/objects/core/PropertyDescriptor.java b/src/uk/ac/vamsas/objects/core/PropertyDescriptor.java new file mode 100644 index 0000000..de61324 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/PropertyDescriptor.java @@ -0,0 +1,285 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 = "http://www.vamsas.org"; + xmlName = "property"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + 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.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Property target = (Property) object; + target.setContent( (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: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- 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); + 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); + //-- _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 + { + Property target = (Property) object; + return target.getType(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Property target = (Property) 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); + desc.setMultivalued(false); + 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); + //-- initialize element descriptors + + } //-- uk.ac.vamsas.objects.core.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 uk.ac.vamsas.objects.core.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/uk/ac/vamsas/objects/core/Provenance.java b/src/uk/ac/vamsas/objects/core/Provenance.java new file mode 100644 index 0000000..d5daa1f --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Provenance.java @@ -0,0 +1,306 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:Provenance.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Provenance. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class Provenance extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _entryList + */ + private java.util.Vector _entryList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Provenance() + { + super(); + _entryList = new Vector(); + } //-- uk.ac.vamsas.objects.core.Provenance() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addEntry + * + * + * + * @param vEntry + */ + public void addEntry(uk.ac.vamsas.objects.core.Entry vEntry) + throws java.lang.IndexOutOfBoundsException + { + _entryList.addElement(vEntry); + } //-- void addEntry(uk.ac.vamsas.objects.core.Entry) + + /** + * Method addEntry + * + * + * + * @param index + * @param vEntry + */ + public void addEntry(int index, uk.ac.vamsas.objects.core.Entry vEntry) + throws java.lang.IndexOutOfBoundsException + { + _entryList.insertElementAt(vEntry, index); + } //-- void addEntry(int, uk.ac.vamsas.objects.core.Entry) + + /** + * Method enumerateEntry + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateEntry() + { + return _entryList.elements(); + } //-- java.util.Enumeration enumerateEntry() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Provenance) { + + Provenance temp = (Provenance)obj; + if (this._entryList != null) { + if (temp._entryList == null) return false; + else if (!(this._entryList.equals(temp._entryList))) + return false; + } + else if (temp._entryList != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Method getEntry + * + * + * + * @param index + * @return Entry + */ + public uk.ac.vamsas.objects.core.Entry getEntry(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _entryList.size())) { + throw new IndexOutOfBoundsException("getEntry: Index value '"+index+"' not in range [0.."+_entryList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Entry) _entryList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Entry getEntry(int) + + /** + * Method getEntry + * + * + * + * @return Entry + */ + public uk.ac.vamsas.objects.core.Entry[] getEntry() + { + int size = _entryList.size(); + uk.ac.vamsas.objects.core.Entry[] mArray = new uk.ac.vamsas.objects.core.Entry[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Entry) _entryList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Entry[] getEntry() + + /** + * Method getEntryCount + * + * + * + * @return int + */ + public int getEntryCount() + { + return _entryList.size(); + } //-- int getEntryCount() + + /** + * 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 removeAllEntry + * + */ + public void removeAllEntry() + { + _entryList.removeAllElements(); + } //-- void removeAllEntry() + + /** + * Method removeEntry + * + * + * + * @param index + * @return Entry + */ + public uk.ac.vamsas.objects.core.Entry removeEntry(int index) + { + java.lang.Object obj = _entryList.elementAt(index); + _entryList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Entry) obj; + } //-- uk.ac.vamsas.objects.core.Entry removeEntry(int) + + /** + * Method setEntry + * + * + * + * @param index + * @param vEntry + */ + public void setEntry(int index, uk.ac.vamsas.objects.core.Entry vEntry) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _entryList.size())) { + throw new IndexOutOfBoundsException("setEntry: Index value '"+index+"' not in range [0.."+_entryList.size()+ "]"); + } + _entryList.setElementAt(vEntry, index); + } //-- void setEntry(int, uk.ac.vamsas.objects.core.Entry) + + /** + * Method setEntry + * + * + * + * @param entryArray + */ + public void setEntry(uk.ac.vamsas.objects.core.Entry[] entryArray) + { + //-- copy array + _entryList.removeAllElements(); + for (int i = 0; i < entryArray.length; i++) { + _entryList.addElement(entryArray[i]); + } + } //-- void setEntry(uk.ac.vamsas.objects.core.Entry) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Provenance + */ + public static uk.ac.vamsas.objects.core.Provenance unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Provenance) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Provenance.class, reader); + } //-- uk.ac.vamsas.objects.core.Provenance 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/uk/ac/vamsas/objects/core/ProvenanceDescriptor.java b/src/uk/ac/vamsas/objects/core/ProvenanceDescriptor.java new file mode 100644 index 0000000..e5e3b80 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/ProvenanceDescriptor.java @@ -0,0 +1,210 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:ProvenanceDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 ProvenanceDescriptor. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class ProvenanceDescriptor 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 ProvenanceDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "Provenance"; + + //-- 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 + + //-- initialize element descriptors + + //-- _entryList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Entry.class, "_entryList", "entry", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Provenance target = (Provenance) object; + return target.getEntry(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Provenance target = (Provenance) object; + target.addEntry( (uk.ac.vamsas.objects.core.Entry) 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.Entry(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _entryList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- uk.ac.vamsas.objects.core.ProvenanceDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Provenance.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/uk/ac/vamsas/objects/core/RangeAnnotation.java b/src/uk/ac/vamsas/objects/core/RangeAnnotation.java new file mode 100644 index 0000000..f36bbfb --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/RangeAnnotation.java @@ -0,0 +1,1093 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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; + +/** + * Annotation for a rangeSpec - values can be attached for the + * whole + * specification, and to each position within the spec. following + * the orientation + * specified by the ordered set of rangeSpec (pos, seg) elements. + * + * @version $Revision$ $Date$ + */ +public class RangeAnnotation extends uk.ac.vamsas.objects.core.RangeType +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Primary Key for vamsas object referencing + * + */ + private java.lang.String _id; + + /** + * Field _modifiable + */ + private java.lang.String _modifiable; + + /** + * Annotation with the same non-empty group name are grouped + * together + */ + private java.lang.String _group = ""; + + /** + * A Das Feature has both a type and a Type ID. We go the + * route of requiring the type string to be taken from a + * controlled + * vocabulary if an application expects others to make sense + * of it. The + * type may qualified - so uniprot:CHAIN is a valid type name, + * and + * considered distinct from someotherDB:CHAIN + */ + private java.lang.String _type; + + /** + * Short, meaningful name for the annotation - if this + * is absent, then the type string should be used in its + * place. + * + */ + private java.lang.String _label; + + /** + * Human readable description of the annotation + * + */ + private java.lang.String _description; + + /** + * TODO: specify this - we have considered taking the GO + * evidence codes as a model for assessing a measure of + * quality to an + * annotation. + */ + private java.lang.String _status; + + /** + * Annotation Element position maps to ordered positions + * defined by the sequence of rangeType pos positions or + * concatenated + * seg start/end segments. + */ + private java.util.Vector _annotationElementList; + + /** + * Ordered set of optionally named float values for the + * whole annotation + */ + private java.util.Vector _scoreList; + + /** + * Field _linkList + */ + private java.util.Vector _linkList; + + /** + * Note:These are mutable so an application should check + * them each time. + */ + private java.util.Vector _propertyList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public RangeAnnotation() + { + super(); + setGroup(""); + _annotationElementList = new Vector(); + _scoreList = new Vector(); + _linkList = new Vector(); + _propertyList = new Vector(); + } //-- uk.ac.vamsas.objects.core.RangeAnnotation() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addAnnotationElement + * + * + * + * @param vAnnotationElement + */ + public void addAnnotationElement(uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + _annotationElementList.addElement(vAnnotationElement); + } //-- void addAnnotationElement(uk.ac.vamsas.objects.core.AnnotationElement) + + /** + * Method addAnnotationElement + * + * + * + * @param index + * @param vAnnotationElement + */ + public void addAnnotationElement(int index, uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + _annotationElementList.insertElementAt(vAnnotationElement, index); + } //-- void addAnnotationElement(int, uk.ac.vamsas.objects.core.AnnotationElement) + + /** + * Method addLink + * + * + * + * @param vLink + */ + public void addLink(uk.ac.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException + { + _linkList.addElement(vLink); + } //-- void addLink(uk.ac.vamsas.objects.core.Link) + + /** + * Method addLink + * + * + * + * @param index + * @param vLink + */ + public void addLink(int index, uk.ac.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException + { + _linkList.insertElementAt(vLink, index); + } //-- void addLink(int, uk.ac.vamsas.objects.core.Link) + + /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(uk.ac.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, uk.ac.vamsas.objects.core.Property) + + /** + * Method addScore + * + * + * + * @param vScore + */ + public void addScore(uk.ac.vamsas.objects.core.Score vScore) + throws java.lang.IndexOutOfBoundsException + { + _scoreList.addElement(vScore); + } //-- void addScore(uk.ac.vamsas.objects.core.Score) + + /** + * Method addScore + * + * + * + * @param index + * @param vScore + */ + public void addScore(int index, uk.ac.vamsas.objects.core.Score vScore) + throws java.lang.IndexOutOfBoundsException + { + _scoreList.insertElementAt(vScore, index); + } //-- void addScore(int, uk.ac.vamsas.objects.core.Score) + + /** + * Method enumerateAnnotationElement + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAnnotationElement() + { + return _annotationElementList.elements(); + } //-- java.util.Enumeration enumerateAnnotationElement() + + /** + * Method enumerateLink + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateLink() + { + return _linkList.elements(); + } //-- java.util.Enumeration enumerateLink() + + /** + * Method enumerateProperty + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateProperty() + { + return _propertyList.elements(); + } //-- java.util.Enumeration enumerateProperty() + + /** + * Method enumerateScore + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateScore() + { + return _scoreList.elements(); + } //-- java.util.Enumeration enumerateScore() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof RangeAnnotation) { + + RangeAnnotation temp = (RangeAnnotation)obj; + 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._modifiable != null) { + if (temp._modifiable == null) return false; + else if (!(this._modifiable.equals(temp._modifiable))) + return false; + } + else if (temp._modifiable != null) + return false; + if (this._group != null) { + if (temp._group == null) return false; + else if (!(this._group.equals(temp._group))) + return false; + } + else if (temp._group != null) + return false; + if (this._type != null) { + if (temp._type == null) return false; + else if (!(this._type.equals(temp._type))) + return false; + } + else if (temp._type != null) + return false; + if (this._label != null) { + if (temp._label == null) return false; + else if (!(this._label.equals(temp._label))) + return false; + } + else if (temp._label != null) + return false; + if (this._description != null) { + if (temp._description == null) return false; + else if (!(this._description.equals(temp._description))) + return false; + } + else if (temp._description != null) + return false; + if (this._status != null) { + if (temp._status == null) return false; + else if (!(this._status.equals(temp._status))) + return false; + } + else if (temp._status != null) + return false; + if (this._annotationElementList != null) { + if (temp._annotationElementList == null) return false; + else if (!(this._annotationElementList.equals(temp._annotationElementList))) + return false; + } + else if (temp._annotationElementList != null) + return false; + if (this._scoreList != null) { + if (temp._scoreList == null) return false; + else if (!(this._scoreList.equals(temp._scoreList))) + return false; + } + else if (temp._scoreList != null) + return false; + if (this._linkList != null) { + if (temp._linkList == null) return false; + else if (!(this._linkList.equals(temp._linkList))) + return false; + } + else if (temp._linkList != null) + return false; + if (this._propertyList != null) { + if (temp._propertyList == null) return false; + else if (!(this._propertyList.equals(temp._propertyList))) + return false; + } + else if (temp._propertyList != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Method getAnnotationElement + * + * + * + * @param index + * @return AnnotationElement + */ + public uk.ac.vamsas.objects.core.AnnotationElement getAnnotationElement(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _annotationElementList.size())) { + throw new IndexOutOfBoundsException("getAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.AnnotationElement getAnnotationElement(int) + + /** + * Method getAnnotationElement + * + * + * + * @return AnnotationElement + */ + public uk.ac.vamsas.objects.core.AnnotationElement[] getAnnotationElement() + { + int size = _annotationElementList.size(); + uk.ac.vamsas.objects.core.AnnotationElement[] mArray = new uk.ac.vamsas.objects.core.AnnotationElement[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.AnnotationElement[] getAnnotationElement() + + /** + * Method getAnnotationElementCount + * + * + * + * @return int + */ + public int getAnnotationElementCount() + { + return _annotationElementList.size(); + } //-- int getAnnotationElementCount() + + /** + * Returns the value of field 'description'. The field + * 'description' has the following description: Human readable + * description of the annotation + * + * + * @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 'group'. The field 'group' has + * the following description: Annotation with the same + * non-empty group name are grouped + * together + * + * @return String + * @return the value of field 'group'. + */ + public java.lang.String getGroup() + { + return this._group; + } //-- java.lang.String getGroup() + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @return String + * @return the value of field 'id'. + */ + public java.lang.String getId() + { + return this._id; + } //-- java.lang.String getId() + + /** + * Returns the value of field 'label'. The field 'label' has + * the following description: Short, meaningful name for the + * annotation - if this + * is absent, then the type string should be used in its + * place. + * + * + * @return String + * @return the value of field 'label'. + */ + public java.lang.String getLabel() + { + return this._label; + } //-- java.lang.String getLabel() + + /** + * Method getLink + * + * + * + * @param index + * @return Link + */ + public uk.ac.vamsas.objects.core.Link getLink(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _linkList.size())) { + throw new IndexOutOfBoundsException("getLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Link) _linkList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Link getLink(int) + + /** + * Method getLink + * + * + * + * @return Link + */ + public uk.ac.vamsas.objects.core.Link[] getLink() + { + int size = _linkList.size(); + uk.ac.vamsas.objects.core.Link[] mArray = new uk.ac.vamsas.objects.core.Link[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Link) _linkList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Link[] getLink() + + /** + * Method getLinkCount + * + * + * + * @return int + */ + public int getLinkCount() + { + return _linkList.size(); + } //-- int getLinkCount() + + /** + * Returns the value of field 'modifiable'. + * + * @return String + * @return the value of field 'modifiable'. + */ + public java.lang.String getModifiable() + { + return this._modifiable; + } //-- java.lang.String getModifiable() + + /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public uk.ac.vamsas.objects.core.Property getProperty(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public uk.ac.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + uk.ac.vamsas.objects.core.Property[] mArray = new uk.ac.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Property[] getProperty() + + /** + * Method getPropertyCount + * + * + * + * @return int + */ + public int getPropertyCount() + { + return _propertyList.size(); + } //-- int getPropertyCount() + + /** + * Method getScore + * + * + * + * @param index + * @return Score + */ + public uk.ac.vamsas.objects.core.Score getScore(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _scoreList.size())) { + throw new IndexOutOfBoundsException("getScore: Index value '"+index+"' not in range [0.."+_scoreList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Score) _scoreList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Score getScore(int) + + /** + * Method getScore + * + * + * + * @return Score + */ + public uk.ac.vamsas.objects.core.Score[] getScore() + { + int size = _scoreList.size(); + uk.ac.vamsas.objects.core.Score[] mArray = new uk.ac.vamsas.objects.core.Score[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Score) _scoreList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Score[] getScore() + + /** + * Method getScoreCount + * + * + * + * @return int + */ + public int getScoreCount() + { + return _scoreList.size(); + } //-- int getScoreCount() + + /** + * Returns the value of field 'status'. The field 'status' has + * the following description: TODO: specify this - we have + * considered taking the GO + * evidence codes as a model for assessing a measure of + * quality to an + * annotation. + * + * @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'. The field 'type' has the + * following description: A Das Feature has both a type and a + * Type ID. We go the + * route of requiring the type string to be taken from a + * controlled + * vocabulary if an application expects others to make sense + * of it. The + * type may qualified - so uniprot:CHAIN is a valid type name, + * and + * considered distinct from someotherDB:CHAIN + * + * @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 removeAllAnnotationElement + * + */ + public void removeAllAnnotationElement() + { + _annotationElementList.removeAllElements(); + } //-- void removeAllAnnotationElement() + + /** + * Method removeAllLink + * + */ + public void removeAllLink() + { + _linkList.removeAllElements(); + } //-- void removeAllLink() + + /** + * Method removeAllProperty + * + */ + public void removeAllProperty() + { + _propertyList.removeAllElements(); + } //-- void removeAllProperty() + + /** + * Method removeAllScore + * + */ + public void removeAllScore() + { + _scoreList.removeAllElements(); + } //-- void removeAllScore() + + /** + * Method removeAnnotationElement + * + * + * + * @param index + * @return AnnotationElement + */ + public uk.ac.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index) + { + java.lang.Object obj = _annotationElementList.elementAt(index); + _annotationElementList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.AnnotationElement) obj; + } //-- uk.ac.vamsas.objects.core.AnnotationElement removeAnnotationElement(int) + + /** + * Method removeLink + * + * + * + * @param index + * @return Link + */ + public uk.ac.vamsas.objects.core.Link removeLink(int index) + { + java.lang.Object obj = _linkList.elementAt(index); + _linkList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Link) obj; + } //-- uk.ac.vamsas.objects.core.Link removeLink(int) + + /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public uk.ac.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Property) obj; + } //-- uk.ac.vamsas.objects.core.Property removeProperty(int) + + /** + * Method removeScore + * + * + * + * @param index + * @return Score + */ + public uk.ac.vamsas.objects.core.Score removeScore(int index) + { + java.lang.Object obj = _scoreList.elementAt(index); + _scoreList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Score) obj; + } //-- uk.ac.vamsas.objects.core.Score removeScore(int) + + /** + * Method setAnnotationElement + * + * + * + * @param index + * @param vAnnotationElement + */ + public void setAnnotationElement(int index, uk.ac.vamsas.objects.core.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _annotationElementList.size())) { + throw new IndexOutOfBoundsException("setAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]"); + } + _annotationElementList.setElementAt(vAnnotationElement, index); + } //-- void setAnnotationElement(int, uk.ac.vamsas.objects.core.AnnotationElement) + + /** + * Method setAnnotationElement + * + * + * + * @param annotationElementArray + */ + public void setAnnotationElement(uk.ac.vamsas.objects.core.AnnotationElement[] annotationElementArray) + { + //-- copy array + _annotationElementList.removeAllElements(); + for (int i = 0; i < annotationElementArray.length; i++) { + _annotationElementList.addElement(annotationElementArray[i]); + } + } //-- void setAnnotationElement(uk.ac.vamsas.objects.core.AnnotationElement) + + /** + * Sets the value of field 'description'. The field + * 'description' has the following description: Human readable + * description of the annotation + * + * + * @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 'group'. The field 'group' has the + * following description: Annotation with the same non-empty + * group name are grouped + * together + * + * @param group the value of field 'group'. + */ + public void setGroup(java.lang.String group) + { + this._group = group; + } //-- void setGroup(java.lang.String) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @param id the value of field 'id'. + */ + public void setId(java.lang.String id) + { + this._id = id; + } //-- void setId(java.lang.String) + + /** + * Sets the value of field 'label'. The field 'label' has the + * following description: Short, meaningful name for the + * annotation - if this + * is absent, then the type string should be used in its + * place. + * + * + * @param label the value of field 'label'. + */ + public void setLabel(java.lang.String label) + { + this._label = label; + } //-- void setLabel(java.lang.String) + + /** + * Method setLink + * + * + * + * @param index + * @param vLink + */ + public void setLink(int index, uk.ac.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _linkList.size())) { + throw new IndexOutOfBoundsException("setLink: Index value '"+index+"' not in range [0.."+_linkList.size()+ "]"); + } + _linkList.setElementAt(vLink, index); + } //-- void setLink(int, uk.ac.vamsas.objects.core.Link) + + /** + * Method setLink + * + * + * + * @param linkArray + */ + public void setLink(uk.ac.vamsas.objects.core.Link[] linkArray) + { + //-- copy array + _linkList.removeAllElements(); + for (int i = 0; i < linkArray.length; i++) { + _linkList.addElement(linkArray[i]); + } + } //-- void setLink(uk.ac.vamsas.objects.core.Link) + + /** + * Sets the value of field 'modifiable'. + * + * @param modifiable the value of field 'modifiable'. + */ + public void setModifiable(java.lang.String modifiable) + { + this._modifiable = modifiable; + } //-- void setModifiable(java.lang.String) + + /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + _propertyList.setElementAt(vProperty, index); + } //-- void setProperty(int, uk.ac.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(uk.ac.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(uk.ac.vamsas.objects.core.Property) + + /** + * Method setScore + * + * + * + * @param index + * @param vScore + */ + public void setScore(int index, uk.ac.vamsas.objects.core.Score vScore) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _scoreList.size())) { + throw new IndexOutOfBoundsException("setScore: Index value '"+index+"' not in range [0.."+_scoreList.size()+ "]"); + } + _scoreList.setElementAt(vScore, index); + } //-- void setScore(int, uk.ac.vamsas.objects.core.Score) + + /** + * Method setScore + * + * + * + * @param scoreArray + */ + public void setScore(uk.ac.vamsas.objects.core.Score[] scoreArray) + { + //-- copy array + _scoreList.removeAllElements(); + for (int i = 0; i < scoreArray.length; i++) { + _scoreList.addElement(scoreArray[i]); + } + } //-- void setScore(uk.ac.vamsas.objects.core.Score) + + /** + * Sets the value of field 'status'. The field 'status' has the + * following description: TODO: specify this - we have + * considered taking the GO + * evidence codes as a model for assessing a measure of + * quality to an + * annotation. + * + * @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'. The field 'type' has the + * following description: A Das Feature has both a type and a + * Type ID. We go the + * route of requiring the type string to be taken from a + * controlled + * vocabulary if an application expects others to make sense + * of it. The + * type may qualified - so uniprot:CHAIN is a valid type name, + * and + * considered distinct from someotherDB:CHAIN + * + * @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 RangeType + */ + public static uk.ac.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.RangeAnnotation) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.RangeAnnotation.class, reader); + } //-- uk.ac.vamsas.objects.core.RangeType 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/uk/ac/vamsas/objects/core/RangeAnnotationDescriptor.java b/src/uk/ac/vamsas/objects/core/RangeAnnotationDescriptor.java new file mode 100644 index 0000000..23a6a83 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/RangeAnnotationDescriptor.java @@ -0,0 +1,578 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 RangeAnnotationDescriptor. + * + * @version $Revision$ $Date$ + */ +public class RangeAnnotationDescriptor extends uk.ac.vamsas.objects.core.RangeTypeDescriptor { + + + //--------------------------/ + //- 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 RangeAnnotationDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.RangeTypeDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "rangeAnnotation"; + + //-- 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 + + //-- _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 + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) 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 + } + desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", 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 + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getModifiable(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.setModifiable( (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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _modifiable + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _group + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_group", "group", 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 + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getGroup(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.setGroup( (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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _group + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- 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 + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getType(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) 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); + desc.setMultivalued(false); + 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); + //-- initialize element descriptors + + //-- _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 + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getLabel(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) 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("http://www.vamsas.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _label + 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.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getDescription(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) 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("http://www.vamsas.org"); + desc.setMultivalued(false); + 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.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getStatus(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) 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); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(false); + 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); + //-- _annotationElementList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.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 + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getAnnotationElement(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.addAnnotationElement( (uk.ac.vamsas.objects.core.AnnotationElement) 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.AnnotationElement(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _annotationElementList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _scoreList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Score.class, "_scoreList", "score", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getScore(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.addScore( (uk.ac.vamsas.objects.core.Score) 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.Score(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _scoreList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _linkList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Link.class, "_linkList", "link", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getLink(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.addLink( (uk.ac.vamsas.objects.core.Link) 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.Link(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _linkList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.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 + { + RangeAnnotation target = (RangeAnnotation) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.addProperty( (uk.ac.vamsas.objects.core.Property) 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.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.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); + } //-- uk.ac.vamsas.objects.core.RangeAnnotationDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.RangeAnnotation.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/uk/ac/vamsas/objects/core/RangeType.java b/src/uk/ac/vamsas/objects/core/RangeType.java new file mode 100644 index 0000000..a0f457e --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/RangeType.java @@ -0,0 +1,452 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- Imported classes and packages -/ +//---------------------------------/ + +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.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; + +/** + * Specify an ordered set of positions and/or regions on the + * principle + * dimension of some associated vamsas object Keeping to jaxb-1.0 + * specification for the moment - this choice should + * become a substitution group when we use jaxb-2.0 capable + * bindings + * + * + * @version $Revision$ $Date$ + */ +public abstract class RangeType extends uk.ac.vamsas.clientnt.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Internal choice value storage + */ + private java.lang.Object _choiceValue; + + /** + * a position within the associated object's coordinate system + * + */ + private java.util.Vector _posList; + + /** + * a region from start to end, with flag for inclusivity of + * terminii + */ + private java.util.Vector _segList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public RangeType() + { + super(); + _posList = new Vector(); + _segList = new Vector(); + } //-- uk.ac.vamsas.objects.core.RangeType() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addPos + * + * + * + * @param vPos + */ + public void addPos(uk.ac.vamsas.objects.core.Pos vPos) + throws java.lang.IndexOutOfBoundsException + { + _posList.addElement(vPos); + } //-- void addPos(uk.ac.vamsas.objects.core.Pos) + + /** + * Method addPos + * + * + * + * @param index + * @param vPos + */ + public void addPos(int index, uk.ac.vamsas.objects.core.Pos vPos) + throws java.lang.IndexOutOfBoundsException + { + _posList.insertElementAt(vPos, index); + } //-- void addPos(int, uk.ac.vamsas.objects.core.Pos) + + /** + * Method addSeg + * + * + * + * @param vSeg + */ + public void addSeg(uk.ac.vamsas.objects.core.Seg vSeg) + throws java.lang.IndexOutOfBoundsException + { + _segList.addElement(vSeg); + } //-- void addSeg(uk.ac.vamsas.objects.core.Seg) + + /** + * Method addSeg + * + * + * + * @param index + * @param vSeg + */ + public void addSeg(int index, uk.ac.vamsas.objects.core.Seg vSeg) + throws java.lang.IndexOutOfBoundsException + { + _segList.insertElementAt(vSeg, index); + } //-- void addSeg(int, uk.ac.vamsas.objects.core.Seg) + + /** + * Method enumeratePos + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumeratePos() + { + return _posList.elements(); + } //-- java.util.Enumeration enumeratePos() + + /** + * Method enumerateSeg + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateSeg() + { + return _segList.elements(); + } //-- java.util.Enumeration enumerateSeg() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof RangeType) { + + RangeType temp = (RangeType)obj; + if (this._choiceValue != null) { + if (temp._choiceValue == null) return false; + else if (!(this._choiceValue.equals(temp._choiceValue))) + return false; + } + else if (temp._choiceValue != null) + return false; + if (this._posList != null) { + if (temp._posList == null) return false; + else if (!(this._posList.equals(temp._posList))) + return false; + } + else if (temp._posList != null) + return false; + if (this._segList != null) { + if (temp._segList == null) return false; + else if (!(this._segList.equals(temp._segList))) + return false; + } + else if (temp._segList != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'choiceValue'. The field + * 'choiceValue' has the following description: Internal choice + * value storage + * + * @return Object + * @return the value of field 'choiceValue'. + */ + public java.lang.Object getChoiceValue() + { + return this._choiceValue; + } //-- java.lang.Object getChoiceValue() + + /** + * Method getPos + * + * + * + * @param index + * @return Pos + */ + public uk.ac.vamsas.objects.core.Pos getPos(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _posList.size())) { + throw new IndexOutOfBoundsException("getPos: Index value '"+index+"' not in range [0.."+_posList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Pos) _posList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Pos getPos(int) + + /** + * Method getPos + * + * + * + * @return Pos + */ + public uk.ac.vamsas.objects.core.Pos[] getPos() + { + int size = _posList.size(); + uk.ac.vamsas.objects.core.Pos[] mArray = new uk.ac.vamsas.objects.core.Pos[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Pos) _posList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Pos[] getPos() + + /** + * Method getPosCount + * + * + * + * @return int + */ + public int getPosCount() + { + return _posList.size(); + } //-- int getPosCount() + + /** + * Method getSeg + * + * + * + * @param index + * @return Seg + */ + public uk.ac.vamsas.objects.core.Seg getSeg(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _segList.size())) { + throw new IndexOutOfBoundsException("getSeg: Index value '"+index+"' not in range [0.."+_segList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Seg) _segList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Seg getSeg(int) + + /** + * Method getSeg + * + * + * + * @return Seg + */ + public uk.ac.vamsas.objects.core.Seg[] getSeg() + { + int size = _segList.size(); + uk.ac.vamsas.objects.core.Seg[] mArray = new uk.ac.vamsas.objects.core.Seg[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Seg) _segList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Seg[] getSeg() + + /** + * Method getSegCount + * + * + * + * @return int + */ + public int getSegCount() + { + return _segList.size(); + } //-- int getSegCount() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method removeAllPos + * + */ + public void removeAllPos() + { + _posList.removeAllElements(); + } //-- void removeAllPos() + + /** + * Method removeAllSeg + * + */ + public void removeAllSeg() + { + _segList.removeAllElements(); + } //-- void removeAllSeg() + + /** + * Method removePos + * + * + * + * @param index + * @return Pos + */ + public uk.ac.vamsas.objects.core.Pos removePos(int index) + { + java.lang.Object obj = _posList.elementAt(index); + _posList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Pos) obj; + } //-- uk.ac.vamsas.objects.core.Pos removePos(int) + + /** + * Method removeSeg + * + * + * + * @param index + * @return Seg + */ + public uk.ac.vamsas.objects.core.Seg removeSeg(int index) + { + java.lang.Object obj = _segList.elementAt(index); + _segList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Seg) obj; + } //-- uk.ac.vamsas.objects.core.Seg removeSeg(int) + + /** + * Method setPos + * + * + * + * @param index + * @param vPos + */ + public void setPos(int index, uk.ac.vamsas.objects.core.Pos vPos) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _posList.size())) { + throw new IndexOutOfBoundsException("setPos: Index value '"+index+"' not in range [0.."+_posList.size()+ "]"); + } + _posList.setElementAt(vPos, index); + } //-- void setPos(int, uk.ac.vamsas.objects.core.Pos) + + /** + * Method setPos + * + * + * + * @param posArray + */ + public void setPos(uk.ac.vamsas.objects.core.Pos[] posArray) + { + //-- copy array + _posList.removeAllElements(); + for (int i = 0; i < posArray.length; i++) { + _posList.addElement(posArray[i]); + } + } //-- void setPos(uk.ac.vamsas.objects.core.Pos) + + /** + * Method setSeg + * + * + * + * @param index + * @param vSeg + */ + public void setSeg(int index, uk.ac.vamsas.objects.core.Seg vSeg) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _segList.size())) { + throw new IndexOutOfBoundsException("setSeg: Index value '"+index+"' not in range [0.."+_segList.size()+ "]"); + } + _segList.setElementAt(vSeg, index); + } //-- void setSeg(int, uk.ac.vamsas.objects.core.Seg) + + /** + * Method setSeg + * + * + * + * @param segArray + */ + public void setSeg(uk.ac.vamsas.objects.core.Seg[] segArray) + { + //-- copy array + _segList.removeAllElements(); + for (int i = 0; i < segArray.length; i++) { + _segList.addElement(segArray[i]); + } + } //-- void setSeg(uk.ac.vamsas.objects.core.Seg) + + /** + * 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/uk/ac/vamsas/objects/core/RangeTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/RangeTypeDescriptor.java new file mode 100644 index 0000000..33e8c0a --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/RangeTypeDescriptor.java @@ -0,0 +1,246 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 RangeTypeDescriptor. + * + * @version $Revision$ $Date$ + */ +public class RangeTypeDescriptor 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 RangeTypeDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "rangeType"; + + //-- set grouping compositor + setCompositorAsChoice(); + 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 + + //-- initialize element descriptors + + //-- _posList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Pos.class, "_posList", "pos", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeType target = (RangeType) object; + return target.getPos(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeType target = (RangeType) object; + target.addPos( (uk.ac.vamsas.objects.core.Pos) 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("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _posList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _segList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Seg.class, "_segList", "seg", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeType target = (RangeType) object; + return target.getSeg(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeType target = (RangeType) object; + target.addSeg( (uk.ac.vamsas.objects.core.Seg) 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("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _segList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- uk.ac.vamsas.objects.core.RangeTypeDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.RangeType.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/uk/ac/vamsas/objects/core/Score.java b/src/uk/ac/vamsas/objects/core/Score.java new file mode 100644 index 0000000..bb00fa4 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Score.java @@ -0,0 +1,240 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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; + +/** + * Ordered set of optionally named float values for the + * whole annotation + * + * @version $Revision$ $Date$ + */ +public class Score extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * internal content storage + */ + private float _content; + + /** + * keeps track of state for field: _content + */ + private boolean _has_content; + + /** + * Field _name + */ + private java.lang.String _name = "score"; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Score() + { + super(); + setName("score"); + } //-- uk.ac.vamsas.objects.core.Score() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteContent + * + */ + public void deleteContent() + { + this._has_content= false; + } //-- void deleteContent() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Score) { + + Score temp = (Score)obj; + if (this._content != temp._content) + return false; + if (this._has_content != temp._has_content) + return false; + if (this._name != null) { + if (temp._name == null) return false; + else if (!(this._name.equals(temp._name))) + return false; + } + else if (temp._name != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'content'. The field 'content' + * has the following description: internal content storage + * + * @return float + * @return the value of field 'content'. + */ + public float getContent() + { + return this._content; + } //-- float getContent() + + /** + * 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() + + /** + * Method hasContent + * + * + * + * @return boolean + */ + public boolean hasContent() + { + return this._has_content; + } //-- boolean hasContent() + + /** + * 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 'content'. The field 'content' has + * the following description: internal content storage + * + * @param content the value of field 'content'. + */ + public void setContent(float content) + { + this._content = content; + this._has_content = true; + } //-- void setContent(float) + + /** + * 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) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Score + */ + public static uk.ac.vamsas.objects.core.Score unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Score) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Score.class, reader); + } //-- uk.ac.vamsas.objects.core.Score 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/uk/ac/vamsas/objects/core/ScoreDescriptor.java b/src/uk/ac/vamsas/objects/core/ScoreDescriptor.java new file mode 100644 index 0000000..8659f20 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/ScoreDescriptor.java @@ -0,0 +1,249 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 ScoreDescriptor. + * + * @version $Revision$ $Date$ + */ +public class ScoreDescriptor 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 ScoreDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "score"; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Score target = (Score) object; + if(!target.hasContent()) + return null; + return new java.lang.Float(target.getContent()); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Score target = (Score) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteContent(); + return; + } + target.setContent( ((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: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + FloatValidator typeValidator = new FloatValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- 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 + { + Score target = (Score) object; + return target.getName(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Score target = (Score) 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.setMultivalued(false); + 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); + //-- initialize element descriptors + + } //-- uk.ac.vamsas.objects.core.ScoreDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Score.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/uk/ac/vamsas/objects/core/Seg.java b/src/uk/ac/vamsas/objects/core/Seg.java new file mode 100644 index 0000000..e6d0d1b --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Seg.java @@ -0,0 +1,331 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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; + +/** + * a region from start to end, with flag for inclusivity of + * terminii + * + * @version $Revision$ $Date$ + */ +public class Seg extends uk.ac.vamsas.client.Vobject +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; + + /** + * when false, a consecutive range like 'start=1, end=2' + * means the region lying after position 1 and before position + * 2 + * + */ + private boolean _inclusive; + + /** + * keeps track of state for field: _inclusive + */ + private boolean _has_inclusive; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Seg() + { + super(); + } //-- uk.ac.vamsas.objects.core.Seg() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method deleteEnd + * + */ + public void deleteEnd() + { + this._has_end= false; + } //-- void deleteEnd() + + /** + * Method deleteInclusive + * + */ + public void deleteInclusive() + { + this._has_inclusive= false; + } //-- void deleteInclusive() + + /** + * Method deleteStart + * + */ + public void deleteStart() + { + this._has_start= false; + } //-- void deleteStart() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Seg) { + + Seg temp = (Seg)obj; + if (this._start != temp._start) + return false; + if (this._has_start != temp._has_start) + return false; + if (this._end != temp._end) + return false; + if (this._has_end != temp._has_end) + return false; + if (this._inclusive != temp._inclusive) + return false; + if (this._has_inclusive != temp._has_inclusive) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * 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 'inclusive'. The field + * 'inclusive' has the following description: when false, a + * consecutive range like 'start=1, end=2' + * means the region lying after position 1 and before position + * 2 + * + * + * @return boolean + * @return the value of field 'inclusive'. + */ + public boolean getInclusive() + { + return this._inclusive; + } //-- boolean getInclusive() + + /** + * Returns the value of field 'start'. + * + * @return int + * @return the value of field 'start'. + */ + public int getStart() + { + return this._start; + } //-- int getStart() + + /** + * Method hasEnd + * + * + * + * @return boolean + */ + public boolean hasEnd() + { + return this._has_end; + } //-- boolean hasEnd() + + /** + * Method hasInclusive + * + * + * + * @return boolean + */ + public boolean hasInclusive() + { + return this._has_inclusive; + } //-- boolean hasInclusive() + + /** + * 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) + + /** + * 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 'inclusive'. The field 'inclusive' + * has the following description: when false, a consecutive + * range like 'start=1, end=2' + * means the region lying after position 1 and before position + * 2 + * + * + * @param inclusive the value of field 'inclusive'. + */ + public void setInclusive(boolean inclusive) + { + this._inclusive = inclusive; + this._has_inclusive = true; + } //-- void setInclusive(boolean) + + /** + * 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 Seg + */ + public static uk.ac.vamsas.objects.core.Seg unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Seg) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Seg.class, reader); + } //-- uk.ac.vamsas.objects.core.Seg 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/uk/ac/vamsas/objects/core/SegDescriptor.java b/src/uk/ac/vamsas/objects/core/SegDescriptor.java new file mode 100644 index 0000000..bb6e76a --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/SegDescriptor.java @@ -0,0 +1,297 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 SegDescriptor. + * + * @version $Revision$ $Date$ + */ +public class SegDescriptor 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 SegDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "seg"; + 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 + + //-- _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 + { + Seg target = (Seg) 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 { + Seg target = (Seg) 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); + desc.setMultivalued(false); + 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 + { + Seg target = (Seg) 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 { + Seg target = (Seg) 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); + desc.setMultivalued(false); + 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); + //-- _inclusive + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_inclusive", "inclusive", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Seg target = (Seg) object; + if(!target.hasInclusive()) + return null; + return (target.getInclusive() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Seg target = (Seg) object; + // ignore null values for non optional primitives + if (value == null) return; + + target.setInclusive( ((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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _inclusive + 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 + + } //-- uk.ac.vamsas.objects.core.SegDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.Seg.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/uk/ac/vamsas/objects/core/Sequence.java b/src/uk/ac/vamsas/objects/core/Sequence.java new file mode 100644 index 0000000..85b546b --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Sequence.java @@ -0,0 +1,387 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:Sequence.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Sequence. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class Sequence extends uk.ac.vamsas.objects.core.SequenceType +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Primary Key for vamsas object referencing + * + */ + private java.lang.String _id; + + /** + * symbol class for sequence + * + */ + private java.lang.String _dictionary; + + /** + * Store a list of database references + * for this sequence record - with optional mapping + * from database sequence to the given sequence record + */ + private java.util.Vector _dbRefList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Sequence() + { + super(); + _dbRefList = new Vector(); + } //-- uk.ac.vamsas.objects.core.Sequence() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addDbRef + * + * + * + * @param vDbRef + */ + public void addDbRef(uk.ac.vamsas.objects.core.DbRef vDbRef) + throws java.lang.IndexOutOfBoundsException + { + _dbRefList.addElement(vDbRef); + } //-- void addDbRef(uk.ac.vamsas.objects.core.DbRef) + + /** + * Method addDbRef + * + * + * + * @param index + * @param vDbRef + */ + public void addDbRef(int index, uk.ac.vamsas.objects.core.DbRef vDbRef) + throws java.lang.IndexOutOfBoundsException + { + _dbRefList.insertElementAt(vDbRef, index); + } //-- void addDbRef(int, uk.ac.vamsas.objects.core.DbRef) + + /** + * Method enumerateDbRef + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateDbRef() + { + return _dbRefList.elements(); + } //-- java.util.Enumeration enumerateDbRef() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Sequence) { + + Sequence temp = (Sequence)obj; + 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._dictionary != null) { + if (temp._dictionary == null) return false; + else if (!(this._dictionary.equals(temp._dictionary))) + return false; + } + else if (temp._dictionary != null) + return false; + if (this._dbRefList != null) { + if (temp._dbRefList == null) return false; + else if (!(this._dbRefList.equals(temp._dbRefList))) + return false; + } + else if (temp._dbRefList != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Method getDbRef + * + * + * + * @param index + * @return DbRef + */ + public uk.ac.vamsas.objects.core.DbRef getDbRef(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _dbRefList.size())) { + throw new IndexOutOfBoundsException("getDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.DbRef) _dbRefList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.DbRef getDbRef(int) + + /** + * Method getDbRef + * + * + * + * @return DbRef + */ + public uk.ac.vamsas.objects.core.DbRef[] getDbRef() + { + int size = _dbRefList.size(); + uk.ac.vamsas.objects.core.DbRef[] mArray = new uk.ac.vamsas.objects.core.DbRef[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.DbRef) _dbRefList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.DbRef[] getDbRef() + + /** + * Method getDbRefCount + * + * + * + * @return int + */ + public int getDbRefCount() + { + return _dbRefList.size(); + } //-- int getDbRefCount() + + /** + * Returns the value of field 'dictionary'. The field + * 'dictionary' has the following description: symbol class for + * sequence + * + * + * @return String + * @return the value of field 'dictionary'. + */ + public java.lang.String getDictionary() + { + return this._dictionary; + } //-- java.lang.String getDictionary() + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @return String + * @return the value of field 'id'. + */ + public java.lang.String getId() + { + return this._id; + } //-- java.lang.String getId() + + /** + * 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 removeAllDbRef + * + */ + public void removeAllDbRef() + { + _dbRefList.removeAllElements(); + } //-- void removeAllDbRef() + + /** + * Method removeDbRef + * + * + * + * @param index + * @return DbRef + */ + public uk.ac.vamsas.objects.core.DbRef removeDbRef(int index) + { + java.lang.Object obj = _dbRefList.elementAt(index); + _dbRefList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.DbRef) obj; + } //-- uk.ac.vamsas.objects.core.DbRef removeDbRef(int) + + /** + * Method setDbRef + * + * + * + * @param index + * @param vDbRef + */ + public void setDbRef(int index, uk.ac.vamsas.objects.core.DbRef vDbRef) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _dbRefList.size())) { + throw new IndexOutOfBoundsException("setDbRef: Index value '"+index+"' not in range [0.."+_dbRefList.size()+ "]"); + } + _dbRefList.setElementAt(vDbRef, index); + } //-- void setDbRef(int, uk.ac.vamsas.objects.core.DbRef) + + /** + * Method setDbRef + * + * + * + * @param dbRefArray + */ + public void setDbRef(uk.ac.vamsas.objects.core.DbRef[] dbRefArray) + { + //-- copy array + _dbRefList.removeAllElements(); + for (int i = 0; i < dbRefArray.length; i++) { + _dbRefList.addElement(dbRefArray[i]); + } + } //-- void setDbRef(uk.ac.vamsas.objects.core.DbRef) + + /** + * Sets the value of field 'dictionary'. The field 'dictionary' + * has the following description: symbol class for sequence + * + * + * @param dictionary the value of field 'dictionary'. + */ + public void setDictionary(java.lang.String dictionary) + { + this._dictionary = dictionary; + } //-- void setDictionary(java.lang.String) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * + * @param id the value of field 'id'. + */ + public void setId(java.lang.String id) + { + this._id = id; + } //-- void setId(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return SequenceType + */ + public static uk.ac.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Sequence) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Sequence.class, reader); + } //-- uk.ac.vamsas.objects.core.SequenceType 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/uk/ac/vamsas/objects/core/SequenceDescriptor.java b/src/uk/ac/vamsas/objects/core/SequenceDescriptor.java new file mode 100644 index 0000000..335df7b --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/SequenceDescriptor.java @@ -0,0 +1,285 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:SequenceDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class SequenceDescriptor extends uk.ac.vamsas.objects.core.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 uk.ac.vamsas.objects.core.SequenceTypeDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "Sequence"; + + //-- 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 + + //-- _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 + { + Sequence target = (Sequence) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Sequence target = (Sequence) 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 + } + desc.setValidator(fieldValidator); + //-- _dictionary + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dictionary", "dictionary", 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 + { + Sequence target = (Sequence) object; + return target.getDictionary(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Sequence target = (Sequence) object; + target.setDictionary( (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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _dictionary + 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 + + //-- _dbRefList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.DbRef.class, "_dbRefList", "dbRef", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Sequence target = (Sequence) object; + return target.getDbRef(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Sequence target = (Sequence) object; + target.addDbRef( (uk.ac.vamsas.objects.core.DbRef) 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.DbRef(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _dbRefList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- uk.ac.vamsas.objects.core.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 uk.ac.vamsas.objects.core.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/uk/ac/vamsas/objects/core/SequenceType.java b/src/uk/ac/vamsas/objects/core/SequenceType.java new file mode 100644 index 0000000..fccd850 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/SequenceType.java @@ -0,0 +1,677 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:SequenceType.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 SequenceType. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class SequenceType extends uk.ac.vamsas.client.Vobject +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 _sequence + */ + private java.lang.String _sequence; + + /** + * Field _name + */ + private java.lang.String _name; + + /** + * Field _description + */ + private java.lang.String _description; + + /** + * additional typed properties + */ + private java.util.Vector _propertyList; + + /** + * Field _mappingList + */ + private java.util.Vector _mappingList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public SequenceType() + { + super(); + _propertyList = new Vector(); + _mappingList = new Vector(); + } //-- uk.ac.vamsas.objects.core.SequenceType() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addMapping + * + * + * + * @param vMapping + */ + public void addMapping(uk.ac.vamsas.objects.core.Mapping vMapping) + throws java.lang.IndexOutOfBoundsException + { + _mappingList.addElement(vMapping); + } //-- void addMapping(uk.ac.vamsas.objects.core.Mapping) + + /** + * Method addMapping + * + * + * + * @param index + * @param vMapping + */ + public void addMapping(int index, uk.ac.vamsas.objects.core.Mapping vMapping) + throws java.lang.IndexOutOfBoundsException + { + _mappingList.insertElementAt(vMapping, index); + } //-- void addMapping(int, uk.ac.vamsas.objects.core.Mapping) + + /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(uk.ac.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, uk.ac.vamsas.objects.core.Property) + + /** + * Method deleteEnd + * + */ + public void deleteEnd() + { + this._has_end= false; + } //-- void deleteEnd() + + /** + * Method deleteStart + * + */ + public void deleteStart() + { + this._has_start= false; + } //-- void deleteStart() + + /** + * Method enumerateMapping + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateMapping() + { + return _mappingList.elements(); + } //-- java.util.Enumeration enumerateMapping() + + /** + * Method enumerateProperty + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateProperty() + { + return _propertyList.elements(); + } //-- java.util.Enumeration enumerateProperty() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof SequenceType) { + + SequenceType temp = (SequenceType)obj; + if (this._start != temp._start) + return false; + if (this._has_start != temp._has_start) + return false; + if (this._end != temp._end) + return false; + if (this._has_end != temp._has_end) + return false; + if (this._sequence != null) { + if (temp._sequence == null) return false; + else if (!(this._sequence.equals(temp._sequence))) + return false; + } + else if (temp._sequence != null) + return false; + if (this._name != null) { + if (temp._name == null) return false; + else if (!(this._name.equals(temp._name))) + return false; + } + else if (temp._name != null) + return false; + if (this._description != null) { + if (temp._description == null) return false; + else if (!(this._description.equals(temp._description))) + return false; + } + else if (temp._description != null) + return false; + if (this._propertyList != null) { + if (temp._propertyList == null) return false; + else if (!(this._propertyList.equals(temp._propertyList))) + return false; + } + 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; + } //-- boolean equals(java.lang.Object) + + /** + * 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() + + /** + * Method getMapping + * + * + * + * @param index + * @return Mapping + */ + public uk.ac.vamsas.objects.core.Mapping getMapping(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _mappingList.size())) { + throw new IndexOutOfBoundsException("getMapping: Index value '"+index+"' not in range [0.."+_mappingList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Mapping) _mappingList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Mapping getMapping(int) + + /** + * Method getMapping + * + * + * + * @return Mapping + */ + public uk.ac.vamsas.objects.core.Mapping[] getMapping() + { + int size = _mappingList.size(); + uk.ac.vamsas.objects.core.Mapping[] mArray = new uk.ac.vamsas.objects.core.Mapping[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Mapping) _mappingList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Mapping[] getMapping() + + /** + * Method getMappingCount + * + * + * + * @return int + */ + public int getMappingCount() + { + return _mappingList.size(); + } //-- int getMappingCount() + + /** + * 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() + + /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public uk.ac.vamsas.objects.core.Property getProperty(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public uk.ac.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + uk.ac.vamsas.objects.core.Property[] mArray = new uk.ac.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Property[] getProperty() + + /** + * Method getPropertyCount + * + * + * + * @return int + */ + public int getPropertyCount() + { + return _propertyList.size(); + } //-- int getPropertyCount() + + /** + * 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() + + /** + * Returns the value of field 'start'. + * + * @return int + * @return the value of field 'start'. + */ + public int getStart() + { + return this._start; + } //-- int getStart() + + /** + * Method hasEnd + * + * + * + * @return boolean + */ + public boolean hasEnd() + { + return this._has_end; + } //-- boolean hasEnd() + + /** + * 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 removeAllMapping + * + */ + public void removeAllMapping() + { + _mappingList.removeAllElements(); + } //-- void removeAllMapping() + + /** + * Method removeAllProperty + * + */ + public void removeAllProperty() + { + _propertyList.removeAllElements(); + } //-- void removeAllProperty() + + /** + * Method removeMapping + * + * + * + * @param index + * @return Mapping + */ + public uk.ac.vamsas.objects.core.Mapping removeMapping(int index) + { + java.lang.Object obj = _mappingList.elementAt(index); + _mappingList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Mapping) obj; + } //-- uk.ac.vamsas.objects.core.Mapping removeMapping(int) + + /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public uk.ac.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Property) obj; + } //-- uk.ac.vamsas.objects.core.Property removeProperty(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) + + /** + * Method setMapping + * + * + * + * @param index + * @param vMapping + */ + public void setMapping(int index, uk.ac.vamsas.objects.core.Mapping vMapping) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _mappingList.size())) { + throw new IndexOutOfBoundsException("setMapping: Index value '"+index+"' not in range [0.."+_mappingList.size()+ "]"); + } + _mappingList.setElementAt(vMapping, index); + } //-- void setMapping(int, uk.ac.vamsas.objects.core.Mapping) + + /** + * Method setMapping + * + * + * + * @param mappingArray + */ + public void setMapping(uk.ac.vamsas.objects.core.Mapping[] mappingArray) + { + //-- copy array + _mappingList.removeAllElements(); + for (int i = 0; i < mappingArray.length; i++) { + _mappingList.addElement(mappingArray[i]); + } + } //-- void setMapping(uk.ac.vamsas.objects.core.Mapping) + + /** + * 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) + + /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + _propertyList.setElementAt(vProperty, index); + } //-- void setProperty(int, uk.ac.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(uk.ac.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(uk.ac.vamsas.objects.core.Property) + + /** + * 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) + + /** + * 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 SequenceType + */ + public static uk.ac.vamsas.objects.core.SequenceType unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.SequenceType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.SequenceType.class, reader); + } //-- uk.ac.vamsas.objects.core.SequenceType 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/uk/ac/vamsas/objects/core/SequenceTypeDescriptor.java b/src/uk/ac/vamsas/objects/core/SequenceTypeDescriptor.java new file mode 100644 index 0000000..bac53b2 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/SequenceTypeDescriptor.java @@ -0,0 +1,446 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:SequenceTypeDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +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 = "http://www.vamsas.org"; + xmlName = "SequenceType"; + + //-- 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 + + //-- _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 + { + SequenceType target = (SequenceType) 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 { + SequenceType target = (SequenceType) 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); + desc.setMultivalued(false); + 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 + { + SequenceType target = (SequenceType) 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 { + SequenceType target = (SequenceType) 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); + desc.setMultivalued(false); + 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); + //-- 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("http://www.vamsas.org"); + 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("http://www.vamsas.org"); + 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); + //-- _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 + { + 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); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(false); + 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); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.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 + { + SequenceType target = (SequenceType) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + SequenceType target = (SequenceType) object; + target.addProperty( (uk.ac.vamsas.objects.core.Property) 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.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.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); + //-- _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 java.lang.Object newInstance( java.lang.Object parent ) { + return new uk.ac.vamsas.objects.core.Mapping(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _mappingList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- uk.ac.vamsas.objects.core.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 uk.ac.vamsas.objects.core.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/uk/ac/vamsas/objects/core/Tree.java b/src/uk/ac/vamsas/objects/core/Tree.java new file mode 100644 index 0000000..5505ffe --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/Tree.java @@ -0,0 +1,600 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:Tree.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 Tree. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class Tree extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Primary Key for vamsas object referencing + */ + private java.lang.String _id; + + /** + * Field _modifiable + */ + private java.lang.String _modifiable; + + /** + * Field _title + */ + private java.lang.String _title; + + /** + * Field _newickList + */ + private java.util.Vector _newickList; + + /** + * Field _propertyList + */ + private java.util.Vector _propertyList; + + /** + * Field _provenance + */ + private uk.ac.vamsas.objects.core.Provenance _provenance; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Tree() + { + super(); + _newickList = new Vector(); + _propertyList = new Vector(); + } //-- uk.ac.vamsas.objects.core.Tree() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addNewick + * + * + * + * @param vNewick + */ + public void addNewick(uk.ac.vamsas.objects.core.Newick vNewick) + throws java.lang.IndexOutOfBoundsException + { + _newickList.addElement(vNewick); + } //-- void addNewick(uk.ac.vamsas.objects.core.Newick) + + /** + * Method addNewick + * + * + * + * @param index + * @param vNewick + */ + public void addNewick(int index, uk.ac.vamsas.objects.core.Newick vNewick) + throws java.lang.IndexOutOfBoundsException + { + _newickList.insertElementAt(vNewick, index); + } //-- void addNewick(int, uk.ac.vamsas.objects.core.Newick) + + /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(uk.ac.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, uk.ac.vamsas.objects.core.Property) + + /** + * Method enumerateNewick + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateNewick() + { + return _newickList.elements(); + } //-- java.util.Enumeration enumerateNewick() + + /** + * Method enumerateProperty + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateProperty() + { + return _propertyList.elements(); + } //-- java.util.Enumeration enumerateProperty() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof Tree) { + + Tree temp = (Tree)obj; + 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._modifiable != null) { + if (temp._modifiable == null) return false; + else if (!(this._modifiable.equals(temp._modifiable))) + return false; + } + else if (temp._modifiable != null) + return false; + if (this._title != null) { + if (temp._title == null) return false; + else if (!(this._title.equals(temp._title))) + return false; + } + else if (temp._title != null) + return false; + if (this._newickList != null) { + if (temp._newickList == null) return false; + else if (!(this._newickList.equals(temp._newickList))) + return false; + } + else if (temp._newickList != null) + return false; + if (this._propertyList != null) { + if (temp._propertyList == null) return false; + else if (!(this._propertyList.equals(temp._propertyList))) + return false; + } + else if (temp._propertyList != 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; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * @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 'modifiable'. + * + * @return String + * @return the value of field 'modifiable'. + */ + public java.lang.String getModifiable() + { + return this._modifiable; + } //-- java.lang.String getModifiable() + + /** + * Method getNewick + * + * + * + * @param index + * @return Newick + */ + public uk.ac.vamsas.objects.core.Newick getNewick(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _newickList.size())) { + throw new IndexOutOfBoundsException("getNewick: Index value '"+index+"' not in range [0.."+_newickList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Newick) _newickList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Newick getNewick(int) + + /** + * Method getNewick + * + * + * + * @return Newick + */ + public uk.ac.vamsas.objects.core.Newick[] getNewick() + { + int size = _newickList.size(); + uk.ac.vamsas.objects.core.Newick[] mArray = new uk.ac.vamsas.objects.core.Newick[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Newick) _newickList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Newick[] getNewick() + + /** + * Method getNewickCount + * + * + * + * @return int + */ + public int getNewickCount() + { + return _newickList.size(); + } //-- int getNewickCount() + + /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public uk.ac.vamsas.objects.core.Property getProperty(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("getProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public uk.ac.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + uk.ac.vamsas.objects.core.Property[] mArray = new uk.ac.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Property[] getProperty() + + /** + * Method getPropertyCount + * + * + * + * @return int + */ + public int getPropertyCount() + { + return _propertyList.size(); + } //-- int getPropertyCount() + + /** + * Returns the value of field 'provenance'. + * + * @return Provenance + * @return the value of field 'provenance'. + */ + public uk.ac.vamsas.objects.core.Provenance getProvenance() + { + return this._provenance; + } //-- uk.ac.vamsas.objects.core.Provenance getProvenance() + + /** + * 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() + + /** + * 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 removeAllNewick + * + */ + public void removeAllNewick() + { + _newickList.removeAllElements(); + } //-- void removeAllNewick() + + /** + * Method removeAllProperty + * + */ + public void removeAllProperty() + { + _propertyList.removeAllElements(); + } //-- void removeAllProperty() + + /** + * Method removeNewick + * + * + * + * @param index + * @return Newick + */ + public uk.ac.vamsas.objects.core.Newick removeNewick(int index) + { + java.lang.Object obj = _newickList.elementAt(index); + _newickList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Newick) obj; + } //-- uk.ac.vamsas.objects.core.Newick removeNewick(int) + + /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public uk.ac.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Property) obj; + } //-- uk.ac.vamsas.objects.core.Property removeProperty(int) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * @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 'modifiable'. + * + * @param modifiable the value of field 'modifiable'. + */ + public void setModifiable(java.lang.String modifiable) + { + this._modifiable = modifiable; + } //-- void setModifiable(java.lang.String) + + /** + * Method setNewick + * + * + * + * @param index + * @param vNewick + */ + public void setNewick(int index, uk.ac.vamsas.objects.core.Newick vNewick) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _newickList.size())) { + throw new IndexOutOfBoundsException("setNewick: Index value '"+index+"' not in range [0.."+_newickList.size()+ "]"); + } + _newickList.setElementAt(vNewick, index); + } //-- void setNewick(int, uk.ac.vamsas.objects.core.Newick) + + /** + * Method setNewick + * + * + * + * @param newickArray + */ + public void setNewick(uk.ac.vamsas.objects.core.Newick[] newickArray) + { + //-- copy array + _newickList.removeAllElements(); + for (int i = 0; i < newickArray.length; i++) { + _newickList.addElement(newickArray[i]); + } + } //-- void setNewick(uk.ac.vamsas.objects.core.Newick) + + /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, uk.ac.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _propertyList.size())) { + throw new IndexOutOfBoundsException("setProperty: Index value '"+index+"' not in range [0.."+_propertyList.size()+ "]"); + } + _propertyList.setElementAt(vProperty, index); + } //-- void setProperty(int, uk.ac.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(uk.ac.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(uk.ac.vamsas.objects.core.Property) + + /** + * Sets the value of field 'provenance'. + * + * @param provenance the value of field 'provenance'. + */ + public void setProvenance(uk.ac.vamsas.objects.core.Provenance provenance) + { + this._provenance = provenance; + } //-- void setProvenance(uk.ac.vamsas.objects.core.Provenance) + + /** + * 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) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return Tree + */ + public static uk.ac.vamsas.objects.core.Tree unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.Tree) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Tree.class, reader); + } //-- uk.ac.vamsas.objects.core.Tree 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/uk/ac/vamsas/objects/core/TreeDescriptor.java b/src/uk/ac/vamsas/objects/core/TreeDescriptor.java new file mode 100644 index 0000000..a4df62f --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/TreeDescriptor.java @@ -0,0 +1,390 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:TreeDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +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 = "http://www.vamsas.org"; + xmlName = "Tree"; + + //-- 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 + + //-- _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 + { + Tree target = (Tree) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) 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 + } + desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", 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.getModifiable(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + target.setModifiable( (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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _modifiable + 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 + + //-- _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("http://www.vamsas.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); + //-- _newickList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Newick.class, "_newickList", "newick", org.exolab.castor.xml.NodeType.Element); + 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.addNewick( (uk.ac.vamsas.objects.core.Newick) 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.Newick(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _newickList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.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 + { + Tree target = (Tree) object; + return target.getProperty(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + target.addProperty( (uk.ac.vamsas.objects.core.Property) 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.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.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); + //-- _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 + { + Tree target = (Tree) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) 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.org"); + 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); + } //-- uk.ac.vamsas.objects.core.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 uk.ac.vamsas.objects.core.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/uk/ac/vamsas/objects/core/User.java b/src/uk/ac/vamsas/objects/core/User.java new file mode 100644 index 0000000..75d2044 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/User.java @@ -0,0 +1,212 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:User.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 User. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class User extends uk.ac.vamsas.objects.core.AppData +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _fullname + */ + private java.lang.String _fullname; + + /** + * Field _organization + */ + private java.lang.String _organization; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public User() + { + super(); + } //-- uk.ac.vamsas.objects.core.User() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof User) { + + User temp = (User)obj; + if (this._fullname != null) { + if (temp._fullname == null) return false; + else if (!(this._fullname.equals(temp._fullname))) + return false; + } + else if (temp._fullname != null) + return false; + if (this._organization != null) { + if (temp._organization == null) return false; + else if (!(this._organization.equals(temp._organization))) + return false; + } + else if (temp._organization != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'fullname'. + * + * @return String + * @return the value of field 'fullname'. + */ + public java.lang.String getFullname() + { + return this._fullname; + } //-- java.lang.String getFullname() + + /** + * Returns the value of field 'organization'. + * + * @return String + * @return the value of field 'organization'. + */ + public java.lang.String getOrganization() + { + return this._organization; + } //-- java.lang.String getOrganization() + + /** + * 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 'fullname'. + * + * @param fullname the value of field 'fullname'. + */ + public void setFullname(java.lang.String fullname) + { + this._fullname = fullname; + } //-- void setFullname(java.lang.String) + + /** + * Sets the value of field 'organization'. + * + * @param organization the value of field 'organization'. + */ + public void setOrganization(java.lang.String organization) + { + this._organization = organization; + } //-- void setOrganization(java.lang.String) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return AppData + */ + public static uk.ac.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.User) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.User.class, reader); + } //-- uk.ac.vamsas.objects.core.AppData 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/uk/ac/vamsas/objects/core/UserDescriptor.java b/src/uk/ac/vamsas/objects/core/UserDescriptor.java new file mode 100644 index 0000000..1666472 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/UserDescriptor.java @@ -0,0 +1,252 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:UserDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 UserDescriptor. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class UserDescriptor extends uk.ac.vamsas.objects.core.AppDataDescriptor { + + + //--------------------------/ + //- 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 UserDescriptor() + { + super(); + setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.AppDataDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "User"; + 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 + + //-- _fullname + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_fullname", "fullname", 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 + { + User target = (User) object; + return target.getFullname(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + User target = (User) object; + target.setFullname( (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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _fullname + 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); + //-- _organization + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_organization", "organization", 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 + { + User target = (User) object; + return target.getOrganization(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + User target = (User) object; + target.setOrganization( (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); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _organization + 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 + + } //-- uk.ac.vamsas.objects.core.UserDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.User.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/uk/ac/vamsas/objects/core/VAMSAS.java b/src/uk/ac/vamsas/objects/core/VAMSAS.java new file mode 100644 index 0000000..2c8edc6 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/VAMSAS.java @@ -0,0 +1,535 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:VAMSAS.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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; + +/** + * contains unassociated trees and a number of analysis sets + * + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class VAMSAS extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Primary Key for vamsas object referencing + */ + private java.lang.String _id; + + /** + * Field _modifiable + */ + private java.lang.String _modifiable; + + /** + * Field _treeList + */ + private java.util.Vector _treeList; + + /** + * Field _dataSetList + */ + private java.util.Vector _dataSetList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public VAMSAS() + { + super(); + _treeList = new Vector(); + _dataSetList = new Vector(); + } //-- uk.ac.vamsas.objects.core.VAMSAS() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addDataSet + * + * + * + * @param vDataSet + */ + public void addDataSet(uk.ac.vamsas.objects.core.DataSet vDataSet) + throws java.lang.IndexOutOfBoundsException + { + _dataSetList.addElement(vDataSet); + } //-- void addDataSet(uk.ac.vamsas.objects.core.DataSet) + + /** + * Method addDataSet + * + * + * + * @param index + * @param vDataSet + */ + public void addDataSet(int index, uk.ac.vamsas.objects.core.DataSet vDataSet) + throws java.lang.IndexOutOfBoundsException + { + _dataSetList.insertElementAt(vDataSet, index); + } //-- void addDataSet(int, uk.ac.vamsas.objects.core.DataSet) + + /** + * Method addTree + * + * + * + * @param vTree + */ + public void addTree(uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + _treeList.addElement(vTree); + } //-- void addTree(uk.ac.vamsas.objects.core.Tree) + + /** + * Method addTree + * + * + * + * @param index + * @param vTree + */ + public void addTree(int index, uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + _treeList.insertElementAt(vTree, index); + } //-- void addTree(int, uk.ac.vamsas.objects.core.Tree) + + /** + * Method enumerateDataSet + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateDataSet() + { + return _dataSetList.elements(); + } //-- java.util.Enumeration enumerateDataSet() + + /** + * Method enumerateTree + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateTree() + { + return _treeList.elements(); + } //-- java.util.Enumeration enumerateTree() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof VAMSAS) { + + VAMSAS temp = (VAMSAS)obj; + 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._modifiable != null) { + if (temp._modifiable == null) return false; + else if (!(this._modifiable.equals(temp._modifiable))) + return false; + } + else if (temp._modifiable != null) + return false; + if (this._treeList != null) { + if (temp._treeList == null) return false; + else if (!(this._treeList.equals(temp._treeList))) + return false; + } + else if (temp._treeList != null) + return false; + if (this._dataSetList != null) { + if (temp._dataSetList == null) return false; + else if (!(this._dataSetList.equals(temp._dataSetList))) + return false; + } + else if (temp._dataSetList != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Method getDataSet + * + * + * + * @param index + * @return DataSet + */ + public uk.ac.vamsas.objects.core.DataSet getDataSet(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _dataSetList.size())) { + throw new IndexOutOfBoundsException("getDataSet: Index value '"+index+"' not in range [0.."+_dataSetList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.DataSet) _dataSetList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.DataSet getDataSet(int) + + /** + * Method getDataSet + * + * + * + * @return DataSet + */ + public uk.ac.vamsas.objects.core.DataSet[] getDataSet() + { + int size = _dataSetList.size(); + uk.ac.vamsas.objects.core.DataSet[] mArray = new uk.ac.vamsas.objects.core.DataSet[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.DataSet) _dataSetList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.DataSet[] getDataSet() + + /** + * Method getDataSetCount + * + * + * + * @return int + */ + public int getDataSetCount() + { + return _dataSetList.size(); + } //-- int getDataSetCount() + + /** + * Returns the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * @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 'modifiable'. + * + * @return String + * @return the value of field 'modifiable'. + */ + public java.lang.String getModifiable() + { + return this._modifiable; + } //-- java.lang.String getModifiable() + + /** + * Method getTree + * + * + * + * @param index + * @return Tree + */ + public uk.ac.vamsas.objects.core.Tree getTree(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _treeList.size())) { + throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + } + + return (uk.ac.vamsas.objects.core.Tree) _treeList.elementAt(index); + } //-- uk.ac.vamsas.objects.core.Tree getTree(int) + + /** + * Method getTree + * + * + * + * @return Tree + */ + public uk.ac.vamsas.objects.core.Tree[] getTree() + { + int size = _treeList.size(); + uk.ac.vamsas.objects.core.Tree[] mArray = new uk.ac.vamsas.objects.core.Tree[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (uk.ac.vamsas.objects.core.Tree) _treeList.elementAt(index); + } + return mArray; + } //-- uk.ac.vamsas.objects.core.Tree[] 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 removeAllDataSet + * + */ + public void removeAllDataSet() + { + _dataSetList.removeAllElements(); + } //-- void removeAllDataSet() + + /** + * Method removeAllTree + * + */ + public void removeAllTree() + { + _treeList.removeAllElements(); + } //-- void removeAllTree() + + /** + * Method removeDataSet + * + * + * + * @param index + * @return DataSet + */ + public uk.ac.vamsas.objects.core.DataSet removeDataSet(int index) + { + java.lang.Object obj = _dataSetList.elementAt(index); + _dataSetList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.DataSet) obj; + } //-- uk.ac.vamsas.objects.core.DataSet removeDataSet(int) + + /** + * Method removeTree + * + * + * + * @param index + * @return Tree + */ + public uk.ac.vamsas.objects.core.Tree removeTree(int index) + { + java.lang.Object obj = _treeList.elementAt(index); + _treeList.removeElementAt(index); + return (uk.ac.vamsas.objects.core.Tree) obj; + } //-- uk.ac.vamsas.objects.core.Tree removeTree(int) + + /** + * Method setDataSet + * + * + * + * @param index + * @param vDataSet + */ + public void setDataSet(int index, uk.ac.vamsas.objects.core.DataSet vDataSet) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _dataSetList.size())) { + throw new IndexOutOfBoundsException("setDataSet: Index value '"+index+"' not in range [0.."+_dataSetList.size()+ "]"); + } + _dataSetList.setElementAt(vDataSet, index); + } //-- void setDataSet(int, uk.ac.vamsas.objects.core.DataSet) + + /** + * Method setDataSet + * + * + * + * @param dataSetArray + */ + public void setDataSet(uk.ac.vamsas.objects.core.DataSet[] dataSetArray) + { + //-- copy array + _dataSetList.removeAllElements(); + for (int i = 0; i < dataSetArray.length; i++) { + _dataSetList.addElement(dataSetArray[i]); + } + } //-- void setDataSet(uk.ac.vamsas.objects.core.DataSet) + + /** + * Sets the value of field 'id'. The field 'id' has the + * following description: Primary Key for vamsas object + * referencing + * + * @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 'modifiable'. + * + * @param modifiable the value of field 'modifiable'. + */ + public void setModifiable(java.lang.String modifiable) + { + this._modifiable = modifiable; + } //-- void setModifiable(java.lang.String) + + /** + * Method setTree + * + * + * + * @param index + * @param vTree + */ + public void setTree(int index, uk.ac.vamsas.objects.core.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _treeList.size())) { + throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]"); + } + _treeList.setElementAt(vTree, index); + } //-- void setTree(int, uk.ac.vamsas.objects.core.Tree) + + /** + * Method setTree + * + * + * + * @param treeArray + */ + public void setTree(uk.ac.vamsas.objects.core.Tree[] treeArray) + { + //-- copy array + _treeList.removeAllElements(); + for (int i = 0; i < treeArray.length; i++) { + _treeList.addElement(treeArray[i]); + } + } //-- void setTree(uk.ac.vamsas.objects.core.Tree) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return VAMSAS + */ + public static uk.ac.vamsas.objects.core.VAMSAS unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.VAMSAS) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.VAMSAS.class, reader); + } //-- uk.ac.vamsas.objects.core.VAMSAS 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/uk/ac/vamsas/objects/core/VAMSASDescriptor.java b/src/uk/ac/vamsas/objects/core/VAMSASDescriptor.java new file mode 100644 index 0000000..6569aed --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/VAMSASDescriptor.java @@ -0,0 +1,315 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:VAMSASDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +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 = "http://www.vamsas.org"; + xmlName = "VAMSAS"; + + //-- 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 + + //-- _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 + { + VAMSAS target = (VAMSAS) object; + return target.getId(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VAMSAS target = (VAMSAS) 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 + } + desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_modifiable", "modifiable", 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 + { + VAMSAS target = (VAMSAS) object; + return target.getModifiable(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VAMSAS target = (VAMSAS) object; + target.setModifiable( (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.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _modifiable + 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 + + //-- _treeList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.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 + { + 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( (uk.ac.vamsas.objects.core.Tree) 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.Tree(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.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); + //-- _dataSetList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.DataSet.class, "_dataSetList", "DataSet", 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.getDataSet(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VAMSAS target = (VAMSAS) object; + target.addDataSet( (uk.ac.vamsas.objects.core.DataSet) 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.DataSet(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _dataSetList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- uk.ac.vamsas.objects.core.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 uk.ac.vamsas.objects.core.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/uk/ac/vamsas/objects/core/VamsasDocument.java b/src/uk/ac/vamsas/objects/core/VamsasDocument.java new file mode 100644 index 0000000..961934b --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/VamsasDocument.java @@ -0,0 +1,725 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:VamsasDocument.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 VamsasDocument. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class VamsasDocument extends uk.ac.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Vamsas Document Version Number + */ + private java.lang.String _version; + + /** + * Field _lockFile + */ + private uk.ac.vamsas.objects.core.LockFile _lockFile; + + /** + * Field _provenance + */ + private Provenance _provenance; + + /** + * contains unassociated trees and a number of analysis sets + * + */ + private java.util.Vector _VAMSASList; + + /** + * Field _applicationDataList + */ + private java.util.Vector _applicationDataList; + + /** + * Field _attachmentList + */ + private java.util.Vector _attachmentList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public VamsasDocument() + { + super(); + _VAMSASList = new Vector(); + _applicationDataList = new Vector(); + _attachmentList = new Vector(); + } //-- uk.ac.vamsas.objects.core.VamsasDocument() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addApplicationData + * + * + * + * @param vApplicationData + */ + public void addApplicationData(ApplicationData vApplicationData) + throws java.lang.IndexOutOfBoundsException + { + _applicationDataList.addElement(vApplicationData); + } //-- void addApplicationData(ApplicationData) + + /** + * Method addApplicationData + * + * + * + * @param index + * @param vApplicationData + */ + public void addApplicationData(int index, ApplicationData vApplicationData) + throws java.lang.IndexOutOfBoundsException + { + _applicationDataList.insertElementAt(vApplicationData, index); + } //-- void addApplicationData(int, ApplicationData) + + /** + * Method addAttachment + * + * + * + * @param vAttachment + */ + public void addAttachment(Attachment vAttachment) + throws java.lang.IndexOutOfBoundsException + { + _attachmentList.addElement(vAttachment); + } //-- void addAttachment(Attachment) + + /** + * Method addAttachment + * + * + * + * @param index + * @param vAttachment + */ + public void addAttachment(int index, Attachment vAttachment) + throws java.lang.IndexOutOfBoundsException + { + _attachmentList.insertElementAt(vAttachment, index); + } //-- void addAttachment(int, Attachment) + + /** + * Method addVAMSAS + * + * + * + * @param vVAMSAS + */ + public void addVAMSAS(VAMSAS vVAMSAS) + throws java.lang.IndexOutOfBoundsException + { + _VAMSASList.addElement(vVAMSAS); + } //-- void addVAMSAS(VAMSAS) + + /** + * Method addVAMSAS + * + * + * + * @param index + * @param vVAMSAS + */ + public void addVAMSAS(int index, VAMSAS vVAMSAS) + throws java.lang.IndexOutOfBoundsException + { + _VAMSASList.insertElementAt(vVAMSAS, index); + } //-- void addVAMSAS(int, VAMSAS) + + /** + * Method enumerateApplicationData + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateApplicationData() + { + return _applicationDataList.elements(); + } //-- java.util.Enumeration enumerateApplicationData() + + /** + * Method enumerateAttachment + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAttachment() + { + return _attachmentList.elements(); + } //-- java.util.Enumeration enumerateAttachment() + + /** + * Method enumerateVAMSAS + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateVAMSAS() + { + return _VAMSASList.elements(); + } //-- java.util.Enumeration enumerateVAMSAS() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof VamsasDocument) { + + VamsasDocument temp = (VamsasDocument)obj; + if (this._version != null) { + if (temp._version == null) return false; + else if (!(this._version.equals(temp._version))) + return false; + } + else if (temp._version != null) + return false; + if (this._lockFile != null) { + if (temp._lockFile == null) return false; + else if (!(this._lockFile.equals(temp._lockFile))) + return false; + } + else if (temp._lockFile != 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; + if (this._VAMSASList != null) { + if (temp._VAMSASList == null) return false; + else if (!(this._VAMSASList.equals(temp._VAMSASList))) + return false; + } + else if (temp._VAMSASList != null) + return false; + if (this._applicationDataList != null) { + if (temp._applicationDataList == null) return false; + else if (!(this._applicationDataList.equals(temp._applicationDataList))) + return false; + } + else if (temp._applicationDataList != null) + return false; + if (this._attachmentList != null) { + if (temp._attachmentList == null) return false; + else if (!(this._attachmentList.equals(temp._attachmentList))) + return false; + } + else if (temp._attachmentList != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Method getApplicationData + * + * + * + * @param index + * @return ApplicationData + */ + public ApplicationData getApplicationData(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _applicationDataList.size())) { + throw new IndexOutOfBoundsException("getApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]"); + } + + return (ApplicationData) _applicationDataList.elementAt(index); + } //-- ApplicationData getApplicationData(int) + + /** + * Method getApplicationData + * + * + * + * @return ApplicationData + */ + public ApplicationData[] getApplicationData() + { + int size = _applicationDataList.size(); + ApplicationData[] mArray = new ApplicationData[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (ApplicationData) _applicationDataList.elementAt(index); + } + return mArray; + } //-- ApplicationData[] getApplicationData() + + /** + * Method getApplicationDataCount + * + * + * + * @return int + */ + public int getApplicationDataCount() + { + return _applicationDataList.size(); + } //-- int getApplicationDataCount() + + /** + * Method getAttachment + * + * + * + * @param index + * @return Attachment + */ + public Attachment getAttachment(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _attachmentList.size())) { + throw new IndexOutOfBoundsException("getAttachment: Index value '"+index+"' not in range [0.."+_attachmentList.size()+ "]"); + } + + return (Attachment) _attachmentList.elementAt(index); + } //-- Attachment getAttachment(int) + + /** + * Method getAttachment + * + * + * + * @return Attachment + */ + public Attachment[] getAttachment() + { + int size = _attachmentList.size(); + Attachment[] mArray = new Attachment[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (Attachment) _attachmentList.elementAt(index); + } + return mArray; + } //-- Attachment[] getAttachment() + + /** + * Method getAttachmentCount + * + * + * + * @return int + */ + public int getAttachmentCount() + { + return _attachmentList.size(); + } //-- int getAttachmentCount() + + /** + * Returns the value of field 'lockFile'. + * + * @return LockFile + * @return the value of field 'lockFile'. + */ + public uk.ac.vamsas.objects.core.LockFile getLockFile() + { + return this._lockFile; + } //-- uk.ac.vamsas.objects.core.LockFile getLockFile() + + /** + * Returns the value of field 'provenance'. + * + * @return Provenance + * @return the value of field 'provenance'. + */ + public Provenance getProvenance() + { + return this._provenance; + } //-- Provenance getProvenance() + + /** + * Method getVAMSAS + * + * + * + * @param index + * @return VAMSAS + */ + public VAMSAS getVAMSAS(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _VAMSASList.size())) { + throw new IndexOutOfBoundsException("getVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]"); + } + + return (VAMSAS) _VAMSASList.elementAt(index); + } //-- VAMSAS getVAMSAS(int) + + /** + * Method getVAMSAS + * + * + * + * @return VAMSAS + */ + public VAMSAS[] getVAMSAS() + { + int size = _VAMSASList.size(); + VAMSAS[] mArray = new VAMSAS[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (VAMSAS) _VAMSASList.elementAt(index); + } + return mArray; + } //-- VAMSAS[] getVAMSAS() + + /** + * Method getVAMSASCount + * + * + * + * @return int + */ + public int getVAMSASCount() + { + return _VAMSASList.size(); + } //-- int getVAMSASCount() + + /** + * Returns the value of field 'version'. The field 'version' + * has the following description: Vamsas Document Version + * Number + * + * @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) + + /** + * Method removeAllApplicationData + * + */ + public void removeAllApplicationData() + { + _applicationDataList.removeAllElements(); + } //-- void removeAllApplicationData() + + /** + * Method removeAllAttachment + * + */ + public void removeAllAttachment() + { + _attachmentList.removeAllElements(); + } //-- void removeAllAttachment() + + /** + * Method removeAllVAMSAS + * + */ + public void removeAllVAMSAS() + { + _VAMSASList.removeAllElements(); + } //-- void removeAllVAMSAS() + + /** + * Method removeApplicationData + * + * + * + * @param index + * @return ApplicationData + */ + public ApplicationData removeApplicationData(int index) + { + java.lang.Object obj = _applicationDataList.elementAt(index); + _applicationDataList.removeElementAt(index); + return (ApplicationData) obj; + } //-- ApplicationData removeApplicationData(int) + + /** + * Method removeAttachment + * + * + * + * @param index + * @return Attachment + */ + public Attachment removeAttachment(int index) + { + java.lang.Object obj = _attachmentList.elementAt(index); + _attachmentList.removeElementAt(index); + return (Attachment) obj; + } //-- Attachment removeAttachment(int) + + /** + * Method removeVAMSAS + * + * + * + * @param index + * @return VAMSAS + */ + public VAMSAS removeVAMSAS(int index) + { + java.lang.Object obj = _VAMSASList.elementAt(index); + _VAMSASList.removeElementAt(index); + return (VAMSAS) obj; + } //-- VAMSAS removeVAMSAS(int) + + /** + * Method setApplicationData + * + * + * + * @param index + * @param vApplicationData + */ + public void setApplicationData(int index, ApplicationData vApplicationData) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _applicationDataList.size())) { + throw new IndexOutOfBoundsException("setApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]"); + } + _applicationDataList.setElementAt(vApplicationData, index); + } //-- void setApplicationData(int, ApplicationData) + + /** + * Method setApplicationData + * + * + * + * @param applicationDataArray + */ + public void setApplicationData(ApplicationData[] applicationDataArray) + { + //-- copy array + _applicationDataList.removeAllElements(); + for (int i = 0; i < applicationDataArray.length; i++) { + _applicationDataList.addElement(applicationDataArray[i]); + } + } //-- void setApplicationData(ApplicationData) + + /** + * Method setAttachment + * + * + * + * @param index + * @param vAttachment + */ + public void setAttachment(int index, Attachment vAttachment) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _attachmentList.size())) { + throw new IndexOutOfBoundsException("setAttachment: Index value '"+index+"' not in range [0.."+_attachmentList.size()+ "]"); + } + _attachmentList.setElementAt(vAttachment, index); + } //-- void setAttachment(int, Attachment) + + /** + * Method setAttachment + * + * + * + * @param attachmentArray + */ + public void setAttachment(Attachment[] attachmentArray) + { + //-- copy array + _attachmentList.removeAllElements(); + for (int i = 0; i < attachmentArray.length; i++) { + _attachmentList.addElement(attachmentArray[i]); + } + } //-- void setAttachment(Attachment) + + /** + * Sets the value of field 'lockFile'. + * + * @param lockFile the value of field 'lockFile'. + */ + public void setLockFile(uk.ac.vamsas.objects.core.LockFile lockFile) + { + this._lockFile = lockFile; + } //-- void setLockFile(uk.ac.vamsas.objects.core.LockFile) + + /** + * Sets the value of field 'provenance'. + * + * @param provenance the value of field 'provenance'. + */ + public void setProvenance(Provenance provenance) + { + this._provenance = provenance; + } //-- void setProvenance(Provenance) + + /** + * Method setVAMSAS + * + * + * + * @param index + * @param vVAMSAS + */ + public void setVAMSAS(int index, VAMSAS vVAMSAS) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _VAMSASList.size())) { + throw new IndexOutOfBoundsException("setVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]"); + } + _VAMSASList.setElementAt(vVAMSAS, index); + } //-- void setVAMSAS(int, VAMSAS) + + /** + * Method setVAMSAS + * + * + * + * @param VAMSASArray + */ + public void setVAMSAS(VAMSAS[] VAMSASArray) + { + //-- copy array + _VAMSASList.removeAllElements(); + for (int i = 0; i < VAMSASArray.length; i++) { + _VAMSASList.addElement(VAMSASArray[i]); + } + } //-- void setVAMSAS(VAMSAS) + + /** + * Sets the value of field 'version'. The field 'version' has + * the following description: Vamsas Document Version Number + * + * @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 VamsasDocument + */ + public static uk.ac.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (uk.ac.vamsas.objects.core.VamsasDocument) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.VamsasDocument.class, reader); + } //-- uk.ac.vamsas.objects.core.VamsasDocument 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/uk/ac/vamsas/objects/core/VamsasDocumentDescriptor.java b/src/uk/ac/vamsas/objects/core/VamsasDocumentDescriptor.java new file mode 100644 index 0000000..7c28d01 --- /dev/null +++ b/src/uk/ac/vamsas/objects/core/VamsasDocumentDescriptor.java @@ -0,0 +1,388 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id:VamsasDocumentDescriptor.java 264 2006-12-14 17:42:54Z JimP $ + */ + +package uk.ac.vamsas.objects.core; + + //---------------------------------/ + //- 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 VamsasDocumentDescriptor. + * + * @version $Revision:264 $ $Date:2006-12-14 17:42:54 +0000 (Thu, 14 Dec 2006) $ + */ +public class VamsasDocumentDescriptor 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 VamsasDocumentDescriptor() + { + super(); + nsURI = "http://www.vamsas.ac.uk/vamsasDocument"; + xmlName = "VamsasDocument"; + + //-- 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 + + //-- initialize element descriptors + + //-- _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 + { + VamsasDocument target = (VamsasDocument) object; + return target.getVersion(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VamsasDocument target = (VamsasDocument) 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("http://www.vamsas.ac.uk/vamsasDocument"); + 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); + //-- _lockFile + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.LockFile.class, "_lockFile", "LockFile", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VamsasDocument target = (VamsasDocument) object; + return target.getLockFile(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VamsasDocument target = (VamsasDocument) object; + target.setLockFile( (uk.ac.vamsas.objects.core.LockFile) 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.LockFile(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.ac.uk/vamsasDocument"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _lockFile + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _provenance + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(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 + { + VamsasDocument target = (VamsasDocument) object; + return target.getProvenance(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VamsasDocument target = (VamsasDocument) object; + target.setProvenance( (Provenance) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new Provenance(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _provenance + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _VAMSASList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(VAMSAS.class, "_VAMSASList", "VAMSAS", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VamsasDocument target = (VamsasDocument) object; + return target.getVAMSAS(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VamsasDocument target = (VamsasDocument) object; + target.addVAMSAS( (VAMSAS) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new VAMSAS(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _VAMSASList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _applicationDataList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(ApplicationData.class, "_applicationDataList", "ApplicationData", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VamsasDocument target = (VamsasDocument) object; + return target.getApplicationData(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VamsasDocument target = (VamsasDocument) object; + target.addApplicationData( (ApplicationData) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new ApplicationData(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _applicationDataList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _attachmentList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(Attachment.class, "_attachmentList", "Attachment", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VamsasDocument target = (VamsasDocument) object; + return target.getAttachment(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VamsasDocument target = (VamsasDocument) object; + target.addAttachment( (Attachment) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new Attachment(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _attachmentList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- uk.ac.vamsas.objects.core.VamsasDocumentDescriptor() + + + //-----------/ + //- 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 uk.ac.vamsas.objects.core.VamsasDocument.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() + +}