synchronized with last schema revision.
authorjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 10 Nov 2005 11:22:12 +0000 (11:22 +0000)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 10 Nov 2005 11:22:12 +0000 (11:22 +0000)
git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@88 be28352e-c001-0410-b1a7-c7978e42abec

src/org/vamsas/objects/core/ApplicationData.java
src/org/vamsas/objects/core/ApplicationDataDescriptor.java

index b9adb94..bb0c99e 100644 (file)
@@ -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 ApplicationData extends org.vamsas.client.object 
+public class ApplicationData extends org.vamsas.objects.core.AppData 
 implements java.io.Serializable
 {
 
@@ -38,9 +36,19 @@ implements java.io.Serializable
     //--------------------------/
 
     /**
-     * Field _applicationList
+     * Field _version
      */
-    private java.util.Vector _applicationList;
+    private java.lang.String _version;
+
+    /**
+     * Field _name
+     */
+    private java.lang.String _name;
+
+    /**
+     * Field _urn
+     */
+    private java.lang.String _urn;
 
 
       //----------------/
@@ -50,7 +58,6 @@ implements java.io.Serializable
     public ApplicationData() 
      {
         super();
-        _applicationList = new Vector();
     } //-- org.vamsas.objects.core.ApplicationData()
 
 
@@ -59,45 +66,6 @@ implements java.io.Serializable
     //-----------/
 
     /**
-     * Method addApplication
-     * 
-     * 
-     * 
-     * @param vApplication
-     */
-    public void addApplication(org.vamsas.objects.core.Application vApplication)
-        throws java.lang.IndexOutOfBoundsException
-    {
-        _applicationList.addElement(vApplication);
-    } //-- void addApplication(org.vamsas.objects.core.Application) 
-
-    /**
-     * Method addApplication
-     * 
-     * 
-     * 
-     * @param index
-     * @param vApplication
-     */
-    public void addApplication(int index, org.vamsas.objects.core.Application vApplication)
-        throws java.lang.IndexOutOfBoundsException
-    {
-        _applicationList.insertElementAt(vApplication, index);
-    } //-- void addApplication(int, org.vamsas.objects.core.Application) 
-
-    /**
-     * Method enumerateApplication
-     * 
-     * 
-     * 
-     * @return Enumeration
-     */
-    public java.util.Enumeration enumerateApplication()
-    {
-        return _applicationList.elements();
-    } //-- java.util.Enumeration enumerateApplication() 
-
-    /**
      * Note: hashCode() has not been overriden
      * 
      * @param obj
@@ -114,12 +82,26 @@ implements java.io.Serializable
         if (obj instanceof ApplicationData) {
         
             ApplicationData temp = (ApplicationData)obj;
-            if (this._applicationList != null) {
-                if (temp._applicationList == null) return false;
-                else if (!(this._applicationList.equals(temp._applicationList))) 
+            if (this._version != null) {
+                if (temp._version == null) return false;
+                else if (!(this._version.equals(temp._version))) 
                     return false;
             }
-            else if (temp._applicationList != null)
+            else if (temp._version != null)
+                return false;
+            if (this._name != null) {
+                if (temp._name == null) return false;
+                else if (!(this._name.equals(temp._name))) 
+                    return false;
+            }
+            else if (temp._name != null)
+                return false;
+            if (this._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;
         }
@@ -127,52 +109,37 @@ implements java.io.Serializable
     } //-- boolean equals(java.lang.Object) 
 
     /**
-     * Method getApplication
-     * 
-     * 
+     * Returns the value of field 'name'.
      * 
-     * @param index
-     * @return Application
+     * @return String
+     * @return the value of field 'name'.
      */
-    public org.vamsas.objects.core.Application getApplication(int index)
-        throws java.lang.IndexOutOfBoundsException
+    public java.lang.String getName()
     {
-        //-- check bounds for index
-        if ((index < 0) || (index > _applicationList.size())) {
-            throw new IndexOutOfBoundsException("getApplication: Index value '"+index+"' not in range [0.."+_applicationList.size()+ "]");
-        }
-        
-        return (org.vamsas.objects.core.Application) _applicationList.elementAt(index);
-    } //-- org.vamsas.objects.core.Application getApplication(int) 
+        return this._name;
+    } //-- java.lang.String getName() 
 
     /**
-     * Method getApplication
-     * 
-     * 
+     * Returns the value of field 'urn'.
      * 
-     * @return Application
+     * @return String
+     * @return the value of field 'urn'.
      */
-    public org.vamsas.objects.core.Application[] getApplication()
+    public java.lang.String getUrn()
     {
-        int size = _applicationList.size();
-        org.vamsas.objects.core.Application[] mArray = new org.vamsas.objects.core.Application[size];
-        for (int index = 0; index < size; index++) {
-            mArray[index] = (org.vamsas.objects.core.Application) _applicationList.elementAt(index);
-        }
-        return mArray;
-    } //-- org.vamsas.objects.core.Application[] getApplication() 
+        return this._urn;
+    } //-- java.lang.String getUrn() 
 
     /**
-     * Method getApplicationCount
-     * 
-     * 
+     * Returns the value of field 'version'.
      * 
-     * @return int
+     * @return String
+     * @return the value of field 'version'.
      */
-    public int getApplicationCount()
+    public java.lang.String getVersion()
     {
-        return _applicationList.size();
-    } //-- int getApplicationCount() 
+        return this._version;
+    } //-- java.lang.String getVersion() 
 
     /**
      * Method isValid
@@ -221,62 +188,34 @@ implements java.io.Serializable
     } //-- void marshal(org.xml.sax.ContentHandler) 
 
     /**
-     * Method removeAllApplication
+     * Sets the value of field 'name'.
      * 
+     * @param name the value of field 'name'.
      */
-    public void removeAllApplication()
+    public void setName(java.lang.String name)
     {
-        _applicationList.removeAllElements();
-    } //-- void removeAllApplication() 
+        this._name = name;
+    } //-- void setName(java.lang.String) 
 
     /**
-     * Method removeApplication
+     * Sets the value of field 'urn'.
      * 
-     * 
-     * 
-     * @param index
-     * @return Application
+     * @param urn the value of field 'urn'.
      */
-    public org.vamsas.objects.core.Application removeApplication(int index)
+    public void setUrn(java.lang.String urn)
     {
-        java.lang.Object obj = _applicationList.elementAt(index);
-        _applicationList.removeElementAt(index);
-        return (org.vamsas.objects.core.Application) obj;
-    } //-- org.vamsas.objects.core.Application removeApplication(int) 
+        this._urn = urn;
+    } //-- void setUrn(java.lang.String) 
 
     /**
-     * Method setApplication
-     * 
-     * 
+     * Sets the value of field 'version'.
      * 
-     * @param index
-     * @param vApplication
+     * @param version the value of field 'version'.
      */
-    public void setApplication(int index, org.vamsas.objects.core.Application vApplication)
-        throws java.lang.IndexOutOfBoundsException
+    public void setVersion(java.lang.String version)
     {
-        //-- check bounds for index
-        if ((index < 0) || (index > _applicationList.size())) {
-            throw new IndexOutOfBoundsException("setApplication: Index value '"+index+"' not in range [0.."+_applicationList.size()+ "]");
-        }
-        _applicationList.setElementAt(vApplication, index);
-    } //-- void setApplication(int, org.vamsas.objects.core.Application) 
-
-    /**
-     * Method setApplication
-     * 
-     * 
-     * 
-     * @param applicationArray
-     */
-    public void setApplication(org.vamsas.objects.core.Application[] applicationArray)
-    {
-        //-- copy array
-        _applicationList.removeAllElements();
-        for (int i = 0; i < applicationArray.length; i++) {
-            _applicationList.addElement(applicationArray[i]);
-        }
-    } //-- void setApplication(org.vamsas.objects.core.Application) 
+        this._version = version;
+    } //-- void setVersion(java.lang.String) 
 
     /**
      * Method unmarshal
@@ -284,13 +223,13 @@ implements java.io.Serializable
      * 
      * 
      * @param reader
-     * @return ApplicationData
+     * @return AppData
      */
-    public static org.vamsas.objects.core.ApplicationData unmarshal(java.io.Reader reader)
+    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.ApplicationData) Unmarshaller.unmarshal(org.vamsas.objects.core.ApplicationData.class, reader);
-    } //-- org.vamsas.objects.core.ApplicationData unmarshal(java.io.Reader) 
+    } //-- org.vamsas.objects.core.AppData unmarshal(java.io.Reader) 
 
     /**
      * Method validate
index 64d951b..213f66b 100644 (file)
@@ -21,7 +21,7 @@ import org.exolab.castor.xml.validators.*;
  * 
  * @version $Revision$ $Date$
  */
-public class ApplicationDataDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+public class ApplicationDataDescriptor extends org.vamsas.objects.core.AppDataDescriptor {
 
 
       //--------------------------/
@@ -56,53 +56,133 @@ public class ApplicationDataDescriptor extends org.exolab.castor.xml.util.XMLCla
     public ApplicationDataDescriptor() 
      {
         super();
+        setExtendsWithoutFlatten(new org.vamsas.objects.core.AppDataDescriptor());
         nsURI = "http://www.vamsas.org";
         xmlName = "ApplicationData";
-        
-        //-- set grouping compositor
-        setCompositorAsSequence();
         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
         org.exolab.castor.mapping.FieldHandler             handler        = null;
         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
         //-- initialize attribute descriptors
         
-        //-- initialize element descriptors
+        //-- _version
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "version", org.exolab.castor.xml.NodeType.Attribute);
+        desc.setImmutable(true);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                ApplicationData target = (ApplicationData) object;
+                return target.getVersion();
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    ApplicationData target = (ApplicationData) object;
+                    target.setVersion( (java.lang.String) value);
+                }
+                catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance( java.lang.Object parent ) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setRequired(true);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
+        
+        //-- validation code for: _version
+        fieldValidator = new org.exolab.castor.xml.FieldValidator();
+        fieldValidator.setMinOccurs(1);
+        { //-- local scope
+            StringValidator typeValidator = new StringValidator();
+            typeValidator.setWhiteSpace("preserve");
+            fieldValidator.setValidator(typeValidator);
+        }
+        desc.setValidator(fieldValidator);
+        //-- _name
+        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
+        desc.setImmutable(true);
+        handler = new org.exolab.castor.xml.XMLFieldHandler() {
+            public java.lang.Object getValue( java.lang.Object object ) 
+                throws IllegalStateException
+            {
+                ApplicationData target = (ApplicationData) object;
+                return target.getName();
+            }
+            public void setValue( java.lang.Object object, java.lang.Object value) 
+                throws IllegalStateException, IllegalArgumentException
+            {
+                try {
+                    ApplicationData target = (ApplicationData) object;
+                    target.setName( (java.lang.String) value);
+                }
+                catch (java.lang.Exception ex) {
+                    throw new IllegalStateException(ex.toString());
+                }
+            }
+            public java.lang.Object newInstance( java.lang.Object parent ) {
+                return null;
+            }
+        };
+        desc.setHandler(handler);
+        desc.setRequired(true);
+        desc.setMultivalued(false);
+        addFieldDescriptor(desc);
         
-        //-- _applicationList
-        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.vamsas.objects.core.Application.class, "_applicationList", "Application", org.exolab.castor.xml.NodeType.Element);
+        //-- 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);
+        //-- _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
             {
                 ApplicationData target = (ApplicationData) object;
-                return target.getApplication();
+                return target.getUrn();
             }
             public void setValue( java.lang.Object object, java.lang.Object value) 
                 throws IllegalStateException, IllegalArgumentException
             {
                 try {
                     ApplicationData target = (ApplicationData) object;
-                    target.addApplication( (org.vamsas.objects.core.Application) value);
+                    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 new org.vamsas.objects.core.Application();
+                return null;
             }
         };
         desc.setHandler(handler);
-        desc.setNameSpaceURI("http://www.vamsas.org");
-        desc.setMultivalued(true);
+        desc.setRequired(true);
+        desc.setMultivalued(false);
         addFieldDescriptor(desc);
         
-        //-- validation code for: _applicationList
+        //-- validation code for: _urn
         fieldValidator = new org.exolab.castor.xml.FieldValidator();
-        fieldValidator.setMinOccurs(0);
+        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.ApplicationDataDescriptor()
 
 
@@ -131,7 +211,7 @@ public class ApplicationDataDescriptor extends org.exolab.castor.xml.util.XMLCla
      */
     public org.exolab.castor.mapping.ClassDescriptor getExtends()
     {
-        return null;
+        return super.getExtends();
     } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() 
 
     /**
@@ -143,6 +223,8 @@ public class ApplicationDataDescriptor extends org.exolab.castor.xml.util.XMLCla
      */
     public org.exolab.castor.mapping.FieldDescriptor getIdentity()
     {
+        if (identity == null)
+            return super.getIdentity();
         return identity;
     } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()