From: jprocter Date: Thu, 10 Nov 2005 11:23:30 +0000 (+0000) Subject: synchronized with last schema revision. X-Git-Tag: Release_0.2~431 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a2b5dbfbb458bc73bc8a76680513106c005f9120;p=vamsas.git synchronized with last schema revision. git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@89 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/org/vamsas/objects/core/AppData.java b/src/org/vamsas/objects/core/AppData.java new file mode 100644 index 0000000..eef2ff7 --- /dev/null +++ b/src/org/vamsas/objects/core/AppData.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 java.io.IOException; +import java.io.Reader; +import java.io.Serializable; +import java.io.Writer; +import java.util.Enumeration; +import java.util.Vector; +import org.exolab.castor.xml.MarshalException; +import org.exolab.castor.xml.Marshaller; +import org.exolab.castor.xml.Unmarshaller; +import org.exolab.castor.xml.ValidationException; +import org.xml.sax.ContentHandler; + +/** + * Class AppData. + * + * @version $Revision$ $Date$ + */ +public class AppData extends org.vamsas.client.object +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _appDataChoice + */ + private org.vamsas.objects.core.AppDataChoice _appDataChoice; + + /** + * Field _userList + */ + private java.util.Vector _userList; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AppData() + { + super(); + _userList = new Vector(); + } //-- org.vamsas.objects.core.AppData() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addUser + * + * + * + * @param vUser + */ + public void addUser(org.vamsas.objects.core.User vUser) + throws java.lang.IndexOutOfBoundsException + { + _userList.addElement(vUser); + } //-- void addUser(org.vamsas.objects.core.User) + + /** + * Method addUser + * + * + * + * @param index + * @param vUser + */ + public void addUser(int index, org.vamsas.objects.core.User vUser) + throws java.lang.IndexOutOfBoundsException + { + _userList.insertElementAt(vUser, index); + } //-- void addUser(int, org.vamsas.objects.core.User) + + /** + * Method enumerateUser + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateUser() + { + return _userList.elements(); + } //-- java.util.Enumeration enumerateUser() + + /** + * Note: hashCode() has not been overriden + * + * @param obj + * @return boolean + */ + public boolean equals(java.lang.Object obj) + { + if ( this == obj ) + return true; + + if (super.equals(obj)==false) + return false; + + if (obj instanceof AppData) { + + AppData temp = (AppData)obj; + if (this._appDataChoice != null) { + if (temp._appDataChoice == null) return false; + else if (!(this._appDataChoice.equals(temp._appDataChoice))) + return false; + } + else if (temp._appDataChoice != null) + return false; + if (this._userList != null) { + if (temp._userList == null) return false; + else if (!(this._userList.equals(temp._userList))) + return false; + } + else if (temp._userList != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'appDataChoice'. + * + * @return AppDataChoice + * @return the value of field 'appDataChoice'. + */ + public org.vamsas.objects.core.AppDataChoice getAppDataChoice() + { + return this._appDataChoice; + } //-- org.vamsas.objects.core.AppDataChoice getAppDataChoice() + + /** + * Method getUser + * + * + * + * @param index + * @return User + */ + public org.vamsas.objects.core.User getUser(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _userList.size())) { + throw new IndexOutOfBoundsException("getUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]"); + } + + return (org.vamsas.objects.core.User) _userList.elementAt(index); + } //-- org.vamsas.objects.core.User getUser(int) + + /** + * Method getUser + * + * + * + * @return User + */ + public org.vamsas.objects.core.User[] getUser() + { + int size = _userList.size(); + org.vamsas.objects.core.User[] mArray = new org.vamsas.objects.core.User[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (org.vamsas.objects.core.User) _userList.elementAt(index); + } + return mArray; + } //-- org.vamsas.objects.core.User[] getUser() + + /** + * Method getUserCount + * + * + * + * @return int + */ + public int getUserCount() + { + return _userList.size(); + } //-- int getUserCount() + + /** + * 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 removeAllUser + * + */ + public void removeAllUser() + { + _userList.removeAllElements(); + } //-- void removeAllUser() + + /** + * Method removeUser + * + * + * + * @param index + * @return User + */ + public org.vamsas.objects.core.User removeUser(int index) + { + java.lang.Object obj = _userList.elementAt(index); + _userList.removeElementAt(index); + return (org.vamsas.objects.core.User) obj; + } //-- org.vamsas.objects.core.User removeUser(int) + + /** + * Sets the value of field 'appDataChoice'. + * + * @param appDataChoice the value of field 'appDataChoice'. + */ + public void setAppDataChoice(org.vamsas.objects.core.AppDataChoice appDataChoice) + { + this._appDataChoice = appDataChoice; + } //-- void setAppDataChoice(org.vamsas.objects.core.AppDataChoice) + + /** + * Method setUser + * + * + * + * @param index + * @param vUser + */ + public void setUser(int index, org.vamsas.objects.core.User vUser) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _userList.size())) { + throw new IndexOutOfBoundsException("setUser: Index value '"+index+"' not in range [0.."+_userList.size()+ "]"); + } + _userList.setElementAt(vUser, index); + } //-- void setUser(int, org.vamsas.objects.core.User) + + /** + * Method setUser + * + * + * + * @param userArray + */ + public void setUser(org.vamsas.objects.core.User[] userArray) + { + //-- copy array + _userList.removeAllElements(); + for (int i = 0; i < userArray.length; i++) { + _userList.addElement(userArray[i]); + } + } //-- void setUser(org.vamsas.objects.core.User) + + /** + * 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.AppData) Unmarshaller.unmarshal(org.vamsas.objects.core.AppData.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/AppDataChoice.java b/src/org/vamsas/objects/core/AppDataChoice.java new file mode 100644 index 0000000..06d07bd --- /dev/null +++ b/src/org/vamsas/objects/core/AppDataChoice.java @@ -0,0 +1,212 @@ +/* + * 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 AppDataChoice. + * + * @version $Revision$ $Date$ + */ +public class AppDataChoice extends org.vamsas.client.object +implements java.io.Serializable +{ + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field _data + */ + private java.lang.String _data; + + /** + * Field _dataReference + */ + private byte[] _dataReference; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AppDataChoice() + { + super(); + } //-- org.vamsas.objects.core.AppDataChoice() + + + //-----------/ + //- 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 AppDataChoice) { + + AppDataChoice temp = (AppDataChoice)obj; + if (this._data != null) { + if (temp._data == null) return false; + else if (!(this._data.equals(temp._data))) + return false; + } + else if (temp._data != null) + return false; + if (this._dataReference != null) { + if (temp._dataReference == null) return false; + else if (!(this._dataReference.equals(temp._dataReference))) + return false; + } + else if (temp._dataReference != null) + return false; + return true; + } + return false; + } //-- boolean equals(java.lang.Object) + + /** + * Returns the value of field 'data'. + * + * @return String + * @return the value of field 'data'. + */ + public java.lang.String getData() + { + return this._data; + } //-- java.lang.String getData() + + /** + * Returns the value of field 'dataReference'. + * + * @return byte + * @return the value of field 'dataReference'. + */ + public byte[] getDataReference() + { + return this._dataReference; + } //-- byte[] getDataReference() + + /** + * Method isValid + * + * + * + * @return boolean + */ + public boolean isValid() + { + try { + validate(); + } + catch (org.exolab.castor.xml.ValidationException vex) { + return false; + } + return true; + } //-- boolean isValid() + + /** + * Method marshal + * + * + * + * @param out + */ + public void marshal(java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, out); + } //-- void marshal(java.io.Writer) + + /** + * Method marshal + * + * + * + * @param handler + */ + public void marshal(org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + + Marshaller.marshal(this, handler); + } //-- void marshal(org.xml.sax.ContentHandler) + + /** + * Sets the value of field 'data'. + * + * @param data the value of field 'data'. + */ + public void setData(java.lang.String data) + { + this._data = data; + } //-- void setData(java.lang.String) + + /** + * Sets the value of field 'dataReference'. + * + * @param dataReference the value of field 'dataReference'. + */ + public void setDataReference(byte[] dataReference) + { + this._dataReference = dataReference; + } //-- void setDataReference(byte) + + /** + * Method unmarshal + * + * + * + * @param reader + * @return AppDataChoice + */ + public static org.vamsas.objects.core.AppDataChoice unmarshal(java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException + { + return (org.vamsas.objects.core.AppDataChoice) Unmarshaller.unmarshal(org.vamsas.objects.core.AppDataChoice.class, reader); + } //-- org.vamsas.objects.core.AppDataChoice 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/AppDataChoiceDescriptor.java b/src/org/vamsas/objects/core/AppDataChoiceDescriptor.java new file mode 100644 index 0000000..1d46b62 --- /dev/null +++ b/src/org/vamsas/objects/core/AppDataChoiceDescriptor.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 AppDataChoiceDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AppDataChoiceDescriptor 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 AppDataChoiceDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + + //-- set grouping compositor + setCompositorAsChoice(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + //-- initialize attribute descriptors + + //-- initialize element descriptors + + //-- _data + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_data", "data", 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 + { + AppDataChoice target = (AppDataChoice) object; + return target.getData(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AppDataChoice target = (AppDataChoice) object; + target.setData( (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: _data + 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); + //-- _dataReference + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(byte[].class, "_dataReference", "dataReference", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AppDataChoice target = (AppDataChoice) object; + return target.getDataReference(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AppDataChoice target = (AppDataChoice) object; + target.setDataReference( (byte[]) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _dataReference + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- org.vamsas.objects.core.AppDataChoiceDescriptor() + + + //-----------/ + //- 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.AppDataChoice.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/AppDataDescriptor.java b/src/org/vamsas/objects/core/AppDataDescriptor.java new file mode 100644 index 0000000..c667bc8 --- /dev/null +++ b/src/org/vamsas/objects/core/AppDataDescriptor.java @@ -0,0 +1,248 @@ +/* + * 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 AppDataDescriptor. + * + * @version $Revision$ $Date$ + */ +public class AppDataDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { + + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field nsPrefix + */ + private java.lang.String nsPrefix; + + /** + * Field nsURI + */ + private java.lang.String nsURI; + + /** + * Field xmlName + */ + private java.lang.String xmlName; + + /** + * Field identity + */ + private org.exolab.castor.xml.XMLFieldDescriptor identity; + + + //----------------/ + //- Constructors -/ + //----------------/ + + public AppDataDescriptor() + { + super(); + nsURI = "http://www.vamsas.org"; + xmlName = "appData"; + + //-- set grouping compositor + 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 + + //-- _appDataChoice + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.vamsas.objects.core.AppDataChoice.class, "_appDataChoice", "-error-if-this-is-used-", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + AppData target = (AppData) object; + return target.getAppDataChoice(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AppData target = (AppData) object; + target.setAppDataChoice( (org.vamsas.objects.core.AppDataChoice) 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.AppDataChoice(); + } + }; + desc.setHandler(handler); + desc.setContainer(true); + desc.setClassDescriptor(new org.vamsas.objects.core.AppDataChoiceDescriptor()); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _appDataChoice + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + //-- _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 + { + AppData target = (AppData) object; + return target.getUser(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + AppData target = (AppData) object; + 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 new org.vamsas.objects.core.User(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("http://www.vamsas.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + //-- validation code for: _userList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + } + desc.setValidator(fieldValidator); + } //-- org.vamsas.objects.core.AppDataDescriptor() + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method getAccessMode + * + * + * + * @return AccessMode + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } //-- org.exolab.castor.mapping.AccessMode getAccessMode() + + /** + * Method getExtends + * + * + * + * @return ClassDescriptor + */ + public org.exolab.castor.mapping.ClassDescriptor getExtends() + { + return null; + } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() + + /** + * Method getIdentity + * + * + * + * @return FieldDescriptor + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return identity; + } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() + + /** + * Method getJavaClass + * + * + * + * @return Class + */ + public java.lang.Class getJavaClass() + { + return org.vamsas.objects.core.AppData.class; + } //-- java.lang.Class getJavaClass() + + /** + * Method getNameSpacePrefix + * + * + * + * @return String + */ + public java.lang.String getNameSpacePrefix() + { + return nsPrefix; + } //-- java.lang.String getNameSpacePrefix() + + /** + * Method getNameSpaceURI + * + * + * + * @return String + */ + public java.lang.String getNameSpaceURI() + { + return nsURI; + } //-- java.lang.String getNameSpaceURI() + + /** + * Method getValidator + * + * + * + * @return TypeValidator + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } //-- org.exolab.castor.xml.TypeValidator getValidator() + + /** + * Method getXMLName + * + * + * + * @return String + */ + public java.lang.String getXMLName() + { + return xmlName; + } //-- java.lang.String getXMLName() + +} diff --git a/src/org/vamsas/objects/core/User.java b/src/org/vamsas/objects/core/User.java index 037d544..6efdd05 100644 --- a/src/org/vamsas/objects/core/User.java +++ b/src/org/vamsas/objects/core/User.java @@ -26,7 +26,7 @@ import org.xml.sax.ContentHandler; * * @version $Revision$ $Date$ */ -public class User extends org.vamsas.client.object +public class User extends org.vamsas.objects.core.AppData implements java.io.Serializable { @@ -45,11 +45,6 @@ implements java.io.Serializable */ private java.lang.String _organization; - /** - * Field _data - */ - private java.lang.String _data; - //----------------/ //- Constructors -/ @@ -96,30 +91,12 @@ implements java.io.Serializable } else if (temp._organization != null) return false; - if (this._data != null) { - if (temp._data == null) return false; - else if (!(this._data.equals(temp._data))) - return false; - } - else if (temp._data != null) - return false; return true; } return false; } //-- boolean equals(java.lang.Object) /** - * Returns the value of field 'data'. - * - * @return String - * @return the value of field 'data'. - */ - public java.lang.String getData() - { - return this._data; - } //-- java.lang.String getData() - - /** * Returns the value of field 'fullname'. * * @return String @@ -188,16 +165,6 @@ implements java.io.Serializable } //-- void marshal(org.xml.sax.ContentHandler) /** - * Sets the value of field 'data'. - * - * @param data the value of field 'data'. - */ - public void setData(java.lang.String data) - { - this._data = data; - } //-- void setData(java.lang.String) - - /** * Sets the value of field 'fullname'. * * @param fullname the value of field 'fullname'. @@ -223,13 +190,13 @@ implements java.io.Serializable * * * @param reader - * @return User + * @return AppData */ - public static org.vamsas.objects.core.User 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.User) Unmarshaller.unmarshal(org.vamsas.objects.core.User.class, reader); - } //-- org.vamsas.objects.core.User unmarshal(java.io.Reader) + } //-- org.vamsas.objects.core.AppData unmarshal(java.io.Reader) /** * Method validate diff --git a/src/org/vamsas/objects/core/UserDescriptor.java b/src/org/vamsas/objects/core/UserDescriptor.java index c38181a..a90dbb1 100644 --- a/src/org/vamsas/objects/core/UserDescriptor.java +++ b/src/org/vamsas/objects/core/UserDescriptor.java @@ -21,7 +21,7 @@ import org.exolab.castor.xml.validators.*; * * @version $Revision$ $Date$ */ -public class UserDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { +public class UserDescriptor extends org.vamsas.objects.core.AppDataDescriptor { //--------------------------/ @@ -56,6 +56,7 @@ public class UserDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto public UserDescriptor() { super(); + setExtendsWithoutFlatten(new org.vamsas.objects.core.AppDataDescriptor()); nsURI = "http://www.vamsas.org"; xmlName = "User"; org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; @@ -89,11 +90,13 @@ public class UserDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto } }; desc.setHandler(handler); + desc.setRequired(true); desc.setMultivalued(false); addFieldDescriptor(desc); //-- validation code for: _fullname fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); { //-- local scope StringValidator typeValidator = new StringValidator(); typeValidator.setWhiteSpace("preserve"); @@ -126,48 +129,13 @@ public class UserDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto } }; desc.setHandler(handler); + desc.setRequired(true); desc.setMultivalued(false); addFieldDescriptor(desc); //-- validation code for: _organization fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - StringValidator typeValidator = new StringValidator(); - typeValidator.setWhiteSpace("preserve"); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _data - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_data", "data", org.exolab.castor.xml.NodeType.Attribute); - desc.setImmutable(true); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - User target = (User) object; - return target.getData(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - User target = (User) object; - target.setData( (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: _data - fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); { //-- local scope StringValidator typeValidator = new StringValidator(); typeValidator.setWhiteSpace("preserve"); @@ -204,7 +172,7 @@ public class UserDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto */ public org.exolab.castor.mapping.ClassDescriptor getExtends() { - return null; + return super.getExtends(); } //-- org.exolab.castor.mapping.ClassDescriptor getExtends() /** @@ -216,6 +184,8 @@ public class UserDescriptor extends org.exolab.castor.xml.util.XMLClassDescripto */ 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/VamsasDocument.java b/src/org/vamsas/objects/core/VamsasDocument.java index e553715..67debcd 100644 --- a/src/org/vamsas/objects/core/VamsasDocument.java +++ b/src/org/vamsas/objects/core/VamsasDocument.java @@ -58,9 +58,9 @@ implements java.io.Serializable private java.util.Vector _VAMSASList; /** - * Field _applicationData + * Field _applicationDataList */ - private ApplicationData _applicationData; + private java.util.Vector _applicationDataList; //----------------/ @@ -71,6 +71,7 @@ implements java.io.Serializable { super(); _VAMSASList = new Vector(); + _applicationDataList = new Vector(); } //-- org.vamsas.objects.core.VamsasDocument() @@ -79,6 +80,33 @@ implements java.io.Serializable //-----------/ /** + * Method addApplicationData + * + * + * + * @param vApplicationData + */ + public void addApplicationData(ApplicationData vApplicationData) + throws java.lang.IndexOutOfBoundsException + { + _applicationDataList.addElement(vApplicationData); + } //-- void addApplicationData(ApplicationData) + + /** + * Method addApplicationData + * + * + * + * @param index + * @param vApplicationData + */ + public void addApplicationData(int index, ApplicationData vApplicationData) + throws java.lang.IndexOutOfBoundsException + { + _applicationDataList.insertElementAt(vApplicationData, index); + } //-- void addApplicationData(int, ApplicationData) + + /** * Method addVAMSAS * * @@ -106,6 +134,18 @@ implements java.io.Serializable } //-- void addVAMSAS(int, VAMSAS) /** + * Method enumerateApplicationData + * + * + * + * @return Enumeration + */ + public java.util.Enumeration enumerateApplicationData() + { + return _applicationDataList.elements(); + } //-- java.util.Enumeration enumerateApplicationData() + + /** * Method enumerateVAMSAS * * @@ -162,12 +202,12 @@ implements java.io.Serializable } else if (temp._VAMSASList != null) return false; - if (this._applicationData != null) { - if (temp._applicationData == null) return false; - else if (!(this._applicationData.equals(temp._applicationData))) + if (this._applicationDataList != null) { + if (temp._applicationDataList == null) return false; + else if (!(this._applicationDataList.equals(temp._applicationDataList))) return false; } - else if (temp._applicationData != null) + else if (temp._applicationDataList != null) return false; return true; } @@ -175,15 +215,52 @@ implements java.io.Serializable } //-- boolean equals(java.lang.Object) /** - * Returns the value of field 'applicationData'. + * Method getApplicationData + * + * + * + * @param index + * @return ApplicationData + */ + public ApplicationData getApplicationData(int index) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _applicationDataList.size())) { + throw new IndexOutOfBoundsException("getApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]"); + } + + return (ApplicationData) _applicationDataList.elementAt(index); + } //-- ApplicationData getApplicationData(int) + + /** + * Method getApplicationData + * + * * * @return ApplicationData - * @return the value of field 'applicationData'. */ - public ApplicationData getApplicationData() + public ApplicationData[] getApplicationData() { - return this._applicationData; - } //-- ApplicationData getApplicationData() + int size = _applicationDataList.size(); + ApplicationData[] mArray = new ApplicationData[size]; + for (int index = 0; index < size; index++) { + mArray[index] = (ApplicationData) _applicationDataList.elementAt(index); + } + return mArray; + } //-- ApplicationData[] getApplicationData() + + /** + * Method getApplicationDataCount + * + * + * + * @return int + */ + public int getApplicationDataCount() + { + return _applicationDataList.size(); + } //-- int getApplicationDataCount() /** * Returns the value of field 'lockFile'. @@ -315,6 +392,15 @@ implements java.io.Serializable } //-- void marshal(org.xml.sax.ContentHandler) /** + * Method removeAllApplicationData + * + */ + public void removeAllApplicationData() + { + _applicationDataList.removeAllElements(); + } //-- void removeAllApplicationData() + + /** * Method removeAllVAMSAS * */ @@ -324,6 +410,21 @@ implements java.io.Serializable } //-- void removeAllVAMSAS() /** + * Method removeApplicationData + * + * + * + * @param index + * @return ApplicationData + */ + public ApplicationData removeApplicationData(int index) + { + java.lang.Object obj = _applicationDataList.elementAt(index); + _applicationDataList.removeElementAt(index); + return (ApplicationData) obj; + } //-- ApplicationData removeApplicationData(int) + + /** * Method removeVAMSAS * * @@ -339,13 +440,37 @@ implements java.io.Serializable } //-- VAMSAS removeVAMSAS(int) /** - * Sets the value of field 'applicationData'. + * Method setApplicationData + * + * + * + * @param index + * @param vApplicationData + */ + public void setApplicationData(int index, ApplicationData vApplicationData) + throws java.lang.IndexOutOfBoundsException + { + //-- check bounds for index + if ((index < 0) || (index > _applicationDataList.size())) { + throw new IndexOutOfBoundsException("setApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]"); + } + _applicationDataList.setElementAt(vApplicationData, index); + } //-- void setApplicationData(int, ApplicationData) + + /** + * Method setApplicationData + * + * * - * @param applicationData the value of field 'applicationData'. + * @param applicationDataArray */ - public void setApplicationData(ApplicationData applicationData) + public void setApplicationData(ApplicationData[] applicationDataArray) { - this._applicationData = applicationData; + //-- copy array + _applicationDataList.removeAllElements(); + for (int i = 0; i < applicationDataArray.length; i++) { + _applicationDataList.addElement(applicationDataArray[i]); + } } //-- void setApplicationData(ApplicationData) /** diff --git a/src/org/vamsas/objects/core/VamsasDocumentDescriptor.java b/src/org/vamsas/objects/core/VamsasDocumentDescriptor.java index 66c1796..3181ad4 100644 --- a/src/org/vamsas/objects/core/VamsasDocumentDescriptor.java +++ b/src/org/vamsas/objects/core/VamsasDocumentDescriptor.java @@ -212,8 +212,8 @@ public class VamsasDocumentDescriptor extends org.exolab.castor.xml.util.XMLClas { //-- local scope } desc.setValidator(fieldValidator); - //-- _applicationData - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(ApplicationData.class, "_applicationData", "ApplicationData", org.exolab.castor.xml.NodeType.Element); + //-- _applicationDataList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(ApplicationData.class, "_applicationDataList", "ApplicationData", org.exolab.castor.xml.NodeType.Element); handler = new org.exolab.castor.xml.XMLFieldHandler() { public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException @@ -226,7 +226,7 @@ public class VamsasDocumentDescriptor extends org.exolab.castor.xml.util.XMLClas { try { VamsasDocument target = (VamsasDocument) object; - target.setApplicationData( (ApplicationData) value); + target.addApplicationData( (ApplicationData) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -238,11 +238,12 @@ public class VamsasDocumentDescriptor extends org.exolab.castor.xml.util.XMLClas }; desc.setHandler(handler); desc.setNameSpaceURI("http://www.vamsas.org"); - desc.setMultivalued(false); + desc.setMultivalued(true); addFieldDescriptor(desc); - //-- validation code for: _applicationData + //-- validation code for: _applicationDataList fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); { //-- local scope } desc.setValidator(fieldValidator);