2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
\r
3 * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.schemabinding.version2.descriptors;
\r
21 // ---------------------------------/
\r
22 // - Imported classes and packages -/
\r
23 // ---------------------------------/
\r
25 import jalview.schemabinding.version2.Pdbids;
\r
28 * Class PdbidsDescriptor.
\r
30 * @version $Revision$ $Date$
\r
32 public class PdbidsDescriptor extends
\r
33 jalview.schemabinding.version2.descriptors.PdbentryDescriptor
\r
36 // --------------------------/
\r
37 // - Class/Member Variables -/
\r
38 // --------------------------/
\r
41 * Field _elementDefinition.
\r
43 private boolean _elementDefinition;
\r
48 private java.lang.String _nsPrefix;
\r
53 private java.lang.String _nsURI;
\r
58 private java.lang.String _xmlName;
\r
60 // ----------------/
\r
61 // - Constructors -/
\r
62 // ----------------/
\r
64 public PdbidsDescriptor()
\r
67 setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.PdbentryDescriptor());
\r
68 _nsURI = "www.jalview.org";
\r
69 _xmlName = "pdbids";
\r
70 _elementDefinition = true;
\r
72 // -- set grouping compositor
\r
73 setCompositorAsSequence();
\r
74 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
\r
75 org.exolab.castor.mapping.FieldHandler handler = null;
\r
76 org.exolab.castor.xml.FieldValidator fieldValidator = null;
\r
77 // -- initialize attribute descriptors
\r
79 // -- initialize element descriptors
\r
81 // -- _structureStateList
\r
82 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
\r
83 jalview.schemabinding.version2.StructureState.class,
\r
84 "_structureStateList", "structureState",
\r
85 org.exolab.castor.xml.NodeType.Element);
\r
86 handler = new org.exolab.castor.xml.XMLFieldHandler()
\r
88 public java.lang.Object getValue(java.lang.Object object)
\r
89 throws IllegalStateException
\r
91 Pdbids target = (Pdbids) object;
\r
92 return target.getStructureState();
\r
95 public void setValue(java.lang.Object object, java.lang.Object value)
\r
96 throws IllegalStateException, IllegalArgumentException
\r
100 Pdbids target = (Pdbids) object;
\r
102 .addStructureState((jalview.schemabinding.version2.StructureState) value);
\r
103 } catch (java.lang.Exception ex)
\r
105 throw new IllegalStateException(ex.toString());
\r
109 public void resetValue(Object object) throws IllegalStateException,
\r
110 IllegalArgumentException
\r
114 Pdbids target = (Pdbids) object;
\r
115 target.removeAllStructureState();
\r
116 } catch (java.lang.Exception ex)
\r
118 throw new IllegalStateException(ex.toString());
\r
122 public java.lang.Object newInstance(java.lang.Object parent)
\r
124 return new jalview.schemabinding.version2.StructureState();
\r
127 desc.setHandler(handler);
\r
128 desc.setNameSpaceURI("www.jalview.org");
\r
129 desc.setMultivalued(true);
\r
130 addFieldDescriptor(desc);
\r
132 // -- validation code for: _structureStateList
\r
133 fieldValidator = new org.exolab.castor.xml.FieldValidator();
\r
134 fieldValidator.setMinOccurs(0);
\r
135 { // -- local scope
\r
137 desc.setValidator(fieldValidator);
\r
145 * Method getAccessMode.
\r
147 * @return the access mode specified for this class.
\r
149 public org.exolab.castor.mapping.AccessMode getAccessMode()
\r
155 * Method getIdentity.
\r
157 * @return the identity field, null if this class has no identity.
\r
159 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
\r
161 return super.getIdentity();
\r
165 * Method getJavaClass.
\r
167 * @return the Java class represented by this descriptor.
\r
169 public java.lang.Class getJavaClass()
\r
171 return jalview.schemabinding.version2.Pdbids.class;
\r
175 * Method getNameSpacePrefix.
\r
177 * @return the namespace prefix to use when marshaling as XML.
\r
179 public java.lang.String getNameSpacePrefix()
\r
185 * Method getNameSpaceURI.
\r
187 * @return the namespace URI used when marshaling and unmarshaling as XML.
\r
189 public java.lang.String getNameSpaceURI()
\r
195 * Method getValidator.
\r
197 * @return a specific validator for the class described by this
\r
200 public org.exolab.castor.xml.TypeValidator getValidator()
\r
206 * Method getXMLName.
\r
208 * @return the XML Name for the Class being described.
\r
210 public java.lang.String getXMLName()
\r
216 * Method isElementDefinition.
\r
218 * @return true if XML schema definition of this Class is that of a global
\r
219 * element or element with anonymous type definition.
\r
221 public boolean isElementDefinition()
\r
223 return _elementDefinition;
\r