From 4f90ed0584b74a10f19f9bbf69642a51c41c9062 Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 20 Sep 2005 19:12:04 +0000 Subject: [PATCH] made vamsas a proper root element in schema and added example document. git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@45 be28352e-c001-0410-b1a7-c7978e42abec --- .classpath | 1 + .../Build VamsasClient [Builder].launch | 31 ++ .project | 10 - .settings/org.eclipse.jdt.core.prefs | 12 +- .settings/org.eclipse.jdt.ui.prefs | 3 +- schemas/coreObject.xml | 87 +++++ schemas/vamsas.xsd | 150 ++++---- src/org/vamsas/objects/core/.castor.cdr | 2 +- src/org/vamsas/objects/core/Alignment.java | 90 +++++ .../vamsas/objects/core/AlignmentDescriptor.java | 81 +++++ src/org/vamsas/objects/core/ProvenanceItem.java | 71 ---- .../objects/core/ProvenanceItemDescriptor.java | 210 ----------- .../vamsas/objects/core/SequenceDescriptor.java | 2 + src/org/vamsas/objects/core/SequenceSet.java | 90 ----- .../vamsas/objects/core/SequenceSetDescriptor.java | 81 ----- src/org/vamsas/objects/core/TreeType.java | 372 -------------------- .../vamsas/objects/core/TreeTypeDescriptor.java | 284 --------------- src/org/vamsas/test/ExampleApplication.java | 8 +- 18 files changed, 388 insertions(+), 1197 deletions(-) create mode 100644 .externalToolBuilders/Build VamsasClient [Builder].launch create mode 100755 schemas/coreObject.xml delete mode 100644 src/org/vamsas/objects/core/ProvenanceItem.java delete mode 100644 src/org/vamsas/objects/core/ProvenanceItemDescriptor.java delete mode 100644 src/org/vamsas/objects/core/TreeType.java delete mode 100644 src/org/vamsas/objects/core/TreeTypeDescriptor.java diff --git a/.classpath b/.classpath index 59a3f18..dd8b515 100644 --- a/.classpath +++ b/.classpath @@ -6,5 +6,6 @@ + diff --git a/.externalToolBuilders/Build VamsasClient [Builder].launch b/.externalToolBuilders/Build VamsasClient [Builder].launch new file mode 100644 index 0000000..011b4ea --- /dev/null +++ b/.externalToolBuilders/Build VamsasClient [Builder].launch @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project index 7f4de8e..1136a52 100644 --- a/.project +++ b/.project @@ -11,16 +11,6 @@ LaunchConfigHandle - <project>/.externalToolBuilders/org.eclipse.jdt.core.javabuilder.launch - - - - - org.eclipse.ui.externaltools.ExternalToolBuilder - full,incremental, - - - LaunchConfigHandle <project>/.externalToolBuilders/Build VamsasClient [Builder].launch diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 907a3a7..0cc9048 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,4 @@ -#Mon Sep 19 20:49:22 BST 2005 +#Tue Sep 20 11:30:35 BST 2005 eclipse.preferences.version=1 org.eclipse.jdt.core.codeComplete.argumentPrefixes= org.eclipse.jdt.core.codeComplete.argumentSuffixes= @@ -8,6 +8,16 @@ org.eclipse.jdt.core.codeComplete.localPrefixes= org.eclipse.jdt.core.codeComplete.localSuffixes= org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +org.eclipse.jdt.core.compiler.source=1.3 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs index 377aed5..dbfccb7 100644 --- a/.settings/org.eclipse.jdt.ui.prefs +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -1,6 +1,7 @@ -#Mon Sep 19 20:49:22 BST 2005 +#Tue Sep 20 11:34:19 BST 2005 eclipse.preferences.version=1 formatter_settings_version=8 +internal.default.compliance=default org.eclipse.jdt.ui.exception.name=e org.eclipse.jdt.ui.gettersetter.use.is=true org.eclipse.jdt.ui.javadoc=false diff --git a/schemas/coreObject.xml b/schemas/coreObject.xml new file mode 100755 index 0000000..810dde4 --- /dev/null +++ b/schemas/coreObject.xml @@ -0,0 +1,87 @@ + + + + + KTAIITGGSRGIGKSIAIKLGKLGASIVLNYRNNTDALKNTIRELEDLNINVIAVQGDISNYKECEKIIKAALDKFNGIDILVNNAGITADNLILRMKEEEFDKVIETNLKGTFNCVKHCIPMIKRRYGKIINISSVVGVAGNVGQCNYAAAKAGVIGFTKSLAKEL + Q899P0 + + + KIAIVTGASSGIGRAIAFKLASRGANLILGDVKIDELRKVAEEIAKETKVKVIPLYVNVGDFNSTKEFYNKGISELGVDYVDILVNNAGINRDALFVKMTYEQWDEVIKVDLYSMFNMTKQVVDMVKRNYGRIINISSLSWLGNIGQANYSAAKAGVIGFTKTLAREL + Q972M3 + + + KVIVITGASSGIGEQVAMQVAEQGATPVLMARTEEKLKALADKIKETYNTPCYYYVLDVSEETEVQSVFSKVLQEVGRIDILVNNAGFGIFKTFEDASMDEVKDMFQVNVFGLVACTKAVLPYMVKRNGHIINIASLAGKIATPKSSAYAATKHAVLGFTNSLRMEL + Q81M93 + + + KIALVTGAMGGLGTAICQALAKDGCIVAANCLPNFEPAAAWLGQQEALGFKFYVAEGDVSDFESCKAMVAKIEADLGPVDILVNNAGITRDKFFAKMDKAQWDAVIATNLSSLFNVTQQVSPKMERGWGRIINISSVNGVKGQAGQTNYSAAKAGVIGFTKALAAEL + NODG_AZOBR + + + QTAVVTGGGKGIGRAICLALAREGADIVIAARTEKDIRETARMVEKEGRKALPVSTDIRVEEDVENMISEAVDAFGRIDILVNNAGVAYRKYMVETSTEEYDNIMDTNLKGMFFCTKYALPYLLKREGRIINISSGAGKHGIPKLSIYSASKFAVIGFTESIAYEI + Q8PS57 + + + KTAIVTGAARGIGKAIALKFAAEGANIAFTDLVIDENAEKTRVELEAMGVKAKGYASNAANFEDTAKVVEEIHKDFGRIDILVNNAGITRDGLMMRMSEQQWDMVINVNLKSAFNFIHACTPMMRQKAGSIINMASVVGVHGNAGQANYAASKAGMIALAKSIAQEL + Q8A195 + + + KVVVVTGAGSGIGEATAKRFAHEGASVVLVGRNQEKLAKVAAQLKGAEHLIRATDVADLTDVEALFKEVAERFGRLDVLVNNAGVVKSGKVTELGVEDWKAVMSVDLDGVFYCTRTAMPALIASKGNIINVSSVSGLGGDWGMSFYNAAKGAITNFTRALALD + Q888G8 + + + KVALVTGAANGIGLAIAERLYQEGATLALADWNEEQLAIVIEQFDSARVYAQKVDVSDPEQVQALVRKTVERFGRLDILVNNAGIHIPGTVLECSVQDWRRIASVNIDGVVYCAMHALPELIKTRGCMVNTASVSGLGGDWGAAFYCATKGAVVNFTRALALD + Q9KRP5 + + + KIALVTGASRGIGRAIAELLVERGATVIGTATSEGGAAAISEYLGENGKGLALNVTDVESIEATLKAINDEFGAIDILVNNAGITRDNLLMRMKDDEWNDIINTNLTPIYRMSKAVLRMMKKRAGRIINVGSVVGTMGNAGQTNYAAAKAGVIGFTKSMAREV + Q87N22 + + + + KTAIITGGSRGIGKSIAIKLGKLGASIVLNYRNNTDALKNTIRELEDLN--INVIAVQGDISNYKECEKIIKAALDKFNG--IDILVNNAGITADNLILRMKEEEFDKVIETNLKGTFNCVKHCIPMIKRRYGKIINISSVVGVAGNVGQCNYAAAKAGVIGFTKSLAKEL + Q899P0 + + + KIAIVTGASSGIGRAIAFKLASRGANLILGDVKIDEL--RKVAEEIAKETKVKVIPLYVNVGDFNSTKEFYNKGISELGVDYVDILVNNAGINRDALFVKMTYEQWDEVIKVDLYSMFNMTKQVVDMVKRNYGRIINISSLSWL-GNIGQANYSAAKAGVIGFTKTLAREL + Q972M3 + + + KVIVITGASSGIGEQVAMQVAEQGATPVLMARTEEKL--KALADKIKETYNTPCYYYVLDVSEETEVQSVFSKVLQEVGR--IDILVNNAGFGIFKTFEDASMDEVKDMFQVNVFGLVACTKAVLPYMVKRNGHIINIASLAGKIATPKSSAYAATKHAVLGFTNSLRMEL + Q81M93 + + + KIALVTGAMGGLGTAICQALAKDGCIVAANCLPNFEPAAAWLGQQEALG--FKFYVAEGDVSDFESCKAMVAKIEADLGP--VDILVNNAGITRDKFFAKMDKAQWDAVIATNLSSLFNVTQQVSPKMERGWGRIINISSVNGVKGQAGQTNYSAAKAGVIGFTKALAAEL + NODG_AZOBR + + + QTAVVTGGGKGIGRAICLALAREGADIVIAARTEKDI--RETARMVEKEG-RKALPVSTDIRVEEDVENMISEAVDAFGR--IDILVNNAGVAYRKYMVETSTEEYDNIMDTNLKGMFFCTKYALPYLLKREGRIINISSGAGKHGIPKLSIYSASKFAVIGFTESIAYEI + Q8PS57 + + + KTAIVTGAARGIGKAIALKFAAEGANIAFTDLVIDENAEKTRVELEAMG--VKAKGYASNAANFEDTAKVVEEIHKDFGR--IDILVNNAGITRDGLMMRMSEQQWDMVINVNLKSAFNFIHACTPMMRQKAGSIINMASVVGVHGNAGQANYAASKAGMIALAKSIAQEL + Q8A195 + + + KVVVVTGAGSGIGEATAKRFAHEGASVVLVGRNQEKL--AKVAAQLKG---AEHLIRATDVADLTDVEALFKEVAERFGR--LDVLVNNAGVVKSGKVTELGVEDWKAVMSVDLDGVFYCTRTAMPALIASKGNIINVSSVSGLGGDWGMSFYNAAKGAITNFTRALALD- + Q888G8 + + + KVALVTGAANGIGLAIAERLYQEGATLALADWNEEQL--AIVIEQFDS---ARVYAQKVDVSDPEQVQALVRKTVERFGR--LDILVNNAGIHIPGTVLECSVQDWRRIASVNIDGVVYCAMHALPELIKTRGCMVNTASVSGLGGDWGAAFYCATKGAVVNFTRALALD- + Q9KRP5 + + + KIALVTGASRGIGRAIAELLVERGATVIGTATSEGGA--AAISEYLG----ENGKGLALNVTDVESIEATLKAINDEFGA--IDILVNNAGITRDNLLMRMKDDEWNDIINTNLTPIYRMSKAVLRMMKKRAGRIINVGSVVGTMGNAGQTNYAAAKAGVIGFTKSMAREV + Q87N22 + + + + jim + edited + 2005-12-21 + + + + + diff --git a/schemas/vamsas.xsd b/schemas/vamsas.xsd index 6b591a7..9487eca 100644 --- a/schemas/vamsas.xsd +++ b/schemas/vamsas.xsd @@ -3,43 +3,43 @@ - - DESCRIPTION + + Vamsas Document Version Number - - - - - - + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - @@ -51,13 +51,12 @@ - + - @@ -66,16 +65,16 @@ - - - - - - - + + + + + + + - + @@ -93,7 +92,7 @@ - + @@ -108,7 +107,7 @@ - + @@ -116,7 +115,7 @@ - + @@ -124,15 +123,15 @@ - + + + - - - + @@ -150,10 +149,10 @@ - + - + @@ -161,26 +160,27 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/org/vamsas/objects/core/.castor.cdr b/src/org/vamsas/objects/core/.castor.cdr index ffd7903..7f554df 100644 --- a/src/org/vamsas/objects/core/.castor.cdr +++ b/src/org/vamsas/objects/core/.castor.cdr @@ -6,8 +6,8 @@ org.vamsas.objects.core.Newick=org.vamsas.objects.core.NewickDescriptor org.vamsas.objects.core.AnnotationElement=org.vamsas.objects.core.AnnotationEle... org.vamsas.objects.core.AlignmentSequence=org.vamsas.objects.core.AlignmentSequ... org.vamsas.objects.core.Alignment=org.vamsas.objects.core.AlignmentDesc... -org.vamsas.objects.core.DbRef=org.vamsas.objects.core.DbRefDescriptor org.vamsas.objects.core.User=org.vamsas.objects.core.UserDescriptor +org.vamsas.objects.core.DbRef=org.vamsas.objects.core.DbRefDescriptor org.vamsas.objects.core.SequenceSetAnnotations=org.vamsas.objects.core.SequenceSetAn... org.vamsas.objects.core.Application=org.vamsas.objects.core.ApplicationDe... org.vamsas.objects.core.VAMSAS=org.vamsas.objects.core.VAMSASDescriptor diff --git a/src/org/vamsas/objects/core/Alignment.java b/src/org/vamsas/objects/core/Alignment.java index 9a6d432..68cf78b 100644 --- a/src/org/vamsas/objects/core/Alignment.java +++ b/src/org/vamsas/objects/core/Alignment.java @@ -38,6 +38,21 @@ implements java.io.Serializable //--------------------------/ /** + * Field _gapChar + */ + private java.lang.String _gapChar; + + /** + * Field _aligned + */ + private boolean _aligned; + + /** + * keeps track of state for field: _aligned + */ + private boolean _has_aligned; + + /** * Field _id */ private java.lang.String _id; @@ -134,6 +149,15 @@ implements java.io.Serializable } //-- void addTree(int, org.vamsas.objects.core.Tree) /** + * Method deleteAligned + * + */ + public void deleteAligned() + { + this._has_aligned= false; + } //-- void deleteAligned() + + /** * Method enumerateAlignmentSequence * * @@ -174,6 +198,17 @@ implements java.io.Serializable if (obj instanceof Alignment) { Alignment temp = (Alignment)obj; + if (this._gapChar != null) { + if (temp._gapChar == null) return false; + else if (!(this._gapChar.equals(temp._gapChar))) + return false; + } + else if (temp._gapChar != null) + return false; + if (this._aligned != temp._aligned) + return false; + if (this._has_aligned != temp._has_aligned) + return false; if (this._id != null) { if (temp._id == null) return false; else if (!(this._id.equals(temp._id))) @@ -215,6 +250,17 @@ implements java.io.Serializable } //-- boolean equals(java.lang.Object) /** + * Returns the value of field 'aligned'. + * + * @return boolean + * @return the value of field 'aligned'. + */ + public boolean getAligned() + { + return this._aligned; + } //-- boolean getAligned() + + /** * Returns the value of field 'alignmentAnnotations'. * * @return AlignmentAnnotations @@ -274,6 +320,17 @@ implements java.io.Serializable } //-- int getAlignmentSequenceCount() /** + * Returns the value of field 'gapChar'. + * + * @return String + * @return the value of field 'gapChar'. + */ + public java.lang.String getGapChar() + { + return this._gapChar; + } //-- java.lang.String getGapChar() + + /** * Returns the value of field 'id'. * * @return String @@ -344,6 +401,18 @@ implements java.io.Serializable } //-- int getTreeCount() /** + * Method hasAligned + * + * + * + * @return boolean + */ + public boolean hasAligned() + { + return this._has_aligned; + } //-- boolean hasAligned() + + /** * Method isValid * * @@ -438,6 +507,17 @@ implements java.io.Serializable } //-- org.vamsas.objects.core.Tree removeTree(int) /** + * Sets the value of field 'aligned'. + * + * @param aligned the value of field 'aligned'. + */ + public void setAligned(boolean aligned) + { + this._aligned = aligned; + this._has_aligned = true; + } //-- void setAligned(boolean) + + /** * Sets the value of field 'alignmentAnnotations'. * * @param alignmentAnnotations the value of field @@ -483,6 +563,16 @@ implements java.io.Serializable } //-- void setAlignmentSequence(org.vamsas.objects.core.AlignmentSequence) /** + * Sets the value of field 'gapChar'. + * + * @param gapChar the value of field 'gapChar'. + */ + public void setGapChar(java.lang.String gapChar) + { + this._gapChar = gapChar; + } //-- void setGapChar(java.lang.String) + + /** * Sets the value of field 'id'. * * @param id the value of field 'id'. diff --git a/src/org/vamsas/objects/core/AlignmentDescriptor.java b/src/org/vamsas/objects/core/AlignmentDescriptor.java index 4d65fe1..b5292e3 100644 --- a/src/org/vamsas/objects/core/AlignmentDescriptor.java +++ b/src/org/vamsas/objects/core/AlignmentDescriptor.java @@ -66,6 +66,87 @@ public class AlignmentDescriptor extends org.exolab.castor.xml.util.XMLClassDesc org.exolab.castor.xml.FieldValidator fieldValidator = null; //-- initialize attribute descriptors + //-- _gapChar + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_gapChar", "gapChar", org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + return target.getGapChar(); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + target.setGapChar( (java.lang.String) value); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _gapChar + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { //-- local scope + StringValidator typeValidator = new StringValidator(); + typeValidator.setWhiteSpace("preserve"); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + //-- _aligned + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_aligned", "aligned", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() { + public java.lang.Object getValue( java.lang.Object object ) + throws IllegalStateException + { + Alignment target = (Alignment) object; + if(!target.hasAligned()) + return null; + return (target.getAligned() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); + } + public void setValue( java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try { + Alignment target = (Alignment) object; + // if null, use delete method for optional primitives + if (value == null) { + target.deleteAligned(); + return; + } + target.setAligned( ((java.lang.Boolean)value).booleanValue()); + } + catch (java.lang.Exception ex) { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance( java.lang.Object parent ) { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + //-- validation code for: _aligned + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { //-- local scope + BooleanValidator typeValidator = new BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); //-- _id desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); this.identity = desc; diff --git a/src/org/vamsas/objects/core/ProvenanceItem.java b/src/org/vamsas/objects/core/ProvenanceItem.java deleted file mode 100644 index 692b53b..0000000 --- a/src/org/vamsas/objects/core/ProvenanceItem.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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.Serializable; -import org.exolab.castor.xml.Marshaller; -import org.exolab.castor.xml.Unmarshaller; - -/** - * Class ProvenanceItem. - * - * @version $Revision$ $Date$ - */ -public class ProvenanceItem implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _entry - */ - private org.vamsas.objects.core.Entry _entry; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public ProvenanceItem() - { - super(); - } //-- org.vamsas.objects.core.ProvenanceItem() - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'entry'. - * - * @return Entry - * @return the value of field 'entry'. - */ - public org.vamsas.objects.core.Entry getEntry() - { - return this._entry; - } //-- org.vamsas.objects.core.Entry getEntry() - - /** - * Sets the value of field 'entry'. - * - * @param entry the value of field 'entry'. - */ - public void setEntry(org.vamsas.objects.core.Entry entry) - { - this._entry = entry; - } //-- void setEntry(org.vamsas.objects.core.Entry) - -} diff --git a/src/org/vamsas/objects/core/ProvenanceItemDescriptor.java b/src/org/vamsas/objects/core/ProvenanceItemDescriptor.java deleted file mode 100644 index 9bb7343..0000000 --- a/src/org/vamsas/objects/core/ProvenanceItemDescriptor.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * 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 ProvenanceItemDescriptor. - * - * @version $Revision$ $Date$ - */ -public class ProvenanceItemDescriptor 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 ProvenanceItemDescriptor() - { - super(); - nsURI = "http://www.vamsas.org"; - xmlName = "Provenance"; - - //-- set grouping compositor - setCompositorAsSequence(); - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- initialize element descriptors - - //-- _entry - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.vamsas.objects.core.Entry.class, "_entry", "entry", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - ProvenanceItem target = (ProvenanceItem) object; - return target.getEntry(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - ProvenanceItem target = (ProvenanceItem) object; - target.setEntry( (org.vamsas.objects.core.Entry) value); - } - catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance( java.lang.Object parent ) { - return new org.vamsas.objects.core.Entry(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("http://www.vamsas.org"); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _entry - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - } - desc.setValidator(fieldValidator); - } //-- org.vamsas.objects.core.ProvenanceItemDescriptor() - - - //-----------/ - //- 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.ProvenanceItem.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/SequenceDescriptor.java b/src/org/vamsas/objects/core/SequenceDescriptor.java index 7486c01..6f1d48d 100644 --- a/src/org/vamsas/objects/core/SequenceDescriptor.java +++ b/src/org/vamsas/objects/core/SequenceDescriptor.java @@ -93,11 +93,13 @@ 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); diff --git a/src/org/vamsas/objects/core/SequenceSet.java b/src/org/vamsas/objects/core/SequenceSet.java index 816da66..5bef63a 100644 --- a/src/org/vamsas/objects/core/SequenceSet.java +++ b/src/org/vamsas/objects/core/SequenceSet.java @@ -38,21 +38,6 @@ implements java.io.Serializable //--------------------------/ /** - * Field _gapChar - */ - private java.lang.String _gapChar; - - /** - * Field _aligned - */ - private boolean _aligned; - - /** - * keeps track of state for field: _aligned - */ - private boolean _has_aligned; - - /** * Field _id */ private java.lang.String _id; @@ -210,15 +195,6 @@ implements java.io.Serializable } //-- void addTree(int, org.vamsas.objects.core.Tree) /** - * Method deleteAligned - * - */ - public void deleteAligned() - { - this._has_aligned= false; - } //-- void deleteAligned() - - /** * Method enumerateAlignment * * @@ -283,17 +259,6 @@ implements java.io.Serializable if (obj instanceof SequenceSet) { SequenceSet temp = (SequenceSet)obj; - if (this._gapChar != null) { - if (temp._gapChar == null) return false; - else if (!(this._gapChar.equals(temp._gapChar))) - return false; - } - else if (temp._gapChar != null) - return false; - if (this._aligned != temp._aligned) - return false; - if (this._has_aligned != temp._has_aligned) - return false; if (this._id != null) { if (temp._id == null) return false; else if (!(this._id.equals(temp._id))) @@ -342,17 +307,6 @@ implements java.io.Serializable } //-- boolean equals(java.lang.Object) /** - * Returns the value of field 'aligned'. - * - * @return boolean - * @return the value of field 'aligned'. - */ - public boolean getAligned() - { - return this._aligned; - } //-- boolean getAligned() - - /** * Method getAlignment * * @@ -401,17 +355,6 @@ implements java.io.Serializable } //-- int getAlignmentCount() /** - * Returns the value of field 'gapChar'. - * - * @return String - * @return the value of field 'gapChar'. - */ - public java.lang.String getGapChar() - { - return this._gapChar; - } //-- java.lang.String getGapChar() - - /** * Returns the value of field 'id'. * * @return String @@ -578,18 +521,6 @@ implements java.io.Serializable } //-- int getTreeCount() /** - * Method hasAligned - * - * - * - * @return boolean - */ - public boolean hasAligned() - { - return this._has_aligned; - } //-- boolean hasAligned() - - /** * Method isValid * * @@ -732,17 +663,6 @@ implements java.io.Serializable } //-- org.vamsas.objects.core.Tree removeTree(int) /** - * Sets the value of field 'aligned'. - * - * @param aligned the value of field 'aligned'. - */ - public void setAligned(boolean aligned) - { - this._aligned = aligned; - this._has_aligned = true; - } //-- void setAligned(boolean) - - /** * Method setAlignment * * @@ -777,16 +697,6 @@ implements java.io.Serializable } //-- void setAlignment(org.vamsas.objects.core.Alignment) /** - * Sets the value of field 'gapChar'. - * - * @param gapChar the value of field 'gapChar'. - */ - public void setGapChar(java.lang.String gapChar) - { - this._gapChar = gapChar; - } //-- void setGapChar(java.lang.String) - - /** * Sets the value of field 'id'. * * @param id the value of field 'id'. diff --git a/src/org/vamsas/objects/core/SequenceSetDescriptor.java b/src/org/vamsas/objects/core/SequenceSetDescriptor.java index 5c4242a..722e429 100644 --- a/src/org/vamsas/objects/core/SequenceSetDescriptor.java +++ b/src/org/vamsas/objects/core/SequenceSetDescriptor.java @@ -66,87 +66,6 @@ public class SequenceSetDescriptor extends org.exolab.castor.xml.util.XMLClassDe org.exolab.castor.xml.FieldValidator fieldValidator = null; //-- initialize attribute descriptors - //-- _gapChar - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_gapChar", "gapChar", org.exolab.castor.xml.NodeType.Attribute); - desc.setImmutable(true); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - SequenceSet target = (SequenceSet) object; - return target.getGapChar(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceSet target = (SequenceSet) object; - target.setGapChar( (java.lang.String) value); - } - catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance( java.lang.Object parent ) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _gapChar - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - StringValidator typeValidator = new StringValidator(); - typeValidator.setWhiteSpace("preserve"); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _aligned - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_aligned", "aligned", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - SequenceSet target = (SequenceSet) object; - if(!target.hasAligned()) - return null; - return (target.getAligned() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceSet target = (SequenceSet) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteAligned(); - return; - } - target.setAligned( ((java.lang.Boolean)value).booleanValue()); - } - catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance( java.lang.Object parent ) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _aligned - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - BooleanValidator typeValidator = new BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); //-- _id desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); this.identity = desc; diff --git a/src/org/vamsas/objects/core/TreeType.java b/src/org/vamsas/objects/core/TreeType.java deleted file mode 100644 index 9cb6dca..0000000 --- a/src/org/vamsas/objects/core/TreeType.java +++ /dev/null @@ -1,372 +0,0 @@ -/* - * 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 TreeType. - * - * @version $Revision$ $Date$ - */ -public class TreeType extends org.vamsas.client.object -implements java.io.Serializable -{ - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _id - */ - private java.lang.String _id; - - /** - * Field _newickFormatList - */ - private java.util.Vector _newickFormatList; - - /** - * Field _provenance - */ - private org.vamsas.objects.core.Provenance _provenance; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public TreeType() - { - super(); - _newickFormatList = new Vector(); - } //-- org.vamsas.objects.core.TreeType() - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Method addNewickFormat - * - * - * - * @param vNewickFormat - */ - public void addNewickFormat(java.lang.String vNewickFormat) - throws java.lang.IndexOutOfBoundsException - { - _newickFormatList.addElement(vNewickFormat); - } //-- void addNewickFormat(java.lang.String) - - /** - * Method addNewickFormat - * - * - * - * @param index - * @param vNewickFormat - */ - public void addNewickFormat(int index, java.lang.String vNewickFormat) - throws java.lang.IndexOutOfBoundsException - { - _newickFormatList.insertElementAt(vNewickFormat, index); - } //-- void addNewickFormat(int, java.lang.String) - - /** - * Method enumerateNewickFormat - * - * - * - * @return Enumeration - */ - public java.util.Enumeration enumerateNewickFormat() - { - return _newickFormatList.elements(); - } //-- java.util.Enumeration enumerateNewickFormat() - - /** - * 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 TreeType) { - - TreeType temp = (TreeType)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._newickFormatList != null) { - if (temp._newickFormatList == null) return false; - else if (!(this._newickFormatList.equals(temp._newickFormatList))) - return false; - } - else if (temp._newickFormatList != null) - return false; - if (this._provenance != null) { - if (temp._provenance == null) return false; - else if (!(this._provenance.equals(temp._provenance))) - return false; - } - else if (temp._provenance != null) - return false; - return true; - } - return false; - } //-- boolean equals(java.lang.Object) - - /** - * Returns the value of field 'id'. - * - * @return String - * @return the value of field 'id'. - */ - public java.lang.String getId() - { - return this._id; - } //-- java.lang.String getId() - - /** - * Method getNewickFormat - * - * - * - * @param index - * @return String - */ - public java.lang.String getNewickFormat(int index) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _newickFormatList.size())) { - throw new IndexOutOfBoundsException("getNewickFormat: Index value '"+index+"' not in range [0.."+_newickFormatList.size()+ "]"); - } - - return (String)_newickFormatList.elementAt(index); - } //-- java.lang.String getNewickFormat(int) - - /** - * Method getNewickFormat - * - * - * - * @return String - */ - public java.lang.String[] getNewickFormat() - { - int size = _newickFormatList.size(); - java.lang.String[] mArray = new java.lang.String[size]; - for (int index = 0; index < size; index++) { - mArray[index] = (String)_newickFormatList.elementAt(index); - } - return mArray; - } //-- java.lang.String[] getNewickFormat() - - /** - * Method getNewickFormatCount - * - * - * - * @return int - */ - public int getNewickFormatCount() - { - return _newickFormatList.size(); - } //-- int getNewickFormatCount() - - /** - * 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 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 removeAllNewickFormat - * - */ - public void removeAllNewickFormat() - { - _newickFormatList.removeAllElements(); - } //-- void removeAllNewickFormat() - - /** - * Method removeNewickFormat - * - * - * - * @param index - * @return String - */ - public java.lang.String removeNewickFormat(int index) - { - java.lang.Object obj = _newickFormatList.elementAt(index); - _newickFormatList.removeElementAt(index); - return (String)obj; - } //-- java.lang.String removeNewickFormat(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) - - /** - * Method setNewickFormat - * - * - * - * @param index - * @param vNewickFormat - */ - public void setNewickFormat(int index, java.lang.String vNewickFormat) - throws java.lang.IndexOutOfBoundsException - { - //-- check bounds for index - if ((index < 0) || (index > _newickFormatList.size())) { - throw new IndexOutOfBoundsException("setNewickFormat: Index value '"+index+"' not in range [0.."+_newickFormatList.size()+ "]"); - } - _newickFormatList.setElementAt(vNewickFormat, index); - } //-- void setNewickFormat(int, java.lang.String) - - /** - * Method setNewickFormat - * - * - * - * @param newickFormatArray - */ - public void setNewickFormat(java.lang.String[] newickFormatArray) - { - //-- copy array - _newickFormatList.removeAllElements(); - for (int i = 0; i < newickFormatArray.length; i++) { - _newickFormatList.addElement(newickFormatArray[i]); - } - } //-- void setNewickFormat(java.lang.String) - - /** - * 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 TreeType - */ - public static org.vamsas.objects.core.TreeType unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - return (org.vamsas.objects.core.TreeType) Unmarshaller.unmarshal(org.vamsas.objects.core.TreeType.class, reader); - } //-- org.vamsas.objects.core.TreeType 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/TreeTypeDescriptor.java b/src/org/vamsas/objects/core/TreeTypeDescriptor.java deleted file mode 100644 index 7641bc8..0000000 --- a/src/org/vamsas/objects/core/TreeTypeDescriptor.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * 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 TreeTypeDescriptor. - * - * @version $Revision$ $Date$ - */ -public class TreeTypeDescriptor 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 TreeTypeDescriptor() - { - super(); - nsURI = "http://www.vamsas.org"; - xmlName = "TreeType"; - - //-- 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 - { - TreeType target = (TreeType) object; - return target.getId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - TreeType target = (TreeType) 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 - - //-- _newickFormatList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_newickFormatList", "newickFormat", 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 - { - TreeType target = (TreeType) object; - return target.getNewickFormat(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - TreeType target = (TreeType) object; - target.addNewickFormat( (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(true); - addFieldDescriptor(desc); - - //-- validation code for: _newickFormatList - 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); - //-- _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 - { - TreeType target = (TreeType) object; - return target.getProvenance(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - TreeType target = (TreeType) 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.TreeTypeDescriptor() - - - //-----------/ - //- 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.TreeType.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/test/ExampleApplication.java b/src/org/vamsas/test/ExampleApplication.java index 26c6381..3c52054 100644 --- a/src/org/vamsas/test/ExampleApplication.java +++ b/src/org/vamsas/test/ExampleApplication.java @@ -11,6 +11,7 @@ import org.vamsas.client.*; import java.awt.Event; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.io.IOException; import java.util.Vector; /** * Toy vamsas command line client application demonstrating the API. @@ -95,7 +96,12 @@ public class ExampleApplication { } // get IClientFactory - clientfactory = new org.vamsas.client.SimpleClientFactory(args[0]); + try { + clientfactory = new org.vamsas.client.SimpleClientFactory(args[0]); + } catch (IOException e) { + System.err.println(e+"\n"+Usage); + System.exit(1); + } // get an Iclient with session data app = new ClientHandle("org.vamsas.test.ExampleApplication","0.1"); -- 1.7.10.2