1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
17 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.schemabinding.version2.descriptors;
27 //---------------------------------/
28 //- Imported classes and packages -/
29 //---------------------------------/
31 import jalview.schemabinding.version2.Sequence;
34 * Class SequenceDescriptor.
36 * @version $Revision$ $Date$
38 public class SequenceDescriptor extends jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor {
41 //--------------------------/
42 //- Class/Member Variables -/
43 //--------------------------/
46 * Field _elementDefinition.
48 private boolean _elementDefinition;
53 private java.lang.String _nsPrefix;
58 private java.lang.String _nsURI;
63 private java.lang.String _xmlName;
70 public SequenceDescriptor() {
72 setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor());
73 _nsURI = "www.vamsas.ac.uk/jalview/version2";
74 _xmlName = "Sequence";
75 _elementDefinition = true;
77 //-- set grouping compositor
78 setCompositorAsSequence();
79 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
80 org.exolab.castor.mapping.FieldHandler handler = null;
81 org.exolab.castor.xml.FieldValidator fieldValidator = null;
82 //-- initialize attribute descriptors
85 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dsseqid", "dsseqid", org.exolab.castor.xml.NodeType.Attribute);
86 desc.setImmutable(true);
87 handler = new org.exolab.castor.xml.XMLFieldHandler() {
88 public java.lang.Object getValue( java.lang.Object object )
89 throws IllegalStateException
91 Sequence target = (Sequence) object;
92 return target.getDsseqid();
94 public void setValue( java.lang.Object object, java.lang.Object value)
95 throws IllegalStateException, IllegalArgumentException
98 Sequence target = (Sequence) object;
99 target.setDsseqid( (java.lang.String) value);
100 } catch (java.lang.Exception ex) {
101 throw new IllegalStateException(ex.toString());
104 public java.lang.Object newInstance(java.lang.Object parent) {
108 desc.setHandler(handler);
109 desc.setMultivalued(false);
110 addFieldDescriptor(desc);
112 //-- validation code for: _dsseqid
113 fieldValidator = new org.exolab.castor.xml.FieldValidator();
115 org.exolab.castor.xml.validators.StringValidator typeValidator;
116 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
117 fieldValidator.setValidator(typeValidator);
118 typeValidator.setWhiteSpace("preserve");
120 desc.setValidator(fieldValidator);
121 //-- initialize element descriptors
124 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.DBRef.class, "_DBRefList", "DBRef", org.exolab.castor.xml.NodeType.Element);
125 handler = new org.exolab.castor.xml.XMLFieldHandler() {
126 public java.lang.Object getValue( java.lang.Object object )
127 throws IllegalStateException
129 Sequence target = (Sequence) object;
130 return target.getDBRef();
132 public void setValue( java.lang.Object object, java.lang.Object value)
133 throws IllegalStateException, IllegalArgumentException
136 Sequence target = (Sequence) object;
137 target.addDBRef( (jalview.schemabinding.version2.DBRef) value);
138 } catch (java.lang.Exception ex) {
139 throw new IllegalStateException(ex.toString());
142 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
144 Sequence target = (Sequence) object;
145 target.removeAllDBRef();
146 } catch (java.lang.Exception ex) {
147 throw new IllegalStateException(ex.toString());
150 public java.lang.Object newInstance(java.lang.Object parent) {
151 return new jalview.schemabinding.version2.DBRef();
154 desc.setHandler(handler);
155 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
156 desc.setMultivalued(true);
157 addFieldDescriptor(desc);
159 //-- validation code for: _DBRefList
160 fieldValidator = new org.exolab.castor.xml.FieldValidator();
161 fieldValidator.setMinOccurs(0);
164 desc.setValidator(fieldValidator);
173 * Method getAccessMode.
175 * @return the access mode specified for this class.
177 public org.exolab.castor.mapping.AccessMode getAccessMode(
183 * Method getIdentity.
185 * @return the identity field, null if this class has no
188 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
190 return super.getIdentity();
194 * Method getJavaClass.
196 * @return the Java class represented by this descriptor.
198 public java.lang.Class getJavaClass(
200 return jalview.schemabinding.version2.Sequence.class;
204 * Method getNameSpacePrefix.
206 * @return the namespace prefix to use when marshaling as XML.
208 public java.lang.String getNameSpacePrefix(
214 * Method getNameSpaceURI.
216 * @return the namespace URI used when marshaling and
217 * unmarshaling as XML.
219 public java.lang.String getNameSpaceURI(
225 * Method getValidator.
227 * @return a specific validator for the class described by this
230 public org.exolab.castor.xml.TypeValidator getValidator(
238 * @return the XML Name for the Class being described.
240 public java.lang.String getXMLName(
246 * Method isElementDefinition.
248 * @return true if XML schema definition of this Class is that
250 * element or element with anonymous type definition.
252 public boolean isElementDefinition(
254 return _elementDefinition;