From: jprocter Date: Mon, 22 May 2006 15:59:40 +0000 (+0000) Subject: autogenerated java classes for current schema X-Git-Tag: Release_0.2~297 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=127eed38a79f4e1b56457a3cd5c5de12c9c7d4a2;p=vamsas.git autogenerated java classes for current schema git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@223 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/org/vamsas/objects/core/Alignment.java b/src/org/vamsas/objects/core/Alignment.java index 7c6adc5..ef58ddc 100644 --- a/src/org/vamsas/objects/core/Alignment.java +++ b/src/org/vamsas/objects/core/Alignment.java @@ -53,14 +53,32 @@ implements java.io.Serializable private boolean _has_aligned; /** - * Field _id + * Primary Key for vamsas object + * referencing + * */ private java.lang.String _id; /** - * Field _alignmentAnnotationsList + * objects with modifiable=false will + * not be modified by a vamsas client + * update + * */ - private java.util.Vector _alignmentAnnotationsList; + private boolean _modifiable = true; + + /** + * keeps track of state for field: _modifiable + */ + private boolean _has_modifiable; + + /** + * This is annotation over the + * coordinate frame defined by all + * the columns in the alignment. + * + */ + private java.util.Vector _alignmentAnnotationList; /** * Field _treeList @@ -73,6 +91,14 @@ implements java.io.Serializable private java.util.Vector _alignmentSequenceList; /** + * typical properties may be + * additional alignment score + * objects + * + */ + private java.util.Vector _propertyList; + + /** * Field _provenance */ private org.vamsas.objects.core.Provenance _provenance; @@ -85,9 +111,10 @@ implements java.io.Serializable public Alignment() { super(); - _alignmentAnnotationsList = new Vector(); + _alignmentAnnotationList = new Vector(); _treeList = new Vector(); _alignmentSequenceList = new Vector(); + _propertyList = new Vector(); } //-- org.vamsas.objects.core.Alignment() @@ -96,31 +123,31 @@ implements java.io.Serializable //-----------/ /** - * Method addAlignmentAnnotations + * Method addAlignmentAnnotation * * * - * @param vAlignmentAnnotations + * @param vAlignmentAnnotation */ - public void addAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations vAlignmentAnnotations) + public void addAlignmentAnnotation(org.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) throws java.lang.IndexOutOfBoundsException { - _alignmentAnnotationsList.addElement(vAlignmentAnnotations); - } //-- void addAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations) + _alignmentAnnotationList.addElement(vAlignmentAnnotation); + } //-- void addAlignmentAnnotation(org.vamsas.objects.core.AlignmentAnnotation) /** - * Method addAlignmentAnnotations + * Method addAlignmentAnnotation * * * * @param index - * @param vAlignmentAnnotations + * @param vAlignmentAnnotation */ - public void addAlignmentAnnotations(int index, org.vamsas.objects.core.AlignmentAnnotations vAlignmentAnnotations) + public void addAlignmentAnnotation(int index, org.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) throws java.lang.IndexOutOfBoundsException { - _alignmentAnnotationsList.insertElementAt(vAlignmentAnnotations, index); - } //-- void addAlignmentAnnotations(int, org.vamsas.objects.core.AlignmentAnnotations) + _alignmentAnnotationList.insertElementAt(vAlignmentAnnotation, index); + } //-- void addAlignmentAnnotation(int, org.vamsas.objects.core.AlignmentAnnotation) /** * Method addAlignmentSequence @@ -150,6 +177,33 @@ implements java.io.Serializable } //-- void addAlignmentSequence(int, org.vamsas.objects.core.AlignmentSequence) /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(org.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, org.vamsas.objects.core.Property) + + /** * Method addTree * * @@ -186,16 +240,25 @@ implements java.io.Serializable } //-- void deleteAligned() /** - * Method enumerateAlignmentAnnotations + * Method deleteModifiable + * + */ + public void deleteModifiable() + { + this._has_modifiable= false; + } //-- void deleteModifiable() + + /** + * Method enumerateAlignmentAnnotation * * * * @return Enumeration */ - public java.util.Enumeration enumerateAlignmentAnnotations() + public java.util.Enumeration enumerateAlignmentAnnotation() { - return _alignmentAnnotationsList.elements(); - } //-- java.util.Enumeration enumerateAlignmentAnnotations() + return _alignmentAnnotationList.elements(); + } //-- java.util.Enumeration enumerateAlignmentAnnotation() /** * Method enumerateAlignmentSequence @@ -210,6 +273,18 @@ implements java.io.Serializable } //-- java.util.Enumeration enumerateAlignmentSequence() /** + * Method enumerateProperty + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateProperty() + { + return _propertyList.elements(); + } //-- java.util.Enumeration enumerateProperty() + + /** * Method enumerateTree * * @@ -256,12 +331,16 @@ implements java.io.Serializable } else if (temp._id != null) return false; - if (this._alignmentAnnotationsList != null) { - if (temp._alignmentAnnotationsList == null) return false; - else if (!(this._alignmentAnnotationsList.equals(temp._alignmentAnnotationsList))) + if (this._modifiable != temp._modifiable) + return false; + if (this._has_modifiable != temp._has_modifiable) + return false; + if (this._alignmentAnnotationList != null) { + if (temp._alignmentAnnotationList == null) return false; + else if (!(this._alignmentAnnotationList.equals(temp._alignmentAnnotationList))) return false; } - else if (temp._alignmentAnnotationsList != null) + else if (temp._alignmentAnnotationList != null) return false; if (this._treeList != null) { if (temp._treeList == null) return false; @@ -277,6 +356,13 @@ implements java.io.Serializable } 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))) @@ -301,52 +387,52 @@ implements java.io.Serializable } //-- boolean getAligned() /** - * Method getAlignmentAnnotations + * Method getAlignmentAnnotation * * * * @param index - * @return AlignmentAnnotations + * @return AlignmentAnnotation */ - public org.vamsas.objects.core.AlignmentAnnotations getAlignmentAnnotations(int index) + public org.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(int index) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index - if ((index < 0) || (index > _alignmentAnnotationsList.size())) { - throw new IndexOutOfBoundsException("getAlignmentAnnotations: Index value '"+index+"' not in range [0.."+_alignmentAnnotationsList.size()+ "]"); + if ((index < 0) || (index > _alignmentAnnotationList.size())) { + throw new IndexOutOfBoundsException("getAlignmentAnnotation: Index value '"+index+"' not in range [0.."+_alignmentAnnotationList.size()+ "]"); } - return (org.vamsas.objects.core.AlignmentAnnotations) _alignmentAnnotationsList.elementAt(index); - } //-- org.vamsas.objects.core.AlignmentAnnotations getAlignmentAnnotations(int) + return (org.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.elementAt(index); + } //-- org.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(int) /** - * Method getAlignmentAnnotations + * Method getAlignmentAnnotation * * * - * @return AlignmentAnnotations + * @return AlignmentAnnotation */ - public org.vamsas.objects.core.AlignmentAnnotations[] getAlignmentAnnotations() + public org.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation() { - int size = _alignmentAnnotationsList.size(); - org.vamsas.objects.core.AlignmentAnnotations[] mArray = new org.vamsas.objects.core.AlignmentAnnotations[size]; + int size = _alignmentAnnotationList.size(); + org.vamsas.objects.core.AlignmentAnnotation[] mArray = new org.vamsas.objects.core.AlignmentAnnotation[size]; for (int index = 0; index < size; index++) { - mArray[index] = (org.vamsas.objects.core.AlignmentAnnotations) _alignmentAnnotationsList.elementAt(index); + mArray[index] = (org.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.elementAt(index); } return mArray; - } //-- org.vamsas.objects.core.AlignmentAnnotations[] getAlignmentAnnotations() + } //-- org.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation() /** - * Method getAlignmentAnnotationsCount + * Method getAlignmentAnnotationCount * * * * @return int */ - public int getAlignmentAnnotationsCount() + public int getAlignmentAnnotationCount() { - return _alignmentAnnotationsList.size(); - } //-- int getAlignmentAnnotationsCount() + return _alignmentAnnotationList.size(); + } //-- int getAlignmentAnnotationCount() /** * Method getAlignmentSequence @@ -408,7 +494,10 @@ implements java.io.Serializable } //-- java.lang.String getGapChar() /** - * Returns the value of field 'id'. + * 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'. @@ -419,6 +508,70 @@ implements java.io.Serializable } //-- java.lang.String getId() /** + * Returns the value of field 'modifiable'. The field + * 'modifiable' has the following description: objects with + * modifiable=false will + * not be modified by a vamsas client + * update + * + * + * @return boolean + * @return the value of field 'modifiable'. + */ + public boolean getModifiable() + { + return this._modifiable; + } //-- boolean getModifiable() + + /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public org.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 (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- org.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public org.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- org.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 @@ -490,6 +643,18 @@ implements java.io.Serializable } //-- boolean hasAligned() /** + * Method hasModifiable + * + * + * + * @return boolean + */ + public boolean hasModifiable() + { + return this._has_modifiable; + } //-- boolean hasModifiable() + + /** * Method isValid * * @@ -536,19 +701,19 @@ implements java.io.Serializable } //-- void marshal(org.xml.sax.ContentHandler) /** - * Method removeAlignmentAnnotations + * Method removeAlignmentAnnotation * * * * @param index - * @return AlignmentAnnotations + * @return AlignmentAnnotation */ - public org.vamsas.objects.core.AlignmentAnnotations removeAlignmentAnnotations(int index) + public org.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotation(int index) { - java.lang.Object obj = _alignmentAnnotationsList.elementAt(index); - _alignmentAnnotationsList.removeElementAt(index); - return (org.vamsas.objects.core.AlignmentAnnotations) obj; - } //-- org.vamsas.objects.core.AlignmentAnnotations removeAlignmentAnnotations(int) + java.lang.Object obj = _alignmentAnnotationList.elementAt(index); + _alignmentAnnotationList.removeElementAt(index); + return (org.vamsas.objects.core.AlignmentAnnotation) obj; + } //-- org.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotation(int) /** * Method removeAlignmentSequence @@ -566,13 +731,13 @@ implements java.io.Serializable } //-- org.vamsas.objects.core.AlignmentSequence removeAlignmentSequence(int) /** - * Method removeAllAlignmentAnnotations + * Method removeAllAlignmentAnnotation * */ - public void removeAllAlignmentAnnotations() + public void removeAllAlignmentAnnotation() { - _alignmentAnnotationsList.removeAllElements(); - } //-- void removeAllAlignmentAnnotations() + _alignmentAnnotationList.removeAllElements(); + } //-- void removeAllAlignmentAnnotation() /** * Method removeAllAlignmentSequence @@ -584,6 +749,15 @@ implements java.io.Serializable } //-- void removeAllAlignmentSequence() /** + * Method removeAllProperty + * + */ + public void removeAllProperty() + { + _propertyList.removeAllElements(); + } //-- void removeAllProperty() + + /** * Method removeAllTree * */ @@ -593,6 +767,21 @@ implements java.io.Serializable } //-- void removeAllTree() /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public org.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (org.vamsas.objects.core.Property) obj; + } //-- org.vamsas.objects.core.Property removeProperty(int) + + /** * Method removeTree * * @@ -619,38 +808,38 @@ implements java.io.Serializable } //-- void setAligned(boolean) /** - * Method setAlignmentAnnotations + * Method setAlignmentAnnotation * * * * @param index - * @param vAlignmentAnnotations + * @param vAlignmentAnnotation */ - public void setAlignmentAnnotations(int index, org.vamsas.objects.core.AlignmentAnnotations vAlignmentAnnotations) + public void setAlignmentAnnotation(int index, org.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) throws java.lang.IndexOutOfBoundsException { //-- check bounds for index - if ((index < 0) || (index > _alignmentAnnotationsList.size())) { - throw new IndexOutOfBoundsException("setAlignmentAnnotations: Index value '"+index+"' not in range [0.."+_alignmentAnnotationsList.size()+ "]"); + if ((index < 0) || (index > _alignmentAnnotationList.size())) { + throw new IndexOutOfBoundsException("setAlignmentAnnotation: Index value '"+index+"' not in range [0.."+_alignmentAnnotationList.size()+ "]"); } - _alignmentAnnotationsList.setElementAt(vAlignmentAnnotations, index); - } //-- void setAlignmentAnnotations(int, org.vamsas.objects.core.AlignmentAnnotations) + _alignmentAnnotationList.setElementAt(vAlignmentAnnotation, index); + } //-- void setAlignmentAnnotation(int, org.vamsas.objects.core.AlignmentAnnotation) /** - * Method setAlignmentAnnotations + * Method setAlignmentAnnotation * * * - * @param alignmentAnnotationsArray + * @param alignmentAnnotationArray */ - public void setAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations[] alignmentAnnotationsArray) + public void setAlignmentAnnotation(org.vamsas.objects.core.AlignmentAnnotation[] alignmentAnnotationArray) { //-- copy array - _alignmentAnnotationsList.removeAllElements(); - for (int i = 0; i < alignmentAnnotationsArray.length; i++) { - _alignmentAnnotationsList.addElement(alignmentAnnotationsArray[i]); + _alignmentAnnotationList.removeAllElements(); + for (int i = 0; i < alignmentAnnotationArray.length; i++) { + _alignmentAnnotationList.addElement(alignmentAnnotationArray[i]); } - } //-- void setAlignmentAnnotations(org.vamsas.objects.core.AlignmentAnnotations) + } //-- void setAlignmentAnnotation(org.vamsas.objects.core.AlignmentAnnotation) /** * Method setAlignmentSequence @@ -697,7 +886,10 @@ implements java.io.Serializable } //-- void setGapChar(java.lang.String) /** - * Sets the value of field 'id'. + * 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'. */ @@ -707,6 +899,56 @@ implements java.io.Serializable } //-- void setId(java.lang.String) /** + * Sets the value of field 'modifiable'. The field 'modifiable' + * has the following description: objects with modifiable=false + * will + * not be modified by a vamsas client + * update + * + * + * @param modifiable the value of field 'modifiable'. + */ + public void setModifiable(boolean modifiable) + { + this._modifiable = modifiable; + this._has_modifiable = true; + } //-- void setModifiable(boolean) + + /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, org.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, org.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(org.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(org.vamsas.objects.core.Property) + + /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. diff --git a/src/org/vamsas/objects/core/AlignmentAnnotation.java b/src/org/vamsas/objects/core/AlignmentAnnotation.java new file mode 100644 index 0000000..0bfc7f0 --- /dev/null +++ b/src/org/vamsas/objects/core/AlignmentAnnotation.java @@ -0,0 +1,265 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.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 org.vamsas.objects.core.Provenance _provenance; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AlignmentAnnotation() + { + super(); + } //-- org.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 org.vamsas.objects.core.Provenance getProvenance() + { + return this._provenance; + } //-- org.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(org.vamsas.objects.core.Provenance provenance) + { + this._provenance = provenance; + } //-- void setProvenance(org.vamsas.objects.core.Provenance) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return RangeType + */ + public static org.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.AlignmentAnnotation) Unmarshaller.unmarshal(org.vamsas.objects.core.AlignmentAnnotation.class, reader); + } //-- org.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/org/vamsas/objects/core/AlignmentAnnotationDescriptor.java b/src/org/vamsas/objects/core/AlignmentAnnotationDescriptor.java new file mode 100644 index 0000000..da72105 --- /dev/null +++ b/src/org/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 org.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 org.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 org.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(org.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( (org.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 org.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); + } //-- org.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 org.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/org/vamsas/objects/core/AlignmentDescriptor.java b/src/org/vamsas/objects/core/AlignmentDescriptor.java index 5030b0c..3d32f8c 100644 --- a/src/org/vamsas/objects/core/AlignmentDescriptor.java +++ b/src/org/vamsas/objects/core/AlignmentDescriptor.java @@ -181,30 +181,72 @@ public class AlignmentDescriptor extends org.exolab.castor.xml.util.XMLClassDesc { //-- local scope } desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_modifiable", "modifiable", 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.hasModifiable()) + return null; + return (target.getModifiable() ? 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.deleteModifiable(); + return; + } + target.setModifiable( ((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: _modifiable + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); //-- initialize element descriptors - //-- _alignmentAnnotationsList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.vamsas.objects.core.AlignmentAnnotations.class, "_alignmentAnnotationsList", "AlignmentAnnotations", org.exolab.castor.xml.NodeType.Element); + //-- _alignmentAnnotationList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.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.getAlignmentAnnotations(); + return target.getAlignmentAnnotation(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { Alignment target = (Alignment) object; - target.addAlignmentAnnotations( (org.vamsas.objects.core.AlignmentAnnotations) value); + target.addAlignmentAnnotation( (org.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 org.vamsas.objects.core.AlignmentAnnotations(); + return new org.vamsas.objects.core.AlignmentAnnotation(); } }; desc.setHandler(handler); @@ -212,7 +254,7 @@ public class AlignmentDescriptor extends org.exolab.castor.xml.util.XMLClassDesc desc.setMultivalued(true); addFieldDescriptor(desc); - //-- validation code for: _alignmentAnnotationsList + //-- validation code for: _alignmentAnnotationList fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(0); { //-- local scope @@ -289,6 +331,41 @@ public class AlignmentDescriptor extends org.exolab.castor.xml.util.XMLClassDesc { //-- local scope } desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.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( (org.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 org.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(org.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element); handler = new org.exolab.castor.xml.XMLFieldHandler() { diff --git a/src/org/vamsas/objects/core/AlignmentSequence.java b/src/org/vamsas/objects/core/AlignmentSequence.java index 6761934..d8f66ba 100644 --- a/src/org/vamsas/objects/core/AlignmentSequence.java +++ b/src/org/vamsas/objects/core/AlignmentSequence.java @@ -15,6 +15,8 @@ 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; @@ -36,15 +38,28 @@ implements java.io.Serializable //--------------------------/ /** - * Field _id + * Primary Key for + * vamsas object + * referencing + * */ private java.lang.String _id; /** - * Field _refid + * Dataset Sequence + * from which this + * alignment + * sequence is + * taken from + * */ private java.lang.Object _refid; + /** + * Field _alignmentSequenceAnnotationList + */ + private java.util.Vector _alignmentSequenceAnnotationList; + //----------------/ //- Constructors -/ @@ -53,6 +68,7 @@ implements java.io.Serializable public AlignmentSequence() { super(); + _alignmentSequenceAnnotationList = new Vector(); } //-- org.vamsas.objects.core.AlignmentSequence() @@ -61,6 +77,45 @@ implements java.io.Serializable //-----------/ /** + * Method addAlignmentSequenceAnnotation + * + * + * + * @param vAlignmentSequenceAnnotation + */ + public void addAlignmentSequenceAnnotation(org.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) + throws java.lang.IndexOutOfBoundsException + { + _alignmentSequenceAnnotationList.addElement(vAlignmentSequenceAnnotation); + } //-- void addAlignmentSequenceAnnotation(org.vamsas.objects.core.AlignmentSequenceAnnotation) + + /** + * Method addAlignmentSequenceAnnotation + * + * + * + * @param index + * @param vAlignmentSequenceAnnotation + */ + public void addAlignmentSequenceAnnotation(int index, org.vamsas.objects.core.AlignmentSequenceAnnotation vAlignmentSequenceAnnotation) + throws java.lang.IndexOutOfBoundsException + { + _alignmentSequenceAnnotationList.insertElementAt(vAlignmentSequenceAnnotation, index); + } //-- void addAlignmentSequenceAnnotation(int, org.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 @@ -91,13 +146,72 @@ implements java.io.Serializable } 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) /** - * Returns the value of field 'id'. + * Method getAlignmentSequenceAnnotation + * + * + * + * @param index + * @return AlignmentSequenceAnnotation + */ + public org.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 (org.vamsas.objects.core.AlignmentSequenceAnnotation) _alignmentSequenceAnnotationList.elementAt(index); + } //-- org.vamsas.objects.core.AlignmentSequenceAnnotation getAlignmentSequenceAnnotation(int) + + /** + * Method getAlignmentSequenceAnnotation + * + * + * + * @return AlignmentSequenceAnnotation + */ + public org.vamsas.objects.core.AlignmentSequenceAnnotation[] getAlignmentSequenceAnnotation() + { + int size = _alignmentSequenceAnnotationList.size(); + org.vamsas.objects.core.AlignmentSequenceAnnotation[] mArray = new org.vamsas.objects.core.AlignmentSequenceAnnotation[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.AlignmentSequenceAnnotation) _alignmentSequenceAnnotationList.elementAt(index); + } + return mArray; + } //-- org.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'. @@ -108,7 +222,13 @@ implements java.io.Serializable } //-- java.lang.String getId() /** - * Returns the value of field 'refid'. + * 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'. @@ -165,7 +285,69 @@ implements java.io.Serializable } //-- void marshal(org.xml.sax.ContentHandler) /** - * Sets the value of field 'id'. + * Method removeAlignmentSequenceAnnotation + * + * + * + * @param index + * @return AlignmentSequenceAnnotation + */ + public org.vamsas.objects.core.AlignmentSequenceAnnotation removeAlignmentSequenceAnnotation(int index) + { + java.lang.Object obj = _alignmentSequenceAnnotationList.elementAt(index); + _alignmentSequenceAnnotationList.removeElementAt(index); + return (org.vamsas.objects.core.AlignmentSequenceAnnotation) obj; + } //-- org.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, org.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, org.vamsas.objects.core.AlignmentSequenceAnnotation) + + /** + * Method setAlignmentSequenceAnnotation + * + * + * + * @param alignmentSequenceAnnotationArray + */ + public void setAlignmentSequenceAnnotation(org.vamsas.objects.core.AlignmentSequenceAnnotation[] alignmentSequenceAnnotationArray) + { + //-- copy array + _alignmentSequenceAnnotationList.removeAllElements(); + for (int i = 0; i < alignmentSequenceAnnotationArray.length; i++) { + _alignmentSequenceAnnotationList.addElement(alignmentSequenceAnnotationArray[i]); + } + } //-- void setAlignmentSequenceAnnotation(org.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'. */ @@ -175,7 +357,13 @@ implements java.io.Serializable } //-- void setId(java.lang.String) /** - * Sets the value of field 'refid'. + * 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'. */ diff --git a/src/org/vamsas/objects/core/AlignmentSequenceAnnotation.java b/src/org/vamsas/objects/core/AlignmentSequenceAnnotation.java new file mode 100644 index 0000000..7c747d1 --- /dev/null +++ b/src/org/vamsas/objects/core/AlignmentSequenceAnnotation.java @@ -0,0 +1,301 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.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 org.vamsas.objects.core.Provenance _provenance; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AlignmentSequenceAnnotation() + { + super(); + } //-- org.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 org.vamsas.objects.core.Provenance getProvenance() + { + return this._provenance; + } //-- org.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(org.vamsas.objects.core.Provenance provenance) + { + this._provenance = provenance; + } //-- void setProvenance(org.vamsas.objects.core.Provenance) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return RangeType + */ + public static org.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.AlignmentSequenceAnnotation) Unmarshaller.unmarshal(org.vamsas.objects.core.AlignmentSequenceAnnotation.class, reader); + } //-- org.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/org/vamsas/objects/core/AlignmentSequenceAnnotationDescriptor.java b/src/org/vamsas/objects/core/AlignmentSequenceAnnotationDescriptor.java new file mode 100644 index 0000000..722269d --- /dev/null +++ b/src/org/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 org.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 org.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 org.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(org.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( (org.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 org.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); + } //-- org.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 org.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/org/vamsas/objects/core/AlignmentSequenceDescriptor.java b/src/org/vamsas/objects/core/AlignmentSequenceDescriptor.java index e219b2b..afbe5cd 100644 --- a/src/org/vamsas/objects/core/AlignmentSequenceDescriptor.java +++ b/src/org/vamsas/objects/core/AlignmentSequenceDescriptor.java @@ -59,6 +59,9 @@ public class AlignmentSequenceDescriptor extends org.vamsas.objects.core.Sequenc setExtendsWithoutFlatten(new org.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; @@ -136,6 +139,41 @@ public class AlignmentSequenceDescriptor extends org.vamsas.objects.core.Sequenc desc.setValidator(fieldValidator); //-- initialize element descriptors + //-- _alignmentSequenceAnnotationList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.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( (org.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 org.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); } //-- org.vamsas.objects.core.AlignmentSequenceDescriptor() diff --git a/src/org/vamsas/objects/core/AnnotationElement.java b/src/org/vamsas/objects/core/AnnotationElement.java index 223df76..12a1777 100644 --- a/src/org/vamsas/objects/core/AnnotationElement.java +++ b/src/org/vamsas/objects/core/AnnotationElement.java @@ -15,6 +15,8 @@ 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; @@ -36,7 +38,9 @@ implements java.io.Serializable //--------------------------/ /** - * Field _position + * position with respect to the coordinate frame + * defined by a rangeType specification + * */ private int _position; @@ -46,34 +50,46 @@ implements java.io.Serializable private boolean _has_position; /** - * Field _id + * true means the annotation element appears + * between the specified position and the next + * */ - private java.lang.String _id; + private boolean _after = false; /** - * Field _displayCharacter + * keeps track of state for field: _after */ - private java.lang.String _displayCharacter; + private boolean _has_after; /** - * Field _description + * Primary Key for vamsas object referencing + * */ - private java.lang.String _description; + private java.lang.String _id; /** - * Field _secondaryStructure + * Free text at this position + * */ - private java.lang.String _secondaryStructure; + private java.lang.String _description; /** - * Field _value + * Discrete symbol - possibly graphically + * represented + * */ - private float _value; + private java.util.Vector _glyphList; /** - * keeps track of state for field: _value + * 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 boolean _has_value; + private java.util.Vector _valueList; //----------------/ @@ -83,6 +99,8 @@ implements java.io.Serializable public AnnotationElement() { super(); + _glyphList = new Vector(); + _valueList = new Vector(); } //-- org.vamsas.objects.core.AnnotationElement() @@ -91,6 +109,69 @@ implements java.io.Serializable //-----------/ /** + * Method addGlyph + * + * + * + * @param vGlyph + */ + public void addGlyph(org.vamsas.objects.core.Glyph vGlyph) + throws java.lang.IndexOutOfBoundsException + { + _glyphList.addElement(vGlyph); + } //-- void addGlyph(org.vamsas.objects.core.Glyph) + + /** + * Method addGlyph + * + * + * + * @param index + * @param vGlyph + */ + public void addGlyph(int index, org.vamsas.objects.core.Glyph vGlyph) + throws java.lang.IndexOutOfBoundsException + { + _glyphList.insertElementAt(vGlyph, index); + } //-- void addGlyph(int, org.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 * */ @@ -100,13 +181,28 @@ implements java.io.Serializable } //-- void deletePosition() /** - * Method deleteValue + * Method enumerateGlyph + * + * * + * @return Enumeration */ - public void deleteValue() + public java.util.Enumeration enumerateGlyph() { - this._has_value= false; - } //-- void deleteValue() + 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 @@ -129,6 +225,10 @@ implements java.io.Serializable 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))) @@ -136,13 +236,6 @@ implements java.io.Serializable } else if (temp._id != null) return false; - if (this._displayCharacter != null) { - if (temp._displayCharacter == null) return false; - else if (!(this._displayCharacter.equals(temp._displayCharacter))) - return false; - } - else if (temp._displayCharacter != null) - return false; if (this._description != null) { if (temp._description == null) return false; else if (!(this._description.equals(temp._description))) @@ -150,16 +243,19 @@ implements java.io.Serializable } else if (temp._description != null) return false; - if (this._secondaryStructure != null) { - if (temp._secondaryStructure == null) return false; - else if (!(this._secondaryStructure.equals(temp._secondaryStructure))) + if (this._glyphList != null) { + if (temp._glyphList == null) return false; + else if (!(this._glyphList.equals(temp._glyphList))) return false; } - else if (temp._secondaryStructure != null) - return false; - if (this._value != temp._value) + else if (temp._glyphList != null) return false; - if (this._has_value != temp._has_value) + 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; } @@ -167,7 +263,25 @@ implements java.io.Serializable } //-- boolean equals(java.lang.Object) /** - * Returns the value of field 'description'. + * 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'. @@ -178,18 +292,58 @@ implements java.io.Serializable } //-- java.lang.String getDescription() /** - * Returns the value of field 'displayCharacter'. + * Method getGlyph * - * @return String - * @return the value of field 'displayCharacter'. + * + * + * @param index + * @return Glyph */ - public java.lang.String getDisplayCharacter() + public org.vamsas.objects.core.Glyph getGlyph(int index) + throws java.lang.IndexOutOfBoundsException { - return this._displayCharacter; - } //-- java.lang.String getDisplayCharacter() + //-- check bounds for index + if ((index < 0) || (index > _glyphList.size())) { + throw new IndexOutOfBoundsException("getGlyph: Index value '"+index+"' not in range [0.."+_glyphList.size()+ "]"); + } + + return (org.vamsas.objects.core.Glyph) _glyphList.elementAt(index); + } //-- org.vamsas.objects.core.Glyph getGlyph(int) /** - * Returns the value of field 'id'. + * Method getGlyph + * + * + * + * @return Glyph + */ + public org.vamsas.objects.core.Glyph[] getGlyph() + { + int size = _glyphList.size(); + org.vamsas.objects.core.Glyph[] mArray = new org.vamsas.objects.core.Glyph[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Glyph) _glyphList.elementAt(index); + } + return mArray; + } //-- org.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'. @@ -200,7 +354,11 @@ implements java.io.Serializable } //-- java.lang.String getId() /** - * Returns the value of field 'position'. + * 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'. @@ -211,50 +369,76 @@ implements java.io.Serializable } //-- int getPosition() /** - * Returns the value of field 'secondaryStructure'. + * Method getValue * - * @return String - * @return the value of field 'secondaryStructure'. + * + * + * @param index + * @return float */ - public java.lang.String getSecondaryStructure() + public float getValue(int index) + throws java.lang.IndexOutOfBoundsException { - return this._secondaryStructure; - } //-- java.lang.String getSecondaryStructure() + //-- 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) /** - * Returns the value of field 'value'. + * Method getValue + * + * * * @return float - * @return the value of field 'value'. */ - public float getValue() + public float[] getValue() { - return this._value; - } //-- 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 hasPosition + * Method getValueCount + * + * + * + * @return int + */ + public int getValueCount() + { + return _valueList.size(); + } //-- int getValueCount() + + /** + * Method hasAfter * * * * @return boolean */ - public boolean hasPosition() + public boolean hasAfter() { - return this._has_position; - } //-- boolean hasPosition() + return this._has_after; + } //-- boolean hasAfter() /** - * Method hasValue + * Method hasPosition * * * * @return boolean */ - public boolean hasValue() + public boolean hasPosition() { - return this._has_value; - } //-- boolean hasValue() + return this._has_position; + } //-- boolean hasPosition() /** * Method isValid @@ -303,7 +487,73 @@ implements java.io.Serializable } //-- void marshal(org.xml.sax.ContentHandler) /** - * Sets the value of field 'description'. + * 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 org.vamsas.objects.core.Glyph removeGlyph(int index) + { + java.lang.Object obj = _glyphList.elementAt(index); + _glyphList.removeElementAt(index); + return (org.vamsas.objects.core.Glyph) obj; + } //-- org.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'. */ @@ -313,17 +563,44 @@ implements java.io.Serializable } //-- void setDescription(java.lang.String) /** - * Sets the value of field 'displayCharacter'. + * Method setGlyph + * * - * @param displayCharacter the value of field 'displayCharacter' + * + * @param index + * @param vGlyph */ - public void setDisplayCharacter(java.lang.String displayCharacter) + public void setGlyph(int index, org.vamsas.objects.core.Glyph vGlyph) + throws java.lang.IndexOutOfBoundsException { - this._displayCharacter = displayCharacter; - } //-- void setDisplayCharacter(java.lang.String) + //-- 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, org.vamsas.objects.core.Glyph) /** - * Sets the value of field 'id'. + * Method setGlyph + * + * + * + * @param glyphArray + */ + public void setGlyph(org.vamsas.objects.core.Glyph[] glyphArray) + { + //-- copy array + _glyphList.removeAllElements(); + for (int i = 0; i < glyphArray.length; i++) { + _glyphList.addElement(glyphArray[i]); + } + } //-- void setGlyph(org.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'. */ @@ -333,7 +610,11 @@ implements java.io.Serializable } //-- void setId(java.lang.String) /** - * Sets the value of field 'position'. + * 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'. */ @@ -344,25 +625,37 @@ implements java.io.Serializable } //-- void setPosition(int) /** - * Sets the value of field 'secondaryStructure'. + * Method setValue + * + * * - * @param secondaryStructure the value of field - * 'secondaryStructure'. + * @param index + * @param vValue */ - public void setSecondaryStructure(java.lang.String secondaryStructure) + public void setValue(int index, float vValue) + throws java.lang.IndexOutOfBoundsException { - this._secondaryStructure = secondaryStructure; - } //-- void setSecondaryStructure(java.lang.String) + //-- 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) /** - * Sets the value of field 'value'. + * Method setValue + * * - * @param value the value of field 'value'. + * + * @param valueArray */ - public void setValue(float value) + public void setValue(float[] valueArray) { - this._value = value; - this._has_value = true; + //-- copy array + _valueList.removeAllElements(); + for (int i = 0; i < valueArray.length; i++) { + _valueList.addElement(new java.lang.Float(valueArray[i])); + } } //-- void setValue(float) /** diff --git a/src/org/vamsas/objects/core/AnnotationElementDescriptor.java b/src/org/vamsas/objects/core/AnnotationElementDescriptor.java index 943bb99..cc7bb65 100644 --- a/src/org/vamsas/objects/core/AnnotationElementDescriptor.java +++ b/src/org/vamsas/objects/core/AnnotationElementDescriptor.java @@ -108,80 +108,84 @@ public class AnnotationElementDescriptor extends org.exolab.castor.xml.util.XMLC 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; + //-- _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; - return target.getId(); + 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; - target.setId( (java.lang.String) value); + // 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 new java.lang.String(); + return null; } }; desc.setHandler(handler); desc.setMultivalued(false); addFieldDescriptor(desc); - //-- validation code for: _id + //-- validation code for: _after fieldValidator = new org.exolab.castor.xml.FieldValidator(); { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _displayCharacter - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_displayCharacter", "displayCharacter", org.exolab.castor.xml.NodeType.Element); - desc.setImmutable(true); + //-- _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.getDisplayCharacter(); + return target.getId(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { AnnotationElement target = (AnnotationElement) object; - target.setDisplayCharacter( (java.lang.String) value); + target.setId( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } public java.lang.Object newInstance( java.lang.Object parent ) { - return null; + return new java.lang.String(); } }; desc.setHandler(handler); - desc.setNameSpaceURI("http://www.vamsas.org"); desc.setMultivalued(false); addFieldDescriptor(desc); - //-- validation code for: _displayCharacter + //-- validation code for: _id fieldValidator = new org.exolab.castor.xml.FieldValidator(); { //-- local scope - StringValidator typeValidator = new StringValidator(); - typeValidator.setWhiteSpace("preserve"); - fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); + //-- initialize element descriptors + //-- _description desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element); desc.setImmutable(true); @@ -220,67 +224,59 @@ public class AnnotationElementDescriptor extends org.exolab.castor.xml.util.XMLC fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); - //-- _secondaryStructure - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_secondaryStructure", "secondaryStructure", org.exolab.castor.xml.NodeType.Element); - desc.setImmutable(true); + //-- _glyphList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.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.getSecondaryStructure(); + return target.getGlyph(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { AnnotationElement target = (AnnotationElement) object; - target.setSecondaryStructure( (java.lang.String) value); + target.addGlyph( (org.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 null; + return new org.vamsas.objects.core.Glyph(); } }; desc.setHandler(handler); desc.setNameSpaceURI("http://www.vamsas.org"); - desc.setMultivalued(false); + desc.setMultivalued(true); addFieldDescriptor(desc); - //-- validation code for: _secondaryStructure + //-- validation code for: _glyphList fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); { //-- local scope - StringValidator typeValidator = new StringValidator(); - typeValidator.setLength(1); - typeValidator.setWhiteSpace("preserve"); - fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); - //-- _value - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_value", "value", org.exolab.castor.xml.NodeType.Element); + //-- _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; - if(!target.hasValue()) - return null; - return new java.lang.Float(target.getValue()); + return target.getValue(); } 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.deleteValue(); - return; - } - target.setValue( ((java.lang.Float)value).floatValue()); + // 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()); @@ -292,11 +288,12 @@ public class AnnotationElementDescriptor extends org.exolab.castor.xml.util.XMLC }; desc.setHandler(handler); desc.setNameSpaceURI("http://www.vamsas.org"); - desc.setMultivalued(false); + desc.setMultivalued(true); addFieldDescriptor(desc); - //-- validation code for: _value + //-- validation code for: _valueList fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); { //-- local scope FloatValidator typeValidator = new FloatValidator(); fieldValidator.setValidator(typeValidator); diff --git a/src/org/vamsas/objects/core/ApplicationData.java b/src/org/vamsas/objects/core/ApplicationData.java index 37f374d..22b645a 100644 --- a/src/org/vamsas/objects/core/ApplicationData.java +++ b/src/org/vamsas/objects/core/ApplicationData.java @@ -38,24 +38,31 @@ implements java.io.Serializable //--------------------------/ /** - * Field _version + * Version string describing the application specific data + * storage version used */ private java.lang.String _version; /** - * Field _name + * Canonical name of application + * */ private java.lang.String _name; /** - * Field _urn + * Field _userList */ - private java.lang.String _urn; + private java.util.Vector _userList; /** - * Field _userList + * Field _common */ - private java.util.Vector _userList; + private org.vamsas.objects.core.Common _common; + + /** + * Field _instanceList + */ + private java.util.Vector _instanceList; //----------------/ @@ -66,6 +73,7 @@ implements java.io.Serializable { super(); _userList = new Vector(); + _instanceList = new Vector(); } //-- org.vamsas.objects.core.ApplicationData() @@ -74,6 +82,33 @@ implements java.io.Serializable //-----------/ /** + * Method addInstance + * + * + * + * @param vInstance + */ + public void addInstance(org.vamsas.objects.core.Instance vInstance) + throws java.lang.IndexOutOfBoundsException + { + _instanceList.addElement(vInstance); + } //-- void addInstance(org.vamsas.objects.core.Instance) + + /** + * Method addInstance + * + * + * + * @param index + * @param vInstance + */ + public void addInstance(int index, org.vamsas.objects.core.Instance vInstance) + throws java.lang.IndexOutOfBoundsException + { + _instanceList.insertElementAt(vInstance, index); + } //-- void addInstance(int, org.vamsas.objects.core.Instance) + + /** * Method addUser * * @@ -101,6 +136,18 @@ implements java.io.Serializable } //-- void addUser(int, org.vamsas.objects.core.User) /** + * Method enumerateInstance + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateInstance() + { + return _instanceList.elements(); + } //-- java.util.Enumeration enumerateInstance() + + /** * Method enumerateUser * * @@ -143,13 +190,6 @@ implements java.io.Serializable } else if (temp._name != null) return false; - 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; if (this._userList != null) { if (temp._userList == null) return false; else if (!(this._userList.equals(temp._userList))) @@ -157,32 +197,96 @@ implements java.io.Serializable } 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 'name'. + * Returns the value of field 'common'. * - * @return String - * @return the value of field 'name'. + * @return Common + * @return the value of field 'common'. */ - public java.lang.String getName() + public org.vamsas.objects.core.Common getCommon() { - return this._name; - } //-- java.lang.String getName() + return this._common; + } //-- org.vamsas.objects.core.Common getCommon() /** - * Returns the value of field 'urn'. + * Method getInstance + * + * + * + * @param index + * @return Instance + */ + public org.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 (org.vamsas.objects.core.Instance) _instanceList.elementAt(index); + } //-- org.vamsas.objects.core.Instance getInstance(int) + + /** + * Method getInstance + * + * + * + * @return Instance + */ + public org.vamsas.objects.core.Instance[] getInstance() + { + int size = _instanceList.size(); + org.vamsas.objects.core.Instance[] mArray = new org.vamsas.objects.core.Instance[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Instance) _instanceList.elementAt(index); + } + return mArray; + } //-- org.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 'urn'. + * @return the value of field 'name'. */ - public java.lang.String getUrn() + public java.lang.String getName() { - return this._urn; - } //-- java.lang.String getUrn() + return this._name; + } //-- java.lang.String getName() /** * Method getUser @@ -233,7 +337,9 @@ implements java.io.Serializable } //-- int getUserCount() /** - * Returns the value of field 'version'. + * 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'. @@ -290,6 +396,15 @@ implements java.io.Serializable } //-- void marshal(org.xml.sax.ContentHandler) /** + * Method removeAllInstance + * + */ + public void removeAllInstance() + { + _instanceList.removeAllElements(); + } //-- void removeAllInstance() + + /** * Method removeAllUser * */ @@ -299,6 +414,21 @@ implements java.io.Serializable } //-- void removeAllUser() /** + * Method removeInstance + * + * + * + * @param index + * @return Instance + */ + public org.vamsas.objects.core.Instance removeInstance(int index) + { + java.lang.Object obj = _instanceList.elementAt(index); + _instanceList.removeElementAt(index); + return (org.vamsas.objects.core.Instance) obj; + } //-- org.vamsas.objects.core.Instance removeInstance(int) + + /** * Method removeUser * * @@ -314,24 +444,60 @@ implements java.io.Serializable } //-- org.vamsas.objects.core.User removeUser(int) /** - * Sets the value of field 'name'. + * Sets the value of field 'common'. * - * @param name the value of field 'name'. + * @param common the value of field 'common'. */ - public void setName(java.lang.String name) + public void setCommon(org.vamsas.objects.core.Common common) { - this._name = name; - } //-- void setName(java.lang.String) + this._common = common; + } //-- void setCommon(org.vamsas.objects.core.Common) + + /** + * Method setInstance + * + * + * + * @param index + * @param vInstance + */ + public void setInstance(int index, org.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, org.vamsas.objects.core.Instance) /** - * Sets the value of field 'urn'. + * Method setInstance + * + * * - * @param urn the value of field 'urn'. + * @param instanceArray */ - public void setUrn(java.lang.String urn) + public void setInstance(org.vamsas.objects.core.Instance[] instanceArray) { - this._urn = urn; - } //-- void setUrn(java.lang.String) + //-- copy array + _instanceList.removeAllElements(); + for (int i = 0; i < instanceArray.length; i++) { + _instanceList.addElement(instanceArray[i]); + } + } //-- void setInstance(org.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 @@ -368,7 +534,9 @@ implements java.io.Serializable } //-- void setUser(org.vamsas.objects.core.User) /** - * Sets the value of field 'version'. + * 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'. */ diff --git a/src/org/vamsas/objects/core/ApplicationDataDescriptor.java b/src/org/vamsas/objects/core/ApplicationDataDescriptor.java index 9e0648e..894e945 100644 --- a/src/org/vamsas/objects/core/ApplicationDataDescriptor.java +++ b/src/org/vamsas/objects/core/ApplicationDataDescriptor.java @@ -145,69 +145,99 @@ public class ApplicationDataDescriptor extends org.vamsas.objects.core.AppDataDe fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); - //-- _urn - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_urn", "urn", org.exolab.castor.xml.NodeType.Attribute); - desc.setImmutable(true); + //-- initialize element descriptors + + //-- _userList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.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.getUrn(); + return target.getUser(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { ApplicationData target = (ApplicationData) object; - target.setUrn( (java.lang.String) value); + target.addUser( (org.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 null; + return new org.vamsas.objects.core.User(); } }; desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); addFieldDescriptor(desc); - //-- validation code for: _urn + //-- validation code for: _userList fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); + fieldValidator.setMinOccurs(0); { //-- local scope - StringValidator typeValidator = new StringValidator(); - typeValidator.setWhiteSpace("preserve"); - fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); - //-- initialize element descriptors + //-- _common + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.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( (org.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 org.vamsas.objects.core.Common(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); - //-- _userList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.vamsas.objects.core.User.class, "_userList", "User", org.exolab.castor.xml.NodeType.Element); + //-- 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(org.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.getUser(); + return target.getInstance(); } public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { ApplicationData target = (ApplicationData) object; - target.addUser( (org.vamsas.objects.core.User) value); + target.addInstance( (org.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 org.vamsas.objects.core.User(); + return new org.vamsas.objects.core.Instance(); } }; desc.setHandler(handler); @@ -215,7 +245,7 @@ public class ApplicationDataDescriptor extends org.vamsas.objects.core.AppDataDe desc.setMultivalued(true); addFieldDescriptor(desc); - //-- validation code for: _userList + //-- validation code for: _instanceList fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(0); { //-- local scope diff --git a/src/org/vamsas/objects/core/Attachment.java b/src/org/vamsas/objects/core/Attachment.java new file mode 100644 index 0000000..a906c00 --- /dev/null +++ b/src/org/vamsas/objects/core/Attachment.java @@ -0,0 +1,341 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.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(); + } //-- org.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 org.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Attachment) Unmarshaller.unmarshal(org.vamsas.objects.core.Attachment.class, reader); + } //-- org.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/org/vamsas/objects/core/AttachmentDescriptor.java b/src/org/vamsas/objects/core/AttachmentDescriptor.java new file mode 100644 index 0000000..d22591c --- /dev/null +++ b/src/org/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 org.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 org.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 org.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 + + } //-- org.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 org.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/org/vamsas/objects/core/Common.java b/src/org/vamsas/objects/core/Common.java new file mode 100644 index 0000000..15fa948 --- /dev/null +++ b/src/org/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 org.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 org.vamsas.objects.core.AppData +implements java.io.Serializable +{ + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Common() + { + super(); + } //-- org.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 org.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Common) Unmarshaller.unmarshal(org.vamsas.objects.core.Common.class, reader); + } //-- org.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/org/vamsas/objects/core/CommonDescriptor.java b/src/org/vamsas/objects/core/CommonDescriptor.java new file mode 100644 index 0000000..4fe6efa --- /dev/null +++ b/src/org/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 org.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 org.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 org.vamsas.objects.core.AppDataDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "Common"; + } //-- org.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 org.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/org/vamsas/objects/core/DataSet.java b/src/org/vamsas/objects/core/DataSet.java index e5c0b8b..a2f6d3a 100644 --- a/src/org/vamsas/objects/core/DataSet.java +++ b/src/org/vamsas/objects/core/DataSet.java @@ -38,7 +38,8 @@ implements java.io.Serializable //--------------------------/ /** - * Field _id + * Primary Key for vamsas object referencing + * */ private java.lang.String _id; @@ -403,7 +404,10 @@ implements java.io.Serializable } //-- int getDataSetAnnotationsCount() /** - * Returns the value of field 'id'. + * 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'. @@ -731,7 +735,10 @@ implements java.io.Serializable } //-- void setDataSetAnnotations(org.vamsas.objects.core.DataSetAnnotations) /** - * Sets the value of field 'id'. + * 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'. */ diff --git a/src/org/vamsas/objects/core/DataSetAnnotations.java b/src/org/vamsas/objects/core/DataSetAnnotations.java index 52c56e7..abf6a8f 100644 --- a/src/org/vamsas/objects/core/DataSetAnnotations.java +++ b/src/org/vamsas/objects/core/DataSetAnnotations.java @@ -15,8 +15,6 @@ 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; @@ -28,7 +26,7 @@ import org.xml.sax.ContentHandler; * * @version $Revision$ $Date$ */ -public class DataSetAnnotations extends org.vamsas.client.Vobject +public class DataSetAnnotations extends org.vamsas.objects.core.RangeAnnotation implements java.io.Serializable { @@ -38,56 +36,14 @@ implements java.io.Serializable //--------------------------/ /** - * Field _type - */ - private java.lang.String _type; - - /** - * Field _end - */ - private int _end; - - /** - * keeps track of state for field: _end - */ - private boolean _has_end; - - /** - * Field _begin - */ - private int _begin; - - /** - * keeps track of state for field: _begin - */ - private boolean _has_begin; - - /** - * Field _seqRef + * annotation is associated + * with a particular dataset + * sequence + * */ private java.lang.Object _seqRef; /** - * Field _id - */ - private java.lang.String _id; - - /** - * Field _description - */ - private java.lang.String _description; - - /** - * Field _status - */ - private java.lang.String _status; - - /** - * Field _annotationElementList - */ - private java.util.Vector _annotationElementList; - - /** * Field _provenance */ private org.vamsas.objects.core.Provenance _provenance; @@ -100,7 +56,6 @@ implements java.io.Serializable public DataSetAnnotations() { super(); - _annotationElementList = new Vector(); } //-- org.vamsas.objects.core.DataSetAnnotations() @@ -109,63 +64,6 @@ implements java.io.Serializable //-----------/ /** - * Method addAnnotationElement - * - * - * - * @param vAnnotationElement - */ - public void addAnnotationElement(org.vamsas.objects.core.AnnotationElement vAnnotationElement) - throws java.lang.IndexOutOfBoundsException - { - _annotationElementList.addElement(vAnnotationElement); - } //-- void addAnnotationElement(org.vamsas.objects.core.AnnotationElement) - - /** - * Method addAnnotationElement - * - * - * - * @param index - * @param vAnnotationElement - */ - public void addAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement) - throws java.lang.IndexOutOfBoundsException - { - _annotationElementList.insertElementAt(vAnnotationElement, index); - } //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement) - - /** - * Method deleteBegin - * - */ - public void deleteBegin() - { - this._has_begin= false; - } //-- void deleteBegin() - - /** - * Method deleteEnd - * - */ - public void deleteEnd() - { - this._has_end= false; - } //-- void deleteEnd() - - /** - * Method enumerateAnnotationElement - * - * - * - * @return Enumeration - */ - public java.util.Enumeration enumerateAnnotationElement() - { - return _annotationElementList.elements(); - } //-- java.util.Enumeration enumerateAnnotationElement() - - /** * Note: hashCode() has not been overriden * * @param obj @@ -182,21 +80,6 @@ implements java.io.Serializable if (obj instanceof DataSetAnnotations) { DataSetAnnotations temp = (DataSetAnnotations)obj; - 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._end != temp._end) - return false; - if (this._has_end != temp._has_end) - return false; - if (this._begin != temp._begin) - return false; - if (this._has_begin != temp._has_begin) - return false; if (this._seqRef != null) { if (temp._seqRef == null) return false; else if (!(this._seqRef.equals(temp._seqRef))) @@ -204,34 +87,6 @@ implements java.io.Serializable } else if (temp._seqRef != 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._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._provenance != null) { if (temp._provenance == null) return false; else if (!(this._provenance.equals(temp._provenance))) @@ -245,98 +100,6 @@ implements java.io.Serializable } //-- boolean equals(java.lang.Object) /** - * Method getAnnotationElement - * - * - * - * @param index - * @return AnnotationElement - */ - public org.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 (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index); - } //-- org.vamsas.objects.core.AnnotationElement getAnnotationElement(int) - - /** - * Method getAnnotationElement - * - * - * - * @return AnnotationElement - */ - public org.vamsas.objects.core.AnnotationElement[] getAnnotationElement() - { - int size = _annotationElementList.size(); - org.vamsas.objects.core.AnnotationElement[] mArray = new org.vamsas.objects.core.AnnotationElement[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index); - } - return mArray; - } //-- org.vamsas.objects.core.AnnotationElement[] getAnnotationElement() - - /** - * Method getAnnotationElementCount - * - * - * - * @return int - */ - public int getAnnotationElementCount() - { - return _annotationElementList.size(); - } //-- int getAnnotationElementCount() - - /** - * Returns the value of field 'begin'. - * - * @return int - * @return the value of field 'begin'. - */ - public int getBegin() - { - return this._begin; - } //-- int getBegin() - - /** - * Returns the value of field 'description'. - * - * @return String - * @return the value of field 'description'. - */ - public java.lang.String getDescription() - { - return this._description; - } //-- java.lang.String getDescription() - - /** - * Returns the value of field 'end'. - * - * @return int - * @return the value of field 'end'. - */ - public int getEnd() - { - return this._end; - } //-- int getEnd() - - /** - * Returns the value of field 'id'. - * - * @return String - * @return the value of field 'id'. - */ - public java.lang.String getId() - { - return this._id; - } //-- java.lang.String getId() - - /** * Returns the value of field 'provenance'. * * @return Provenance @@ -348,7 +111,11 @@ implements java.io.Serializable } //-- org.vamsas.objects.core.Provenance getProvenance() /** - * Returns the value of field 'seqRef'. + * 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'. @@ -359,52 +126,6 @@ implements java.io.Serializable } //-- java.lang.Object getSeqRef() /** - * Returns the value of field 'status'. - * - * @return String - * @return the value of field 'status'. - */ - public java.lang.String getStatus() - { - return this._status; - } //-- java.lang.String getStatus() - - /** - * Returns the value of field 'type'. - * - * @return String - * @return the value of field 'type'. - */ - public java.lang.String getType() - { - return this._type; - } //-- java.lang.String getType() - - /** - * Method hasBegin - * - * - * - * @return boolean - */ - public boolean hasBegin() - { - return this._has_begin; - } //-- boolean hasBegin() - - /** - * Method hasEnd - * - * - * - * @return boolean - */ - public boolean hasEnd() - { - return this._has_end; - } //-- boolean hasEnd() - - /** * Method isValid * * @@ -451,106 +172,6 @@ implements java.io.Serializable } //-- void marshal(org.xml.sax.ContentHandler) /** - * Method removeAllAnnotationElement - * - */ - public void removeAllAnnotationElement() - { - _annotationElementList.removeAllElements(); - } //-- void removeAllAnnotationElement() - - /** - * Method removeAnnotationElement - * - * - * - * @param index - * @return AnnotationElement - */ - public org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index) - { - java.lang.Object obj = _annotationElementList.elementAt(index); - _annotationElementList.removeElementAt(index); - return (org.vamsas.objects.core.AnnotationElement) obj; - } //-- org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int) - - /** - * Method setAnnotationElement - * - * - * - * @param index - * @param vAnnotationElement - */ - public void setAnnotationElement(int index, org.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, org.vamsas.objects.core.AnnotationElement) - - /** - * Method setAnnotationElement - * - * - * - * @param annotationElementArray - */ - public void setAnnotationElement(org.vamsas.objects.core.AnnotationElement[] annotationElementArray) - { - //-- copy array - _annotationElementList.removeAllElements(); - for (int i = 0; i < annotationElementArray.length; i++) { - _annotationElementList.addElement(annotationElementArray[i]); - } - } //-- void setAnnotationElement(org.vamsas.objects.core.AnnotationElement) - - /** - * Sets the value of field 'begin'. - * - * @param begin the value of field 'begin'. - */ - public void setBegin(int begin) - { - this._begin = begin; - this._has_begin = true; - } //-- void setBegin(int) - - /** - * Sets the value of field 'description'. - * - * @param description the value of field 'description'. - */ - public void setDescription(java.lang.String description) - { - this._description = description; - } //-- void setDescription(java.lang.String) - - /** - * Sets the value of field 'end'. - * - * @param end the value of field 'end'. - */ - public void setEnd(int end) - { - this._end = end; - this._has_end = true; - } //-- void setEnd(int) - - /** - * Sets the value of field 'id'. - * - * @param id the value of field 'id'. - */ - public void setId(java.lang.String id) - { - this._id = id; - } //-- void setId(java.lang.String) - - /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. @@ -561,7 +182,11 @@ implements java.io.Serializable } //-- void setProvenance(org.vamsas.objects.core.Provenance) /** - * Sets the value of field 'seqRef'. + * 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'. */ @@ -571,38 +196,18 @@ implements java.io.Serializable } //-- void setSeqRef(java.lang.Object) /** - * Sets the value of field 'status'. - * - * @param status the value of field 'status'. - */ - public void setStatus(java.lang.String status) - { - this._status = status; - } //-- void setStatus(java.lang.String) - - /** - * Sets the value of field 'type'. - * - * @param type the value of field 'type'. - */ - public void setType(java.lang.String type) - { - this._type = type; - } //-- void setType(java.lang.String) - - /** * Method unmarshal * * * * @param reader - * @return DataSetAnnotations + * @return RangeType */ - public static org.vamsas.objects.core.DataSetAnnotations unmarshal(java.io.Reader reader) + public static org.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (org.vamsas.objects.core.DataSetAnnotations) Unmarshaller.unmarshal(org.vamsas.objects.core.DataSetAnnotations.class, reader); - } //-- org.vamsas.objects.core.DataSetAnnotations unmarshal(java.io.Reader) + } //-- org.vamsas.objects.core.RangeType unmarshal(java.io.Reader) /** * Method validate diff --git a/src/org/vamsas/objects/core/DataSetAnnotationsDescriptor.java b/src/org/vamsas/objects/core/DataSetAnnotationsDescriptor.java index cd77bea..a8b2741 100644 --- a/src/org/vamsas/objects/core/DataSetAnnotationsDescriptor.java +++ b/src/org/vamsas/objects/core/DataSetAnnotationsDescriptor.java @@ -21,7 +21,7 @@ import org.exolab.castor.xml.validators.*; * * @version $Revision$ $Date$ */ -public class DataSetAnnotationsDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { +public class DataSetAnnotationsDescriptor extends org.vamsas.objects.core.RangeAnnotationDescriptor { //--------------------------/ @@ -56,6 +56,7 @@ public class DataSetAnnotationsDescriptor extends org.exolab.castor.xml.util.XML public DataSetAnnotationsDescriptor() { super(); + setExtendsWithoutFlatten(new org.vamsas.objects.core.RangeAnnotationDescriptor()); nsURI = "http://www.vamsas.org"; xmlName = "DataSetAnnotations"; @@ -66,129 +67,6 @@ public class DataSetAnnotationsDescriptor extends org.exolab.castor.xml.util.XML org.exolab.castor.xml.FieldValidator fieldValidator = null; //-- initialize attribute descriptors - //-- _type - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", org.exolab.castor.xml.NodeType.Attribute); - desc.setImmutable(true); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - DataSetAnnotations target = (DataSetAnnotations) object; - return target.getType(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - DataSetAnnotations target = (DataSetAnnotations) 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); - //-- _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 - { - DataSetAnnotations target = (DataSetAnnotations) 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 { - DataSetAnnotations target = (DataSetAnnotations) 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); - //-- _begin - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_begin", "begin", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - DataSetAnnotations target = (DataSetAnnotations) object; - if(!target.hasBegin()) - return null; - return new java.lang.Integer(target.getBegin()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - DataSetAnnotations target = (DataSetAnnotations) object; - // ignore null values for non optional primitives - if (value == null) return; - - target.setBegin( ((java.lang.Integer)value).intValue()); - } - catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance( java.lang.Object parent ) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _begin - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - IntegerValidator typeValidator = new IntegerValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); //-- _seqRef desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_seqRef", "seqRef", org.exolab.castor.xml.NodeType.Attribute); desc.setReference(true); @@ -225,153 +103,8 @@ public class DataSetAnnotationsDescriptor extends org.exolab.castor.xml.util.XML { //-- 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 - { - DataSetAnnotations target = (DataSetAnnotations) object; - return target.getId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - DataSetAnnotations target = (DataSetAnnotations) 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 - { - DataSetAnnotations target = (DataSetAnnotations) object; - return target.getDescription(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - DataSetAnnotations target = (DataSetAnnotations) 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 - { - DataSetAnnotations target = (DataSetAnnotations) object; - return target.getStatus(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - DataSetAnnotations target = (DataSetAnnotations) 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(org.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 - { - DataSetAnnotations target = (DataSetAnnotations) object; - return target.getAnnotationElement(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - DataSetAnnotations target = (DataSetAnnotations) object; - target.addAnnotationElement( (org.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 org.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); //-- _provenance desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element); handler = new org.exolab.castor.xml.XMLFieldHandler() { @@ -436,7 +169,7 @@ public class DataSetAnnotationsDescriptor extends org.exolab.castor.xml.util.XML */ public org.exolab.castor.mapping.ClassDescriptor getExtends() { - return null; + return super.getExtends(); } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() /** @@ -448,6 +181,8 @@ public class DataSetAnnotationsDescriptor extends org.exolab.castor.xml.util.XML */ public org.exolab.castor.mapping.FieldDescriptor getIdentity() { + if (identity == null) + return super.getIdentity(); return identity; } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() diff --git a/src/org/vamsas/objects/core/DbRef.java b/src/org/vamsas/objects/core/DbRef.java index 8666d71..bf5541d 100644 --- a/src/org/vamsas/objects/core/DbRef.java +++ b/src/org/vamsas/objects/core/DbRef.java @@ -15,6 +15,8 @@ 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; @@ -22,7 +24,13 @@ import org.exolab.castor.xml.ValidationException; import org.xml.sax.ContentHandler; /** - * Class DbRef. + * Store a list of database + * references for this + * sequence record - with + * optional mapping from + * database sequence to the + * given sequence record + * * * @version $Revision$ $Date$ */ @@ -36,25 +44,65 @@ implements java.io.Serializable //--------------------------/ /** - * Field _source + * 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; /** - * Field _version + * Version must be + * specified - + * */ private java.lang.String _version; /** - * Field _accessionId + * 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; /** - * Field _id + * Primary Key for + * vamsas object + * referencing + * */ private java.lang.String _id; + /** + * Field _mapList + */ + private java.util.Vector _mapList; + + /** + * Field _linkList + */ + private java.util.Vector _linkList; + + /** + * Field _propertyList + */ + private java.util.Vector _propertyList; + //----------------/ //- Constructors -/ @@ -63,6 +111,9 @@ implements java.io.Serializable public DbRef() { super(); + _mapList = new Vector(); + _linkList = new Vector(); + _propertyList = new Vector(); } //-- org.vamsas.objects.core.DbRef() @@ -71,6 +122,123 @@ implements java.io.Serializable //-----------/ /** + * Method addLink + * + * + * + * @param vLink + */ + public void addLink(org.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException + { + _linkList.addElement(vLink); + } //-- void addLink(org.vamsas.objects.core.Link) + + /** + * Method addLink + * + * + * + * @param index + * @param vLink + */ + public void addLink(int index, org.vamsas.objects.core.Link vLink) + throws java.lang.IndexOutOfBoundsException + { + _linkList.insertElementAt(vLink, index); + } //-- void addLink(int, org.vamsas.objects.core.Link) + + /** + * Method addMap + * + * + * + * @param vMap + */ + public void addMap(org.vamsas.objects.core.Map vMap) + throws java.lang.IndexOutOfBoundsException + { + _mapList.addElement(vMap); + } //-- void addMap(org.vamsas.objects.core.Map) + + /** + * Method addMap + * + * + * + * @param index + * @param vMap + */ + public void addMap(int index, org.vamsas.objects.core.Map vMap) + throws java.lang.IndexOutOfBoundsException + { + _mapList.insertElementAt(vMap, index); + } //-- void addMap(int, org.vamsas.objects.core.Map) + + /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(org.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, org.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 @@ -115,13 +283,45 @@ implements java.io.Serializable } 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'. + * 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'. @@ -132,7 +332,11 @@ implements java.io.Serializable } //-- java.lang.String getAccessionId() /** - * Returns the value of field 'id'. + * 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'. @@ -143,7 +347,162 @@ implements java.io.Serializable } //-- java.lang.String getId() /** - * Returns the value of field 'source'. + * Method getLink + * + * + * + * @param index + * @return Link + */ + public org.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 (org.vamsas.objects.core.Link) _linkList.elementAt(index); + } //-- org.vamsas.objects.core.Link getLink(int) + + /** + * Method getLink + * + * + * + * @return Link + */ + public org.vamsas.objects.core.Link[] getLink() + { + int size = _linkList.size(); + org.vamsas.objects.core.Link[] mArray = new org.vamsas.objects.core.Link[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Link) _linkList.elementAt(index); + } + return mArray; + } //-- org.vamsas.objects.core.Link[] getLink() + + /** + * Method getLinkCount + * + * + * + * @return int + */ + public int getLinkCount() + { + return _linkList.size(); + } //-- int getLinkCount() + + /** + * Method getMap + * + * + * + * @param index + * @return Map + */ + public org.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 (org.vamsas.objects.core.Map) _mapList.elementAt(index); + } //-- org.vamsas.objects.core.Map getMap(int) + + /** + * Method getMap + * + * + * + * @return Map + */ + public org.vamsas.objects.core.Map[] getMap() + { + int size = _mapList.size(); + org.vamsas.objects.core.Map[] mArray = new org.vamsas.objects.core.Map[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Map) _mapList.elementAt(index); + } + return mArray; + } //-- org.vamsas.objects.core.Map[] getMap() + + /** + * Method getMapCount + * + * + * + * @return int + */ + public int getMapCount() + { + return _mapList.size(); + } //-- int getMapCount() + + /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public org.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 (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- org.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public org.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- org.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'. @@ -154,7 +513,10 @@ implements java.io.Serializable } //-- java.lang.String getSource() /** - * Returns the value of field 'version'. + * 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'. @@ -211,7 +573,90 @@ implements java.io.Serializable } //-- void marshal(org.xml.sax.ContentHandler) /** - * Sets the value of field 'accessionId'. + * 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 org.vamsas.objects.core.Link removeLink(int index) + { + java.lang.Object obj = _linkList.elementAt(index); + _linkList.removeElementAt(index); + return (org.vamsas.objects.core.Link) obj; + } //-- org.vamsas.objects.core.Link removeLink(int) + + /** + * Method removeMap + * + * + * + * @param index + * @return Map + */ + public org.vamsas.objects.core.Map removeMap(int index) + { + java.lang.Object obj = _mapList.elementAt(index); + _mapList.removeElementAt(index); + return (org.vamsas.objects.core.Map) obj; + } //-- org.vamsas.objects.core.Map removeMap(int) + + /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public org.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (org.vamsas.objects.core.Property) obj; + } //-- org.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'. */ @@ -221,7 +666,11 @@ implements java.io.Serializable } //-- void setAccessionId(java.lang.String) /** - * Sets the value of field 'id'. + * 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'. */ @@ -231,7 +680,120 @@ implements java.io.Serializable } //-- void setId(java.lang.String) /** - * Sets the value of field 'source'. + * Method setLink + * + * + * + * @param index + * @param vLink + */ + public void setLink(int index, org.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, org.vamsas.objects.core.Link) + + /** + * Method setLink + * + * + * + * @param linkArray + */ + public void setLink(org.vamsas.objects.core.Link[] linkArray) + { + //-- copy array + _linkList.removeAllElements(); + for (int i = 0; i < linkArray.length; i++) { + _linkList.addElement(linkArray[i]); + } + } //-- void setLink(org.vamsas.objects.core.Link) + + /** + * Method setMap + * + * + * + * @param index + * @param vMap + */ + public void setMap(int index, org.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, org.vamsas.objects.core.Map) + + /** + * Method setMap + * + * + * + * @param mapArray + */ + public void setMap(org.vamsas.objects.core.Map[] mapArray) + { + //-- copy array + _mapList.removeAllElements(); + for (int i = 0; i < mapArray.length; i++) { + _mapList.addElement(mapArray[i]); + } + } //-- void setMap(org.vamsas.objects.core.Map) + + /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, org.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, org.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(org.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(org.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'. */ @@ -241,7 +803,10 @@ implements java.io.Serializable } //-- void setSource(java.lang.String) /** - * Sets the value of field 'version'. + * Sets the value of field 'version'. The field 'version' has + * the following description: Version must be + * specified - + * * * @param version the value of field 'version'. */ diff --git a/src/org/vamsas/objects/core/DbRefDescriptor.java b/src/org/vamsas/objects/core/DbRefDescriptor.java index bc4d6df..fdb9238 100644 --- a/src/org/vamsas/objects/core/DbRefDescriptor.java +++ b/src/org/vamsas/objects/core/DbRefDescriptor.java @@ -58,6 +58,9 @@ public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescript 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; @@ -89,11 +92,13 @@ public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescript } }; 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"); @@ -126,11 +131,13 @@ public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescript } }; 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"); @@ -163,11 +170,13 @@ public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescript } }; 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"); @@ -210,6 +219,111 @@ public class DbRefDescriptor extends org.exolab.castor.xml.util.XMLClassDescript desc.setValidator(fieldValidator); //-- initialize element descriptors + //-- _mapList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.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( (org.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 org.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(org.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( (org.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 org.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(org.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( (org.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 org.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); } //-- org.vamsas.objects.core.DbRefDescriptor() diff --git a/src/org/vamsas/objects/core/Entry.java b/src/org/vamsas/objects/core/Entry.java index 0efa17f..699e20f 100644 --- a/src/org/vamsas/objects/core/Entry.java +++ b/src/org/vamsas/objects/core/Entry.java @@ -15,6 +15,8 @@ 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; @@ -36,25 +38,55 @@ implements java.io.Serializable //--------------------------/ /** - * Field _id + * Primary Key for vamsas object + * referencing + * */ private java.lang.String _id; /** - * Field _user + * Who + * */ private java.lang.String _user; /** - * Field _action + * With which application + * + */ + private java.lang.String _app; + + /** + * Did what + * */ private java.lang.String _action; /** - * Field _date + * 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 -/ @@ -63,6 +95,9 @@ implements java.io.Serializable public Entry() { super(); + _propertyList = new Vector(); + _paramList = new Vector(); + _inputList = new Vector(); } //-- org.vamsas.objects.core.Entry() @@ -71,6 +106,123 @@ implements java.io.Serializable //-----------/ /** + * Method addInput + * + * + * + * @param vInput + */ + public void addInput(org.vamsas.objects.core.Input vInput) + throws java.lang.IndexOutOfBoundsException + { + _inputList.addElement(vInput); + } //-- void addInput(org.vamsas.objects.core.Input) + + /** + * Method addInput + * + * + * + * @param index + * @param vInput + */ + public void addInput(int index, org.vamsas.objects.core.Input vInput) + throws java.lang.IndexOutOfBoundsException + { + _inputList.insertElementAt(vInput, index); + } //-- void addInput(int, org.vamsas.objects.core.Input) + + /** + * Method addParam + * + * + * + * @param vParam + */ + public void addParam(org.vamsas.objects.core.Param vParam) + throws java.lang.IndexOutOfBoundsException + { + _paramList.addElement(vParam); + } //-- void addParam(org.vamsas.objects.core.Param) + + /** + * Method addParam + * + * + * + * @param index + * @param vParam + */ + public void addParam(int index, org.vamsas.objects.core.Param vParam) + throws java.lang.IndexOutOfBoundsException + { + _paramList.insertElementAt(vParam, index); + } //-- void addParam(int, org.vamsas.objects.core.Param) + + /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(org.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, org.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 @@ -101,6 +253,13 @@ implements java.io.Serializable } 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))) @@ -115,13 +274,36 @@ implements java.io.Serializable } 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'. + * Returns the value of field 'action'. The field 'action' has + * the following description: Did what + * * * @return String * @return the value of field 'action'. @@ -132,7 +314,22 @@ implements java.io.Serializable } //-- java.lang.String getAction() /** - * Returns the value of field 'date'. + * 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'. @@ -143,7 +340,10 @@ implements java.io.Serializable } //-- org.exolab.castor.types.Date getDate() /** - * Returns the value of field 'id'. + * 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'. @@ -154,7 +354,153 @@ implements java.io.Serializable } //-- java.lang.String getId() /** - * Returns the value of field 'user'. + * Method getInput + * + * + * + * @param index + * @return Input + */ + public org.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 (org.vamsas.objects.core.Input) _inputList.elementAt(index); + } //-- org.vamsas.objects.core.Input getInput(int) + + /** + * Method getInput + * + * + * + * @return Input + */ + public org.vamsas.objects.core.Input[] getInput() + { + int size = _inputList.size(); + org.vamsas.objects.core.Input[] mArray = new org.vamsas.objects.core.Input[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Input) _inputList.elementAt(index); + } + return mArray; + } //-- org.vamsas.objects.core.Input[] getInput() + + /** + * Method getInputCount + * + * + * + * @return int + */ + public int getInputCount() + { + return _inputList.size(); + } //-- int getInputCount() + + /** + * Method getParam + * + * + * + * @param index + * @return Param + */ + public org.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 (org.vamsas.objects.core.Param) _paramList.elementAt(index); + } //-- org.vamsas.objects.core.Param getParam(int) + + /** + * Method getParam + * + * + * + * @return Param + */ + public org.vamsas.objects.core.Param[] getParam() + { + int size = _paramList.size(); + org.vamsas.objects.core.Param[] mArray = new org.vamsas.objects.core.Param[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Param) _paramList.elementAt(index); + } + return mArray; + } //-- org.vamsas.objects.core.Param[] getParam() + + /** + * Method getParamCount + * + * + * + * @return int + */ + public int getParamCount() + { + return _paramList.size(); + } //-- int getParamCount() + + /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public org.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 (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- org.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public org.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- org.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'. @@ -211,7 +557,81 @@ implements java.io.Serializable } //-- void marshal(org.xml.sax.ContentHandler) /** - * Sets the value of field 'action'. + * 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 org.vamsas.objects.core.Input removeInput(int index) + { + java.lang.Object obj = _inputList.elementAt(index); + _inputList.removeElementAt(index); + return (org.vamsas.objects.core.Input) obj; + } //-- org.vamsas.objects.core.Input removeInput(int) + + /** + * Method removeParam + * + * + * + * @param index + * @return Param + */ + public org.vamsas.objects.core.Param removeParam(int index) + { + java.lang.Object obj = _paramList.elementAt(index); + _paramList.removeElementAt(index); + return (org.vamsas.objects.core.Param) obj; + } //-- org.vamsas.objects.core.Param removeParam(int) + + /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public org.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (org.vamsas.objects.core.Property) obj; + } //-- org.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'. */ @@ -221,7 +641,21 @@ implements java.io.Serializable } //-- void setAction(java.lang.String) /** - * Sets the value of field 'date'. + * 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'. */ @@ -231,7 +665,10 @@ implements java.io.Serializable } //-- void setDate(org.exolab.castor.types.Date) /** - * Sets the value of field 'id'. + * 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'. */ @@ -241,7 +678,111 @@ implements java.io.Serializable } //-- void setId(java.lang.String) /** - * Sets the value of field 'user'. + * Method setInput + * + * + * + * @param index + * @param vInput + */ + public void setInput(int index, org.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, org.vamsas.objects.core.Input) + + /** + * Method setInput + * + * + * + * @param inputArray + */ + public void setInput(org.vamsas.objects.core.Input[] inputArray) + { + //-- copy array + _inputList.removeAllElements(); + for (int i = 0; i < inputArray.length; i++) { + _inputList.addElement(inputArray[i]); + } + } //-- void setInput(org.vamsas.objects.core.Input) + + /** + * Method setParam + * + * + * + * @param index + * @param vParam + */ + public void setParam(int index, org.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, org.vamsas.objects.core.Param) + + /** + * Method setParam + * + * + * + * @param paramArray + */ + public void setParam(org.vamsas.objects.core.Param[] paramArray) + { + //-- copy array + _paramList.removeAllElements(); + for (int i = 0; i < paramArray.length; i++) { + _paramList.addElement(paramArray[i]); + } + } //-- void setParam(org.vamsas.objects.core.Param) + + /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, org.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, org.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(org.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(org.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'. */ diff --git a/src/org/vamsas/objects/core/EntryDescriptor.java b/src/org/vamsas/objects/core/EntryDescriptor.java index 718b4be..0426fa4 100644 --- a/src/org/vamsas/objects/core/EntryDescriptor.java +++ b/src/org/vamsas/objects/core/EntryDescriptor.java @@ -142,6 +142,46 @@ public class EntryDescriptor extends org.exolab.castor.xml.util.XMLClassDescript 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); @@ -220,6 +260,111 @@ public class EntryDescriptor extends org.exolab.castor.xml.util.XMLClassDescript fieldValidator.setValidator(typeValidator); } desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.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( (org.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 org.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(org.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( (org.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 org.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(org.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( (org.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 org.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); } //-- org.vamsas.objects.core.EntryDescriptor() diff --git a/src/org/vamsas/objects/core/Glyph.java b/src/org/vamsas/objects/core/Glyph.java new file mode 100644 index 0000000..0340435 --- /dev/null +++ b/src/org/vamsas/objects/core/Glyph.java @@ -0,0 +1,247 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.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"); + } //-- org.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 org.vamsas.objects.core.Glyph unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Glyph) Unmarshaller.unmarshal(org.vamsas.objects.core.Glyph.class, reader); + } //-- org.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/org/vamsas/objects/core/GlyphDescriptor.java b/src/org/vamsas/objects/core/GlyphDescriptor.java new file mode 100644 index 0000000..9ee3c8c --- /dev/null +++ b/src/org/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 org.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 + + } //-- org.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 org.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/org/vamsas/objects/core/Input.java b/src/org/vamsas/objects/core/Input.java new file mode 100644 index 0000000..9b737dd --- /dev/null +++ b/src/org/vamsas/objects/core/Input.java @@ -0,0 +1,220 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.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(); + } //-- org.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 org.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Input) Unmarshaller.unmarshal(org.vamsas.objects.core.Input.class, reader); + } //-- org.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/org/vamsas/objects/core/InputDescriptor.java b/src/org/vamsas/objects/core/InputDescriptor.java new file mode 100644 index 0000000..e4d1130 --- /dev/null +++ b/src/org/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 org.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 org.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 org.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 + + } //-- org.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 org.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/org/vamsas/objects/core/Instance.java b/src/org/vamsas/objects/core/Instance.java new file mode 100644 index 0000000..56193ef --- /dev/null +++ b/src/org/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 org.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 org.vamsas.objects.core.AppData +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _urn + */ + private java.lang.String _urn; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Instance() + { + super(); + } //-- org.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 org.vamsas.objects.core.AppData unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Instance) Unmarshaller.unmarshal(org.vamsas.objects.core.Instance.class, reader); + } //-- org.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/org/vamsas/objects/core/InstanceDescriptor.java b/src/org/vamsas/objects/core/InstanceDescriptor.java new file mode 100644 index 0000000..ad7297d --- /dev/null +++ b/src/org/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 org.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 org.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 org.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 + + } //-- org.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 org.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/org/vamsas/objects/core/Link.java b/src/org/vamsas/objects/core/Link.java new file mode 100644 index 0000000..44ea986 --- /dev/null +++ b/src/org/vamsas/objects/core/Link.java @@ -0,0 +1,141 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 Uri +implements java.io.Serializable +{ + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Link() + { + super(); + } //-- org.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; + 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 Link + */ + public static org.vamsas.objects.core.Link unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Link) Unmarshaller.unmarshal(org.vamsas.objects.core.Link.class, reader); + } //-- org.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/org/vamsas/objects/core/LinkDescriptor.java b/src/org/vamsas/objects/core/LinkDescriptor.java new file mode 100644 index 0000000..b0924b3 --- /dev/null +++ b/src/org/vamsas/objects/core/LinkDescriptor.java @@ -0,0 +1,167 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 UriDescriptor { + + + //--------------------------/ + //- 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(); + setExtendsWithoutFlatten(new UriDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "link"; + } //-- org.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 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 org.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/org/vamsas/objects/core/Map.java b/src/org/vamsas/objects/core/Map.java new file mode 100644 index 0000000..d0722a8 --- /dev/null +++ b/src/org/vamsas/objects/core/Map.java @@ -0,0 +1,550 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 Map. + * + * @version $Revision$ $Date$ + */ +public class Map extends org.vamsas.client.Vobject +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Offset + * to + * first + * position + * in + * dataset + * sequence + * record + * that + * this + * database + * entry + * 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 + * this + * database + * entry + * maps + * to + * + */ + private int _to = 0; + + /** + * keeps track of state for field: _to + */ + private boolean _has_to; + + /** + * Offset + * to first + * last + * 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 Map() + { + super(); + } //-- org.vamsas.objects.core.Map() + + + //-----------/ + //- 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 Map) { + + Map temp = (Map)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 + * this + * database + * entry + * 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 + * last + * 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 + * this + * database + * entry + * 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 + * this + * database + * entry + * 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 + * last + * 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 + * this + * database + * entry + * 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 Map + */ + public static org.vamsas.objects.core.Map unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Map) Unmarshaller.unmarshal(org.vamsas.objects.core.Map.class, reader); + } //-- org.vamsas.objects.core.Map 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/org/vamsas/objects/core/MapDescriptor.java b/src/org/vamsas/objects/core/MapDescriptor.java new file mode 100644 index 0000000..d8e2980 --- /dev/null +++ b/src/org/vamsas/objects/core/MapDescriptor.java @@ -0,0 +1,339 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 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 MapDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "map"; + 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 + { + Map target = (Map) 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 { + Map target = (Map) 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 + { + Map target = (Map) 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 { + Map target = (Map) 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 + { + Map target = (Map) 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 { + Map target = (Map) 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 + { + Map target = (Map) 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 { + Map target = (Map) 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 + + } //-- org.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 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 org.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/org/vamsas/objects/core/Newick.java b/src/org/vamsas/objects/core/Newick.java index 58b2f6e..23c6891 100644 --- a/src/org/vamsas/objects/core/Newick.java +++ b/src/org/vamsas/objects/core/Newick.java @@ -46,10 +46,26 @@ implements java.io.Serializable private java.lang.String _title; /** - * Field _id + * Primary Key for vamsas + * object referencing + * */ private java.lang.String _id; + /** + * objects with + * modifiable=false will not be + * modified by a vamsas client + * update + * + */ + private boolean _modifiable = true; + + /** + * keeps track of state for field: _modifiable + */ + private boolean _has_modifiable; + //----------------/ //- Constructors -/ @@ -67,6 +83,15 @@ implements java.io.Serializable //-----------/ /** + * Method deleteModifiable + * + */ + public void deleteModifiable() + { + this._has_modifiable= false; + } //-- void deleteModifiable() + + /** * Note: hashCode() has not been overriden * * @param obj @@ -104,6 +129,10 @@ implements java.io.Serializable } else if (temp._id != null) return false; + if (this._modifiable != temp._modifiable) + return false; + if (this._has_modifiable != temp._has_modifiable) + return false; return true; } return false; @@ -122,7 +151,10 @@ implements java.io.Serializable } //-- java.lang.String getContent() /** - * Returns the value of field 'id'. + * 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'. @@ -133,6 +165,22 @@ implements java.io.Serializable } //-- java.lang.String getId() /** + * Returns the value of field 'modifiable'. The field + * 'modifiable' has the following description: objects with + * modifiable=false will not be + * modified by a vamsas client + * update + * + * + * @return boolean + * @return the value of field 'modifiable'. + */ + public boolean getModifiable() + { + return this._modifiable; + } //-- boolean getModifiable() + + /** * Returns the value of field 'title'. * * @return String @@ -144,6 +192,18 @@ implements java.io.Serializable } //-- java.lang.String getTitle() /** + * Method hasModifiable + * + * + * + * @return boolean + */ + public boolean hasModifiable() + { + return this._has_modifiable; + } //-- boolean hasModifiable() + + /** * Method isValid * * @@ -201,7 +261,10 @@ implements java.io.Serializable } //-- void setContent(java.lang.String) /** - * Sets the value of field 'id'. + * 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'. */ @@ -211,6 +274,22 @@ implements java.io.Serializable } //-- void setId(java.lang.String) /** + * Sets the value of field 'modifiable'. The field 'modifiable' + * has the following description: objects with + * modifiable=false will not be + * modified by a vamsas client + * update + * + * + * @param modifiable the value of field 'modifiable'. + */ + public void setModifiable(boolean modifiable) + { + this._modifiable = modifiable; + this._has_modifiable = true; + } //-- void setModifiable(boolean) + + /** * Sets the value of field 'title'. * * @param title the value of field 'title'. diff --git a/src/org/vamsas/objects/core/NewickDescriptor.java b/src/org/vamsas/objects/core/NewickDescriptor.java index ee208f6..2882b82 100644 --- a/src/org/vamsas/objects/core/NewickDescriptor.java +++ b/src/org/vamsas/objects/core/NewickDescriptor.java @@ -170,6 +170,48 @@ public class NewickDescriptor extends org.exolab.castor.xml.util.XMLClassDescrip { //-- local scope } desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Newick target = (Newick) object; + if(!target.hasModifiable()) + return null; + return (target.getModifiable() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Newick target = (Newick) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteModifiable(); + return; + } + target.setModifiable( ((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: _modifiable + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); //-- initialize element descriptors } //-- org.vamsas.objects.core.NewickDescriptor() diff --git a/src/org/vamsas/objects/core/Param.java b/src/org/vamsas/objects/core/Param.java new file mode 100644 index 0000000..68ee98f --- /dev/null +++ b/src/org/vamsas/objects/core/Param.java @@ -0,0 +1,267 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.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(""); + } //-- org.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 org.vamsas.objects.core.Param unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Param) Unmarshaller.unmarshal(org.vamsas.objects.core.Param.class, reader); + } //-- org.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/org/vamsas/objects/core/ParamDescriptor.java b/src/org/vamsas/objects/core/ParamDescriptor.java new file mode 100644 index 0000000..565f497 --- /dev/null +++ b/src/org/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 org.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 + + } //-- org.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 org.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/org/vamsas/objects/core/Pos.java b/src/org/vamsas/objects/core/Pos.java new file mode 100644 index 0000000..a59146d --- /dev/null +++ b/src/org/vamsas/objects/core/Pos.java @@ -0,0 +1,205 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.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(); + } //-- org.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 org.vamsas.objects.core.Pos unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Pos) Unmarshaller.unmarshal(org.vamsas.objects.core.Pos.class, reader); + } //-- org.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/org/vamsas/objects/core/PosDescriptor.java b/src/org/vamsas/objects/core/PosDescriptor.java new file mode 100644 index 0000000..273f1ee --- /dev/null +++ b/src/org/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 org.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 + + } //-- org.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 org.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/org/vamsas/objects/core/Property.java b/src/org/vamsas/objects/core/Property.java new file mode 100644 index 0000000..1b52866 --- /dev/null +++ b/src/org/vamsas/objects/core/Property.java @@ -0,0 +1,267 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.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(""); + } //-- org.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 org.vamsas.objects.core.Property unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Property) Unmarshaller.unmarshal(org.vamsas.objects.core.Property.class, reader); + } //-- org.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/org/vamsas/objects/core/PropertyDescriptor.java b/src/org/vamsas/objects/core/PropertyDescriptor.java new file mode 100644 index 0000000..6d4f84c --- /dev/null +++ b/src/org/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 org.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 + + } //-- org.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 org.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/org/vamsas/objects/core/RangeAnnotation.java b/src/org/vamsas/objects/core/RangeAnnotation.java new file mode 100644 index 0000000..355b974 --- /dev/null +++ b/src/org/vamsas/objects/core/RangeAnnotation.java @@ -0,0 +1,1131 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.vamsas.objects.core.RangeType +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Primary Key for vamsas object referencing + * + */ + private java.lang.String _id; + + /** + * objects with modifiable=false will not be + * modified by a vamsas client update + * + */ + private boolean _modifiable = true; + + /** + * keeps track of state for field: _modifiable + */ + private boolean _has_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 _urlList + */ + private java.util.Vector _urlList; + + /** + * 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(); + _urlList = new Vector(); + _propertyList = new Vector(); + } //-- org.vamsas.objects.core.RangeAnnotation() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addAnnotationElement + * + * + * + * @param vAnnotationElement + */ + public void addAnnotationElement(org.vamsas.objects.core.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + _annotationElementList.addElement(vAnnotationElement); + } //-- void addAnnotationElement(org.vamsas.objects.core.AnnotationElement) + + /** + * Method addAnnotationElement + * + * + * + * @param index + * @param vAnnotationElement + */ + public void addAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + _annotationElementList.insertElementAt(vAnnotationElement, index); + } //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement) + + /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(org.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, org.vamsas.objects.core.Property) + + /** + * Method addScore + * + * + * + * @param vScore + */ + public void addScore(org.vamsas.objects.core.Score vScore) + throws java.lang.IndexOutOfBoundsException + { + _scoreList.addElement(vScore); + } //-- void addScore(org.vamsas.objects.core.Score) + + /** + * Method addScore + * + * + * + * @param index + * @param vScore + */ + public void addScore(int index, org.vamsas.objects.core.Score vScore) + throws java.lang.IndexOutOfBoundsException + { + _scoreList.insertElementAt(vScore, index); + } //-- void addScore(int, org.vamsas.objects.core.Score) + + /** + * Method addUrl + * + * + * + * @param vUrl + */ + public void addUrl(org.vamsas.objects.core.Url vUrl) + throws java.lang.IndexOutOfBoundsException + { + _urlList.addElement(vUrl); + } //-- void addUrl(org.vamsas.objects.core.Url) + + /** + * Method addUrl + * + * + * + * @param index + * @param vUrl + */ + public void addUrl(int index, org.vamsas.objects.core.Url vUrl) + throws java.lang.IndexOutOfBoundsException + { + _urlList.insertElementAt(vUrl, index); + } //-- void addUrl(int, org.vamsas.objects.core.Url) + + /** + * Method deleteModifiable + * + */ + public void deleteModifiable() + { + this._has_modifiable= false; + } //-- void deleteModifiable() + + /** + * Method enumerateAnnotationElement + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAnnotationElement() + { + return _annotationElementList.elements(); + } //-- java.util.Enumeration enumerateAnnotationElement() + + /** + * 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() + + /** + * Method enumerateUrl + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateUrl() + { + return _urlList.elements(); + } //-- java.util.Enumeration enumerateUrl() + + /** + * 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 != temp._modifiable) + return false; + if (this._has_modifiable != temp._has_modifiable) + 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._urlList != null) { + if (temp._urlList == null) return false; + else if (!(this._urlList.equals(temp._urlList))) + return false; + } + else if (temp._urlList != 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 org.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 (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index); + } //-- org.vamsas.objects.core.AnnotationElement getAnnotationElement(int) + + /** + * Method getAnnotationElement + * + * + * + * @return AnnotationElement + */ + public org.vamsas.objects.core.AnnotationElement[] getAnnotationElement() + { + int size = _annotationElementList.size(); + org.vamsas.objects.core.AnnotationElement[] mArray = new org.vamsas.objects.core.AnnotationElement[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index); + } + return mArray; + } //-- org.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() + + /** + * Returns the value of field 'modifiable'. The field + * 'modifiable' has the following description: objects with + * modifiable=false will not be + * modified by a vamsas client update + * + * + * @return boolean + * @return the value of field 'modifiable'. + */ + public boolean getModifiable() + { + return this._modifiable; + } //-- boolean getModifiable() + + /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public org.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 (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- org.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public org.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- org.vamsas.objects.core.Property[] getProperty() + + /** + * Method getPropertyCount + * + * + * + * @return int + */ + public int getPropertyCount() + { + return _propertyList.size(); + } //-- int getPropertyCount() + + /** + * Method getScore + * + * + * + * @param index + * @return Score + */ + public org.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 (org.vamsas.objects.core.Score) _scoreList.elementAt(index); + } //-- org.vamsas.objects.core.Score getScore(int) + + /** + * Method getScore + * + * + * + * @return Score + */ + public org.vamsas.objects.core.Score[] getScore() + { + int size = _scoreList.size(); + org.vamsas.objects.core.Score[] mArray = new org.vamsas.objects.core.Score[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Score) _scoreList.elementAt(index); + } + return mArray; + } //-- org.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 getUrl + * + * + * + * @param index + * @return Url + */ + public org.vamsas.objects.core.Url getUrl(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _urlList.size())) { + throw new IndexOutOfBoundsException("getUrl: Index value '"+index+"' not in range [0.."+_urlList.size()+ "]"); + } + + return (org.vamsas.objects.core.Url) _urlList.elementAt(index); + } //-- org.vamsas.objects.core.Url getUrl(int) + + /** + * Method getUrl + * + * + * + * @return Url + */ + public org.vamsas.objects.core.Url[] getUrl() + { + int size = _urlList.size(); + org.vamsas.objects.core.Url[] mArray = new org.vamsas.objects.core.Url[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Url) _urlList.elementAt(index); + } + return mArray; + } //-- org.vamsas.objects.core.Url[] getUrl() + + /** + * Method getUrlCount + * + * + * + * @return int + */ + public int getUrlCount() + { + return _urlList.size(); + } //-- int getUrlCount() + + /** + * Method hasModifiable + * + * + * + * @return boolean + */ + public boolean hasModifiable() + { + return this._has_modifiable; + } //-- boolean hasModifiable() + + /** + * 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 removeAllProperty + * + */ + public void removeAllProperty() + { + _propertyList.removeAllElements(); + } //-- void removeAllProperty() + + /** + * Method removeAllScore + * + */ + public void removeAllScore() + { + _scoreList.removeAllElements(); + } //-- void removeAllScore() + + /** + * Method removeAllUrl + * + */ + public void removeAllUrl() + { + _urlList.removeAllElements(); + } //-- void removeAllUrl() + + /** + * Method removeAnnotationElement + * + * + * + * @param index + * @return AnnotationElement + */ + public org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index) + { + java.lang.Object obj = _annotationElementList.elementAt(index); + _annotationElementList.removeElementAt(index); + return (org.vamsas.objects.core.AnnotationElement) obj; + } //-- org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int) + + /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public org.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (org.vamsas.objects.core.Property) obj; + } //-- org.vamsas.objects.core.Property removeProperty(int) + + /** + * Method removeScore + * + * + * + * @param index + * @return Score + */ + public org.vamsas.objects.core.Score removeScore(int index) + { + java.lang.Object obj = _scoreList.elementAt(index); + _scoreList.removeElementAt(index); + return (org.vamsas.objects.core.Score) obj; + } //-- org.vamsas.objects.core.Score removeScore(int) + + /** + * Method removeUrl + * + * + * + * @param index + * @return Url + */ + public org.vamsas.objects.core.Url removeUrl(int index) + { + java.lang.Object obj = _urlList.elementAt(index); + _urlList.removeElementAt(index); + return (org.vamsas.objects.core.Url) obj; + } //-- org.vamsas.objects.core.Url removeUrl(int) + + /** + * Method setAnnotationElement + * + * + * + * @param index + * @param vAnnotationElement + */ + public void setAnnotationElement(int index, org.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, org.vamsas.objects.core.AnnotationElement) + + /** + * Method setAnnotationElement + * + * + * + * @param annotationElementArray + */ + public void setAnnotationElement(org.vamsas.objects.core.AnnotationElement[] annotationElementArray) + { + //-- copy array + _annotationElementList.removeAllElements(); + for (int i = 0; i < annotationElementArray.length; i++) { + _annotationElementList.addElement(annotationElementArray[i]); + } + } //-- void setAnnotationElement(org.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) + + /** + * Sets the value of field 'modifiable'. The field 'modifiable' + * has the following description: objects with modifiable=false + * will not be + * modified by a vamsas client update + * + * + * @param modifiable the value of field 'modifiable'. + */ + public void setModifiable(boolean modifiable) + { + this._modifiable = modifiable; + this._has_modifiable = true; + } //-- void setModifiable(boolean) + + /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, org.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, org.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(org.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(org.vamsas.objects.core.Property) + + /** + * Method setScore + * + * + * + * @param index + * @param vScore + */ + public void setScore(int index, org.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, org.vamsas.objects.core.Score) + + /** + * Method setScore + * + * + * + * @param scoreArray + */ + public void setScore(org.vamsas.objects.core.Score[] scoreArray) + { + //-- copy array + _scoreList.removeAllElements(); + for (int i = 0; i < scoreArray.length; i++) { + _scoreList.addElement(scoreArray[i]); + } + } //-- void setScore(org.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 setUrl + * + * + * + * @param index + * @param vUrl + */ + public void setUrl(int index, org.vamsas.objects.core.Url vUrl) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _urlList.size())) { + throw new IndexOutOfBoundsException("setUrl: Index value '"+index+"' not in range [0.."+_urlList.size()+ "]"); + } + _urlList.setElementAt(vUrl, index); + } //-- void setUrl(int, org.vamsas.objects.core.Url) + + /** + * Method setUrl + * + * + * + * @param urlArray + */ + public void setUrl(org.vamsas.objects.core.Url[] urlArray) + { + //-- copy array + _urlList.removeAllElements(); + for (int i = 0; i < urlArray.length; i++) { + _urlList.addElement(urlArray[i]); + } + } //-- void setUrl(org.vamsas.objects.core.Url) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return RangeType + */ + public static org.vamsas.objects.core.RangeType unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.RangeAnnotation) Unmarshaller.unmarshal(org.vamsas.objects.core.RangeAnnotation.class, reader); + } //-- org.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/org/vamsas/objects/core/RangeAnnotationDescriptor.java b/src/org/vamsas/objects/core/RangeAnnotationDescriptor.java new file mode 100644 index 0000000..c9a5a7d --- /dev/null +++ b/src/org/vamsas/objects/core/RangeAnnotationDescriptor.java @@ -0,0 +1,583 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.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 org.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.Boolean.TYPE, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + RangeAnnotation target = (RangeAnnotation) object; + if(!target.hasModifiable()) + return null; + return (target.getModifiable() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteModifiable(); + return; + } + target.setModifiable( ((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: _modifiable + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + 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(org.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( (org.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 org.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(org.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( (org.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 org.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); + //-- _urlList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.vamsas.objects.core.Url.class, "_urlList", "url", 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.getUrl(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + RangeAnnotation target = (RangeAnnotation) object; + target.addUrl( (org.vamsas.objects.core.Url) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return new org.vamsas.objects.core.Url(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _urlList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.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( (org.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 org.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); + } //-- org.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 org.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/org/vamsas/objects/core/RangeType.java b/src/org/vamsas/objects/core/RangeType.java new file mode 100644 index 0000000..6f9ed6d --- /dev/null +++ b/src/org/vamsas/objects/core/RangeType.java @@ -0,0 +1,455 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.vamsas.client.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(); + } //-- org.vamsas.objects.core.RangeType() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addPos + * + * + * + * @param vPos + */ + public void addPos(org.vamsas.objects.core.Pos vPos) + throws java.lang.IndexOutOfBoundsException + { + _posList.addElement(vPos); + } //-- void addPos(org.vamsas.objects.core.Pos) + + /** + * Method addPos + * + * + * + * @param index + * @param vPos + */ + public void addPos(int index, org.vamsas.objects.core.Pos vPos) + throws java.lang.IndexOutOfBoundsException + { + _posList.insertElementAt(vPos, index); + } //-- void addPos(int, org.vamsas.objects.core.Pos) + + /** + * Method addSeg + * + * + * + * @param vSeg + */ + public void addSeg(org.vamsas.objects.core.Seg vSeg) + throws java.lang.IndexOutOfBoundsException + { + _segList.addElement(vSeg); + } //-- void addSeg(org.vamsas.objects.core.Seg) + + /** + * Method addSeg + * + * + * + * @param index + * @param vSeg + */ + public void addSeg(int index, org.vamsas.objects.core.Seg vSeg) + throws java.lang.IndexOutOfBoundsException + { + _segList.insertElementAt(vSeg, index); + } //-- void addSeg(int, org.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 org.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 (org.vamsas.objects.core.Pos) _posList.elementAt(index); + } //-- org.vamsas.objects.core.Pos getPos(int) + + /** + * Method getPos + * + * + * + * @return Pos + */ + public org.vamsas.objects.core.Pos[] getPos() + { + int size = _posList.size(); + org.vamsas.objects.core.Pos[] mArray = new org.vamsas.objects.core.Pos[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Pos) _posList.elementAt(index); + } + return mArray; + } //-- org.vamsas.objects.core.Pos[] getPos() + + /** + * Method getPosCount + * + * + * + * @return int + */ + public int getPosCount() + { + return _posList.size(); + } //-- int getPosCount() + + /** + * Method getSeg + * + * + * + * @param index + * @return Seg + */ + public org.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 (org.vamsas.objects.core.Seg) _segList.elementAt(index); + } //-- org.vamsas.objects.core.Seg getSeg(int) + + /** + * Method getSeg + * + * + * + * @return Seg + */ + public org.vamsas.objects.core.Seg[] getSeg() + { + int size = _segList.size(); + org.vamsas.objects.core.Seg[] mArray = new org.vamsas.objects.core.Seg[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Seg) _segList.elementAt(index); + } + return mArray; + } //-- org.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 org.vamsas.objects.core.Pos removePos(int index) + { + java.lang.Object obj = _posList.elementAt(index); + _posList.removeElementAt(index); + return (org.vamsas.objects.core.Pos) obj; + } //-- org.vamsas.objects.core.Pos removePos(int) + + /** + * Method removeSeg + * + * + * + * @param index + * @return Seg + */ + public org.vamsas.objects.core.Seg removeSeg(int index) + { + java.lang.Object obj = _segList.elementAt(index); + _segList.removeElementAt(index); + return (org.vamsas.objects.core.Seg) obj; + } //-- org.vamsas.objects.core.Seg removeSeg(int) + + /** + * Method setPos + * + * + * + * @param index + * @param vPos + */ + public void setPos(int index, org.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, org.vamsas.objects.core.Pos) + + /** + * Method setPos + * + * + * + * @param posArray + */ + public void setPos(org.vamsas.objects.core.Pos[] posArray) + { + //-- copy array + _posList.removeAllElements(); + for (int i = 0; i < posArray.length; i++) { + _posList.addElement(posArray[i]); + } + } //-- void setPos(org.vamsas.objects.core.Pos) + + /** + * Method setSeg + * + * + * + * @param index + * @param vSeg + */ + public void setSeg(int index, org.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, org.vamsas.objects.core.Seg) + + /** + * Method setSeg + * + * + * + * @param segArray + */ + public void setSeg(org.vamsas.objects.core.Seg[] segArray) + { + //-- copy array + _segList.removeAllElements(); + for (int i = 0; i < segArray.length; i++) { + _segList.addElement(segArray[i]); + } + } //-- void setSeg(org.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/org/vamsas/objects/core/RangeTypeDescriptor.java b/src/org/vamsas/objects/core/RangeTypeDescriptor.java new file mode 100644 index 0000000..dc737dc --- /dev/null +++ b/src/org/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 org.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(org.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( (org.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(org.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( (org.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); + } //-- org.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 org.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/org/vamsas/objects/core/Score.java b/src/org/vamsas/objects/core/Score.java new file mode 100644 index 0000000..121fe2c --- /dev/null +++ b/src/org/vamsas/objects/core/Score.java @@ -0,0 +1,241 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.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"); + } //-- org.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 org.vamsas.objects.core.Score unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Score) Unmarshaller.unmarshal(org.vamsas.objects.core.Score.class, reader); + } //-- org.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/org/vamsas/objects/core/ScoreDescriptor.java b/src/org/vamsas/objects/core/ScoreDescriptor.java new file mode 100644 index 0000000..69dff86 --- /dev/null +++ b/src/org/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 org.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 + + } //-- org.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 org.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/org/vamsas/objects/core/Seg.java b/src/org/vamsas/objects/core/Seg.java new file mode 100644 index 0000000..c9de39f --- /dev/null +++ b/src/org/vamsas/objects/core/Seg.java @@ -0,0 +1,332 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 org.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(); + } //-- org.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 org.vamsas.objects.core.Seg unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Seg) Unmarshaller.unmarshal(org.vamsas.objects.core.Seg.class, reader); + } //-- org.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/org/vamsas/objects/core/SegDescriptor.java b/src/org/vamsas/objects/core/SegDescriptor.java new file mode 100644 index 0000000..055b2f6 --- /dev/null +++ b/src/org/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 org.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 + + } //-- org.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 org.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/org/vamsas/objects/core/Sequence.java b/src/org/vamsas/objects/core/Sequence.java index 27a1d8d..d0787bd 100644 --- a/src/org/vamsas/objects/core/Sequence.java +++ b/src/org/vamsas/objects/core/Sequence.java @@ -38,17 +38,26 @@ implements java.io.Serializable //--------------------------/ /** - * Field _id + * Primary Key for vamsas + * object referencing + * */ private java.lang.String _id; /** - * Field _dictionary + * symbol class for sequence + * */ private java.lang.String _dictionary; /** - * Field _dbRefList + * 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; @@ -199,7 +208,10 @@ implements java.io.Serializable } //-- int getDbRefCount() /** - * Returns the value of field 'dictionary'. + * 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'. @@ -210,7 +222,10 @@ implements java.io.Serializable } //-- java.lang.String getDictionary() /** - * Returns the value of field 'id'. + * 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'. @@ -325,7 +340,9 @@ implements java.io.Serializable } //-- void setDbRef(org.vamsas.objects.core.DbRef) /** - * Sets the value of field 'dictionary'. + * Sets the value of field 'dictionary'. The field 'dictionary' + * has the following description: symbol class for sequence + * * * @param dictionary the value of field 'dictionary'. */ @@ -335,7 +352,10 @@ implements java.io.Serializable } //-- void setDictionary(java.lang.String) /** - * Sets the value of field 'id'. + * 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'. */ diff --git a/src/org/vamsas/objects/core/SequenceDescriptor.java b/src/org/vamsas/objects/core/SequenceDescriptor.java index 6f1d48d..440d8e0 100644 --- a/src/org/vamsas/objects/core/SequenceDescriptor.java +++ b/src/org/vamsas/objects/core/SequenceDescriptor.java @@ -93,13 +93,11 @@ public class SequenceDescriptor extends org.vamsas.objects.core.SequenceTypeDesc } }; desc.setHandler(handler); - desc.setRequired(true); desc.setMultivalued(false); addFieldDescriptor(desc); //-- validation code for: _id fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); { //-- local scope } desc.setValidator(fieldValidator); @@ -129,11 +127,13 @@ public class SequenceDescriptor extends org.vamsas.objects.core.SequenceTypeDesc } }; 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"); diff --git a/src/org/vamsas/objects/core/SequenceType.java b/src/org/vamsas/objects/core/SequenceType.java index 59b6058..ecf91db 100644 --- a/src/org/vamsas/objects/core/SequenceType.java +++ b/src/org/vamsas/objects/core/SequenceType.java @@ -15,6 +15,8 @@ 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; @@ -65,6 +67,17 @@ implements java.io.Serializable */ private java.lang.String _name; + /** + * Field _description + */ + private java.lang.String _description; + + /** + * additional typed properties + * + */ + private java.util.Vector _propertyList; + //----------------/ //- Constructors -/ @@ -73,6 +86,7 @@ implements java.io.Serializable public SequenceType() { super(); + _propertyList = new Vector(); } //-- org.vamsas.objects.core.SequenceType() @@ -81,6 +95,33 @@ implements java.io.Serializable //-----------/ /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(org.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, org.vamsas.objects.core.Property) + + /** * Method deleteEnd * */ @@ -99,6 +140,18 @@ implements java.io.Serializable } //-- void deleteStart() /** + * Method enumerateProperty + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateProperty() + { + return _propertyList.elements(); + } //-- java.util.Enumeration enumerateProperty() + + /** * Note: hashCode() has not been overriden * * @param obj @@ -137,12 +190,37 @@ implements java.io.Serializable } 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; 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 @@ -165,6 +243,54 @@ implements java.io.Serializable } //-- java.lang.String getName() /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public org.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 (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- org.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public org.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- org.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 @@ -257,6 +383,40 @@ implements java.io.Serializable } //-- void marshal(org.xml.sax.ContentHandler) /** + * Method removeAllProperty + * + */ + public void removeAllProperty() + { + _propertyList.removeAllElements(); + } //-- void removeAllProperty() + + /** + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public org.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (org.vamsas.objects.core.Property) obj; + } //-- org.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'. @@ -278,6 +438,40 @@ implements java.io.Serializable } //-- void setName(java.lang.String) /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, org.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, org.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(org.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(org.vamsas.objects.core.Property) + + /** * Sets the value of field 'sequence'. * * @param sequence the value of field 'sequence'. diff --git a/src/org/vamsas/objects/core/SequenceTypeDescriptor.java b/src/org/vamsas/objects/core/SequenceTypeDescriptor.java index d7c39fc..240a9d7 100644 --- a/src/org/vamsas/objects/core/SequenceTypeDescriptor.java +++ b/src/org/vamsas/objects/core/SequenceTypeDescriptor.java @@ -232,6 +232,79 @@ public class SequenceTypeDescriptor extends org.exolab.castor.xml.util.XMLClassD 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(org.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( (org.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 org.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); } //-- org.vamsas.objects.core.SequenceTypeDescriptor() diff --git a/src/org/vamsas/objects/core/Tree.java b/src/org/vamsas/objects/core/Tree.java index 5bd5c28..4ce66e5 100644 --- a/src/org/vamsas/objects/core/Tree.java +++ b/src/org/vamsas/objects/core/Tree.java @@ -38,11 +38,24 @@ implements java.io.Serializable //--------------------------/ /** - * Field _id + * Primary Key for vamsas object referencing + * */ private java.lang.String _id; /** + * objects with modifiable=false will not be + * modified by a vamsas client update + * + */ + private boolean _modifiable = true; + + /** + * keeps track of state for field: _modifiable + */ + private boolean _has_modifiable; + + /** * Field _title */ private java.lang.String _title; @@ -53,6 +66,11 @@ implements java.io.Serializable private java.util.Vector _newickList; /** + * Field _propertyList + */ + private java.util.Vector _propertyList; + + /** * Field _provenance */ private org.vamsas.objects.core.Provenance _provenance; @@ -66,6 +84,7 @@ implements java.io.Serializable { super(); _newickList = new Vector(); + _propertyList = new Vector(); } //-- org.vamsas.objects.core.Tree() @@ -101,6 +120,42 @@ implements java.io.Serializable } //-- void addNewick(int, org.vamsas.objects.core.Newick) /** + * Method addProperty + * + * + * + * @param vProperty + */ + public void addProperty(org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.addElement(vProperty); + } //-- void addProperty(org.vamsas.objects.core.Property) + + /** + * Method addProperty + * + * + * + * @param index + * @param vProperty + */ + public void addProperty(int index, org.vamsas.objects.core.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + _propertyList.insertElementAt(vProperty, index); + } //-- void addProperty(int, org.vamsas.objects.core.Property) + + /** + * Method deleteModifiable + * + */ + public void deleteModifiable() + { + this._has_modifiable= false; + } //-- void deleteModifiable() + + /** * Method enumerateNewick * * @@ -113,6 +168,18 @@ implements java.io.Serializable } //-- 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 @@ -136,6 +203,10 @@ implements java.io.Serializable } else if (temp._id != null) return false; + if (this._modifiable != temp._modifiable) + return false; + if (this._has_modifiable != temp._has_modifiable) + return false; if (this._title != null) { if (temp._title == null) return false; else if (!(this._title.equals(temp._title))) @@ -150,6 +221,13 @@ implements java.io.Serializable } 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))) @@ -163,7 +241,10 @@ implements java.io.Serializable } //-- boolean equals(java.lang.Object) /** - * Returns the value of field 'id'. + * 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'. @@ -174,6 +255,21 @@ implements java.io.Serializable } //-- java.lang.String getId() /** + * Returns the value of field 'modifiable'. The field + * 'modifiable' has the following description: objects with + * modifiable=false will not be + * modified by a vamsas client update + * + * + * @return boolean + * @return the value of field 'modifiable'. + */ + public boolean getModifiable() + { + return this._modifiable; + } //-- boolean getModifiable() + + /** * Method getNewick * * @@ -222,6 +318,54 @@ implements java.io.Serializable } //-- int getNewickCount() /** + * Method getProperty + * + * + * + * @param index + * @return Property + */ + public org.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 (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } //-- org.vamsas.objects.core.Property getProperty(int) + + /** + * Method getProperty + * + * + * + * @return Property + */ + public org.vamsas.objects.core.Property[] getProperty() + { + int size = _propertyList.size(); + org.vamsas.objects.core.Property[] mArray = new org.vamsas.objects.core.Property[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.Property) _propertyList.elementAt(index); + } + return mArray; + } //-- org.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 @@ -244,6 +388,18 @@ implements java.io.Serializable } //-- java.lang.String getTitle() /** + * Method hasModifiable + * + * + * + * @return boolean + */ + public boolean hasModifiable() + { + return this._has_modifiable; + } //-- boolean hasModifiable() + + /** * Method isValid * * @@ -299,6 +455,15 @@ implements java.io.Serializable } //-- void removeAllNewick() /** + * Method removeAllProperty + * + */ + public void removeAllProperty() + { + _propertyList.removeAllElements(); + } //-- void removeAllProperty() + + /** * Method removeNewick * * @@ -314,7 +479,25 @@ implements java.io.Serializable } //-- org.vamsas.objects.core.Newick removeNewick(int) /** - * Sets the value of field 'id'. + * Method removeProperty + * + * + * + * @param index + * @return Property + */ + public org.vamsas.objects.core.Property removeProperty(int index) + { + java.lang.Object obj = _propertyList.elementAt(index); + _propertyList.removeElementAt(index); + return (org.vamsas.objects.core.Property) obj; + } //-- org.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'. */ @@ -324,6 +507,21 @@ implements java.io.Serializable } //-- void setId(java.lang.String) /** + * Sets the value of field 'modifiable'. The field 'modifiable' + * has the following description: objects with modifiable=false + * will not be + * modified by a vamsas client update + * + * + * @param modifiable the value of field 'modifiable'. + */ + public void setModifiable(boolean modifiable) + { + this._modifiable = modifiable; + this._has_modifiable = true; + } //-- void setModifiable(boolean) + + /** * Method setNewick * * @@ -358,6 +556,40 @@ implements java.io.Serializable } //-- void setNewick(org.vamsas.objects.core.Newick) /** + * Method setProperty + * + * + * + * @param index + * @param vProperty + */ + public void setProperty(int index, org.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, org.vamsas.objects.core.Property) + + /** + * Method setProperty + * + * + * + * @param propertyArray + */ + public void setProperty(org.vamsas.objects.core.Property[] propertyArray) + { + //-- copy array + _propertyList.removeAllElements(); + for (int i = 0; i < propertyArray.length; i++) { + _propertyList.addElement(propertyArray[i]); + } + } //-- void setProperty(org.vamsas.objects.core.Property) + + /** * Sets the value of field 'provenance'. * * @param provenance the value of field 'provenance'. diff --git a/src/org/vamsas/objects/core/TreeDescriptor.java b/src/org/vamsas/objects/core/TreeDescriptor.java index a4c7d8d..3779ab5 100644 --- a/src/org/vamsas/objects/core/TreeDescriptor.java +++ b/src/org/vamsas/objects/core/TreeDescriptor.java @@ -100,6 +100,48 @@ public class TreeDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto { //-- local scope } desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Tree target = (Tree) object; + if(!target.hasModifiable()) + return null; + return (target.getModifiable() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteModifiable(); + return; + } + target.setModifiable( ((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: _modifiable + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); //-- initialize element descriptors //-- _title @@ -176,6 +218,41 @@ public class TreeDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto { //-- local scope } desc.setValidator(fieldValidator); + //-- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.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( (org.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 org.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(org.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element); handler = new org.exolab.castor.xml.XMLFieldHandler() { diff --git a/src/org/vamsas/objects/core/Uri.java b/src/org/vamsas/objects/core/Uri.java new file mode 100644 index 0000000..67210e0 --- /dev/null +++ b/src/org/vamsas/objects/core/Uri.java @@ -0,0 +1,218 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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; + +/** + * Primitive labelled URI object + * + * + * @version $Revision$ $Date$ + */ +public class Uri extends org.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 Uri() + { + super(); + setContent(""); + } //-- org.vamsas.objects.core.Uri() + + + //-----------/ + //- 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 Uri) { + + Uri temp = (Uri)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 Uri + */ + public static org.vamsas.objects.core.Uri unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Uri) Unmarshaller.unmarshal(org.vamsas.objects.core.Uri.class, reader); + } //-- org.vamsas.objects.core.Uri 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/org/vamsas/objects/core/UriDescriptor.java b/src/org/vamsas/objects/core/UriDescriptor.java new file mode 100644 index 0000000..496a262 --- /dev/null +++ b/src/org/vamsas/objects/core/UriDescriptor.java @@ -0,0 +1,240 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 UriDescriptor. + * + * @version $Revision$ $Date$ + */ +public class UriDescriptor 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 UriDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "uri"; + 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 + { + Uri target = (Uri) object; + return target.getContent(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Uri target = (Uri) 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 + { + Uri target = (Uri) object; + return target.getHref(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Uri target = (Uri) 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 + + } //-- org.vamsas.objects.core.UriDescriptor() + + + //-----------/ + //- 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 org.vamsas.objects.core.Uri.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/org/vamsas/objects/core/Url.java b/src/org/vamsas/objects/core/Url.java new file mode 100644 index 0000000..3d880ac --- /dev/null +++ b/src/org/vamsas/objects/core/Url.java @@ -0,0 +1,141 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 Url. + * + * @version $Revision$ $Date$ + */ +public class Url extends Uri +implements java.io.Serializable +{ + + + //----------------/ + //- Constructors -/ + //----------------/ + + public Url() + { + super(); + } //-- org.vamsas.objects.core.Url() + + + //-----------/ + //- 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 Url) { + + Url temp = (Url)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 Url + */ + public static org.vamsas.objects.core.Url unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.Url) Unmarshaller.unmarshal(org.vamsas.objects.core.Url.class, reader); + } //-- org.vamsas.objects.core.Url 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/org/vamsas/objects/core/UrlDescriptor.java b/src/org/vamsas/objects/core/UrlDescriptor.java new file mode 100644 index 0000000..e7a2f6f --- /dev/null +++ b/src/org/vamsas/objects/core/UrlDescriptor.java @@ -0,0 +1,167 @@ +/* + * This class was automatically generated with + * Castor 0.9.9M2, using an XML + * Schema. + * $Id$ + */ + +package org.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 UrlDescriptor. + * + * @version $Revision$ $Date$ + */ +public class UrlDescriptor extends UriDescriptor { + + + //--------------------------/ + //- 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 UrlDescriptor() + { + super(); + setExtendsWithoutFlatten(new UriDescriptor()); + nsURI = "http://www.vamsas.org"; + xmlName = "url"; + } //-- org.vamsas.objects.core.UrlDescriptor() + + + //-----------/ + //- 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 org.vamsas.objects.core.Url.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/org/vamsas/objects/core/VAMSAS.java b/src/org/vamsas/objects/core/VAMSAS.java index 0c1af87..e5f615d 100644 --- a/src/org/vamsas/objects/core/VAMSAS.java +++ b/src/org/vamsas/objects/core/VAMSAS.java @@ -24,7 +24,9 @@ import org.exolab.castor.xml.ValidationException; import org.xml.sax.ContentHandler; /** - * Class VAMSAS. + * contains unassociated trees and a number of analysis + * sets + * * * @version $Revision$ $Date$ */ @@ -38,11 +40,24 @@ implements java.io.Serializable //--------------------------/ /** - * Field _id + * Primary Key for vamsas object referencing + * */ private java.lang.String _id; /** + * objects with modifiable=false will not be + * modified by a vamsas client update + * + */ + private boolean _modifiable = true; + + /** + * keeps track of state for field: _modifiable + */ + private boolean _has_modifiable; + + /** * Field _treeList */ private java.util.Vector _treeList; @@ -124,6 +139,15 @@ implements java.io.Serializable } //-- void addTree(int, org.vamsas.objects.core.Tree) /** + * Method deleteModifiable + * + */ + public void deleteModifiable() + { + this._has_modifiable= false; + } //-- void deleteModifiable() + + /** * Method enumerateDataSet * * @@ -171,6 +195,10 @@ implements java.io.Serializable } else if (temp._id != null) return false; + if (this._modifiable != temp._modifiable) + return false; + if (this._has_modifiable != temp._has_modifiable) + return false; if (this._treeList != null) { if (temp._treeList == null) return false; else if (!(this._treeList.equals(temp._treeList))) @@ -239,7 +267,10 @@ implements java.io.Serializable } //-- int getDataSetCount() /** - * Returns the value of field 'id'. + * 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'. @@ -250,6 +281,21 @@ implements java.io.Serializable } //-- java.lang.String getId() /** + * Returns the value of field 'modifiable'. The field + * 'modifiable' has the following description: objects with + * modifiable=false will not be + * modified by a vamsas client update + * + * + * @return boolean + * @return the value of field 'modifiable'. + */ + public boolean getModifiable() + { + return this._modifiable; + } //-- boolean getModifiable() + + /** * Method getTree * * @@ -298,6 +344,18 @@ implements java.io.Serializable } //-- int getTreeCount() /** + * Method hasModifiable + * + * + * + * @return boolean + */ + public boolean hasModifiable() + { + return this._has_modifiable; + } //-- boolean hasModifiable() + + /** * Method isValid * * @@ -426,7 +484,10 @@ implements java.io.Serializable } //-- void setDataSet(org.vamsas.objects.core.DataSet) /** - * Sets the value of field 'id'. + * 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'. */ @@ -436,6 +497,21 @@ implements java.io.Serializable } //-- void setId(java.lang.String) /** + * Sets the value of field 'modifiable'. The field 'modifiable' + * has the following description: objects with modifiable=false + * will not be + * modified by a vamsas client update + * + * + * @param modifiable the value of field 'modifiable'. + */ + public void setModifiable(boolean modifiable) + { + this._modifiable = modifiable; + this._has_modifiable = true; + } //-- void setModifiable(boolean) + + /** * Method setTree * * diff --git a/src/org/vamsas/objects/core/VAMSASDescriptor.java b/src/org/vamsas/objects/core/VAMSASDescriptor.java index 18f66c2..7ec2896 100644 --- a/src/org/vamsas/objects/core/VAMSASDescriptor.java +++ b/src/org/vamsas/objects/core/VAMSASDescriptor.java @@ -100,6 +100,48 @@ public class VAMSASDescriptor extends org.exolab.castor.xml.util.XMLClassDescrip { //-- local scope } desc.setValidator(fieldValidator); + //-- _modifiable + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_modifiable", "modifiable", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + VAMSAS target = (VAMSAS) object; + if(!target.hasModifiable()) + return null; + return (target.getModifiable() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + VAMSAS target = (VAMSAS) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteModifiable(); + return; + } + target.setModifiable( ((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: _modifiable + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); //-- initialize element descriptors //-- _treeList diff --git a/src/org/vamsas/objects/core/VamsasDocument.java b/src/org/vamsas/objects/core/VamsasDocument.java index cbf50ba..fd4eef1 100644 --- a/src/org/vamsas/objects/core/VamsasDocument.java +++ b/src/org/vamsas/objects/core/VamsasDocument.java @@ -53,7 +53,9 @@ implements java.io.Serializable private Provenance _provenance; /** - * Field _VAMSASList + * contains unassociated trees and a number of analysis + * sets + * */ private java.util.Vector _VAMSASList; @@ -62,6 +64,11 @@ implements java.io.Serializable */ private java.util.Vector _applicationDataList; + /** + * Field _attachmentList + */ + private java.util.Vector _attachmentList; + //----------------/ //- Constructors -/ @@ -72,6 +79,7 @@ implements java.io.Serializable super(); _VAMSASList = new Vector(); _applicationDataList = new Vector(); + _attachmentList = new Vector(); } //-- org.vamsas.objects.core.VamsasDocument() @@ -107,6 +115,33 @@ implements java.io.Serializable } //-- 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 * * @@ -146,6 +181,18 @@ implements java.io.Serializable } //-- java.util.Enumeration enumerateApplicationData() /** + * Method enumerateAttachment + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateAttachment() + { + return _attachmentList.elements(); + } //-- java.util.Enumeration enumerateAttachment() + + /** * Method enumerateVAMSAS * * @@ -209,6 +256,13 @@ implements java.io.Serializable } 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; @@ -263,6 +317,54 @@ implements java.io.Serializable } //-- 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 @@ -401,6 +503,15 @@ implements java.io.Serializable } //-- void removeAllApplicationData() /** + * Method removeAllAttachment + * + */ + public void removeAllAttachment() + { + _attachmentList.removeAllElements(); + } //-- void removeAllAttachment() + + /** * Method removeAllVAMSAS * */ @@ -425,6 +536,21 @@ implements java.io.Serializable } //-- 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 * * @@ -474,6 +600,40 @@ implements java.io.Serializable } //-- 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'. diff --git a/src/org/vamsas/objects/core/VamsasDocumentDescriptor.java b/src/org/vamsas/objects/core/VamsasDocumentDescriptor.java index 3181ad4..425e16a 100644 --- a/src/org/vamsas/objects/core/VamsasDocumentDescriptor.java +++ b/src/org/vamsas/objects/core/VamsasDocumentDescriptor.java @@ -247,6 +247,41 @@ public class VamsasDocumentDescriptor extends org.exolab.castor.xml.util.XMLClas { //-- 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); } //-- org.vamsas.objects.core.VamsasDocumentDescriptor()