2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2.descriptors;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import jalview.schemabinding.version2.SecondaryStructure;
17 * Class SecondaryStructureDescriptor.
19 * @version $Revision$ $Date$
21 public class SecondaryStructureDescriptor extends
22 org.exolab.castor.xml.util.XMLClassDescriptorImpl
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
30 * Field _elementDefinition.
32 private boolean _elementDefinition;
37 private java.lang.String _nsPrefix;
42 private java.lang.String _nsURI;
47 private java.lang.String _xmlName;
53 public SecondaryStructureDescriptor()
56 _nsURI = "www.jalview.org";
57 _xmlName = "secondaryStructure";
58 _elementDefinition = true;
59 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
60 org.exolab.castor.mapping.FieldHandler handler = null;
61 org.exolab.castor.xml.FieldValidator fieldValidator = null;
62 // -- initialize attribute descriptors
65 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
66 java.lang.String.class, "_title", "title",
67 org.exolab.castor.xml.NodeType.Attribute);
68 desc.setImmutable(true);
69 handler = new org.exolab.castor.xml.XMLFieldHandler()
71 public java.lang.Object getValue(java.lang.Object object)
72 throws IllegalStateException
74 SecondaryStructure target = (SecondaryStructure) object;
75 return target.getTitle();
78 public void setValue(java.lang.Object object, java.lang.Object value)
79 throws IllegalStateException, IllegalArgumentException
83 SecondaryStructure target = (SecondaryStructure) object;
84 target.setTitle((java.lang.String) value);
85 } catch (java.lang.Exception ex)
87 throw new IllegalStateException(ex.toString());
91 public java.lang.Object newInstance(java.lang.Object parent)
96 desc.setHandler(handler);
97 desc.setMultivalued(false);
98 addFieldDescriptor(desc);
100 // -- validation code for: _title
101 fieldValidator = new org.exolab.castor.xml.FieldValidator();
103 org.exolab.castor.xml.validators.StringValidator typeValidator;
104 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
105 fieldValidator.setValidator(typeValidator);
106 typeValidator.setWhiteSpace("preserve");
108 desc.setValidator(fieldValidator);
110 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
111 java.lang.String.class, "_annotationId", "annotationId",
112 org.exolab.castor.xml.NodeType.Attribute);
113 desc.setImmutable(true);
114 handler = new org.exolab.castor.xml.XMLFieldHandler()
116 public java.lang.Object getValue(java.lang.Object object)
117 throws IllegalStateException
119 SecondaryStructure target = (SecondaryStructure) object;
120 return target.getAnnotationId();
123 public void setValue(java.lang.Object object, java.lang.Object value)
124 throws IllegalStateException, IllegalArgumentException
128 SecondaryStructure target = (SecondaryStructure) object;
129 target.setAnnotationId((java.lang.String) value);
130 } catch (java.lang.Exception ex)
132 throw new IllegalStateException(ex.toString());
136 public java.lang.Object newInstance(java.lang.Object parent)
141 desc.setHandler(handler);
142 desc.setRequired(true);
143 desc.setMultivalued(false);
144 addFieldDescriptor(desc);
146 // -- validation code for: _annotationId
147 fieldValidator = new org.exolab.castor.xml.FieldValidator();
148 fieldValidator.setMinOccurs(1);
150 org.exolab.castor.xml.validators.StringValidator typeValidator;
151 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
152 fieldValidator.setValidator(typeValidator);
153 typeValidator.setWhiteSpace("preserve");
155 desc.setValidator(fieldValidator);
157 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
158 java.lang.Boolean.TYPE, "_gapped", "gapped",
159 org.exolab.castor.xml.NodeType.Attribute);
160 handler = new org.exolab.castor.xml.XMLFieldHandler()
162 public java.lang.Object getValue(java.lang.Object object)
163 throws IllegalStateException
165 SecondaryStructure target = (SecondaryStructure) object;
166 if (!target.hasGapped())
170 return (target.getGapped() ? java.lang.Boolean.TRUE
171 : java.lang.Boolean.FALSE);
174 public void setValue(java.lang.Object object, java.lang.Object value)
175 throws IllegalStateException, IllegalArgumentException
179 SecondaryStructure target = (SecondaryStructure) object;
180 // if null, use delete method for optional primitives
183 target.deleteGapped();
186 target.setGapped(((java.lang.Boolean) value).booleanValue());
187 } catch (java.lang.Exception ex)
189 throw new IllegalStateException(ex.toString());
193 public java.lang.Object newInstance(java.lang.Object parent)
198 desc.setHandler(handler);
199 desc.setMultivalued(false);
200 addFieldDescriptor(desc);
202 // -- validation code for: _gapped
203 fieldValidator = new org.exolab.castor.xml.FieldValidator();
205 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
206 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
207 fieldValidator.setValidator(typeValidator);
209 desc.setValidator(fieldValidator);
211 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
212 java.lang.String.class, "_viewerState", "viewerState",
213 org.exolab.castor.xml.NodeType.Attribute);
214 desc.setImmutable(true);
215 handler = new org.exolab.castor.xml.XMLFieldHandler()
217 public java.lang.Object getValue(java.lang.Object object)
218 throws IllegalStateException
220 SecondaryStructure target = (SecondaryStructure) object;
221 return target.getViewerState();
224 public void setValue(java.lang.Object object, java.lang.Object value)
225 throws IllegalStateException, IllegalArgumentException
229 SecondaryStructure target = (SecondaryStructure) object;
230 target.setViewerState((java.lang.String) value);
231 } catch (java.lang.Exception ex)
233 throw new IllegalStateException(ex.toString());
237 public java.lang.Object newInstance(java.lang.Object parent)
242 desc.setHandler(handler);
243 desc.setMultivalued(false);
244 addFieldDescriptor(desc);
246 // -- validation code for: _viewerState
247 fieldValidator = new org.exolab.castor.xml.FieldValidator();
249 org.exolab.castor.xml.validators.StringValidator typeValidator;
250 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
251 fieldValidator.setValidator(typeValidator);
252 typeValidator.setWhiteSpace("preserve");
254 desc.setValidator(fieldValidator);
255 // -- initialize element descriptors
264 * Method getAccessMode.
266 * @return the access mode specified for this class.
268 public org.exolab.castor.mapping.AccessMode getAccessMode()
274 * Method getIdentity.
276 * @return the identity field, null if this class has no identity.
278 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
280 return super.getIdentity();
284 * Method getJavaClass.
286 * @return the Java class represented by this descriptor.
288 public java.lang.Class getJavaClass()
290 return jalview.schemabinding.version2.SecondaryStructure.class;
294 * Method getNameSpacePrefix.
296 * @return the namespace prefix to use when marshaling as XML.
298 public java.lang.String getNameSpacePrefix()
304 * Method getNameSpaceURI.
306 * @return the namespace URI used when marshaling and unmarshaling as XML.
308 public java.lang.String getNameSpaceURI()
314 * Method getValidator.
316 * @return a specific validator for the class described by this
319 public org.exolab.castor.xml.TypeValidator getValidator()
327 * @return the XML Name for the Class being described.
329 public java.lang.String getXMLName()
335 * Method isElementDefinition.
337 * @return true if XML schema definition of this Class is that of a global
338 * element or element with anonymous type definition.
340 public boolean isElementDefinition()
342 return _elementDefinition;