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 org.exolab.castor.xml.util.XMLClassDescriptorImpl {
24 //--------------------------/
25 //- Class/Member Variables -/
26 //--------------------------/
29 * Field _elementDefinition.
31 private boolean _elementDefinition;
36 private java.lang.String _nsPrefix;
41 private java.lang.String _nsURI;
46 private java.lang.String _xmlName;
53 public SecondaryStructureDescriptor() {
55 _nsURI = "www.jalview.org";
56 _xmlName = "secondaryStructure";
57 _elementDefinition = true;
58 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
59 org.exolab.castor.mapping.FieldHandler handler = null;
60 org.exolab.castor.xml.FieldValidator fieldValidator = null;
61 //-- initialize attribute descriptors
64 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", org.exolab.castor.xml.NodeType.Attribute);
65 desc.setImmutable(true);
66 handler = new org.exolab.castor.xml.XMLFieldHandler() {
67 public java.lang.Object getValue( java.lang.Object object )
68 throws IllegalStateException
70 SecondaryStructure target = (SecondaryStructure) object;
71 return target.getTitle();
73 public void setValue( java.lang.Object object, java.lang.Object value)
74 throws IllegalStateException, IllegalArgumentException
77 SecondaryStructure target = (SecondaryStructure) object;
78 target.setTitle( (java.lang.String) value);
79 } catch (java.lang.Exception ex) {
80 throw new IllegalStateException(ex.toString());
83 public java.lang.Object newInstance(java.lang.Object parent) {
87 desc.setHandler(handler);
88 desc.setMultivalued(false);
89 addFieldDescriptor(desc);
91 //-- validation code for: _title
92 fieldValidator = new org.exolab.castor.xml.FieldValidator();
94 org.exolab.castor.xml.validators.StringValidator typeValidator;
95 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
96 fieldValidator.setValidator(typeValidator);
97 typeValidator.setWhiteSpace("preserve");
99 desc.setValidator(fieldValidator);
101 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_annotationId", "annotationId", org.exolab.castor.xml.NodeType.Attribute);
102 desc.setImmutable(true);
103 handler = new org.exolab.castor.xml.XMLFieldHandler() {
104 public java.lang.Object getValue( java.lang.Object object )
105 throws IllegalStateException
107 SecondaryStructure target = (SecondaryStructure) object;
108 return target.getAnnotationId();
110 public void setValue( java.lang.Object object, java.lang.Object value)
111 throws IllegalStateException, IllegalArgumentException
114 SecondaryStructure target = (SecondaryStructure) object;
115 target.setAnnotationId( (java.lang.String) value);
116 } catch (java.lang.Exception ex) {
117 throw new IllegalStateException(ex.toString());
120 public java.lang.Object newInstance(java.lang.Object parent) {
124 desc.setHandler(handler);
125 desc.setRequired(true);
126 desc.setMultivalued(false);
127 addFieldDescriptor(desc);
129 //-- validation code for: _annotationId
130 fieldValidator = new org.exolab.castor.xml.FieldValidator();
131 fieldValidator.setMinOccurs(1);
133 org.exolab.castor.xml.validators.StringValidator typeValidator;
134 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
135 fieldValidator.setValidator(typeValidator);
136 typeValidator.setWhiteSpace("preserve");
138 desc.setValidator(fieldValidator);
140 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_gapped", "gapped", org.exolab.castor.xml.NodeType.Attribute);
141 handler = new org.exolab.castor.xml.XMLFieldHandler() {
142 public java.lang.Object getValue( java.lang.Object object )
143 throws IllegalStateException
145 SecondaryStructure target = (SecondaryStructure) object;
146 if (!target.hasGapped()) { return null; }
147 return (target.getGapped() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
149 public void setValue( java.lang.Object object, java.lang.Object value)
150 throws IllegalStateException, IllegalArgumentException
153 SecondaryStructure target = (SecondaryStructure) object;
154 // if null, use delete method for optional primitives
156 target.deleteGapped();
159 target.setGapped( ((java.lang.Boolean) value).booleanValue());
160 } catch (java.lang.Exception ex) {
161 throw new IllegalStateException(ex.toString());
164 public java.lang.Object newInstance(java.lang.Object parent) {
168 desc.setHandler(handler);
169 desc.setMultivalued(false);
170 addFieldDescriptor(desc);
172 //-- validation code for: _gapped
173 fieldValidator = new org.exolab.castor.xml.FieldValidator();
175 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
176 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
177 fieldValidator.setValidator(typeValidator);
179 desc.setValidator(fieldValidator);
181 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_viewerState", "viewerState", org.exolab.castor.xml.NodeType.Attribute);
182 desc.setImmutable(true);
183 handler = new org.exolab.castor.xml.XMLFieldHandler() {
184 public java.lang.Object getValue( java.lang.Object object )
185 throws IllegalStateException
187 SecondaryStructure target = (SecondaryStructure) object;
188 return target.getViewerState();
190 public void setValue( java.lang.Object object, java.lang.Object value)
191 throws IllegalStateException, IllegalArgumentException
194 SecondaryStructure target = (SecondaryStructure) object;
195 target.setViewerState( (java.lang.String) value);
196 } catch (java.lang.Exception ex) {
197 throw new IllegalStateException(ex.toString());
200 public java.lang.Object newInstance(java.lang.Object parent) {
204 desc.setHandler(handler);
205 desc.setMultivalued(false);
206 addFieldDescriptor(desc);
208 //-- validation code for: _viewerState
209 fieldValidator = new org.exolab.castor.xml.FieldValidator();
211 org.exolab.castor.xml.validators.StringValidator typeValidator;
212 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
213 fieldValidator.setValidator(typeValidator);
214 typeValidator.setWhiteSpace("preserve");
216 desc.setValidator(fieldValidator);
217 //-- initialize element descriptors
227 * Method getAccessMode.
229 * @return the access mode specified for this class.
231 public org.exolab.castor.mapping.AccessMode getAccessMode(
237 * Method getIdentity.
239 * @return the identity field, null if this class has no
242 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
244 return super.getIdentity();
248 * Method getJavaClass.
250 * @return the Java class represented by this descriptor.
252 public java.lang.Class getJavaClass(
254 return jalview.schemabinding.version2.SecondaryStructure.class;
258 * Method getNameSpacePrefix.
260 * @return the namespace prefix to use when marshaling as XML.
262 public java.lang.String getNameSpacePrefix(
268 * Method getNameSpaceURI.
270 * @return the namespace URI used when marshaling and
271 * unmarshaling as XML.
273 public java.lang.String getNameSpaceURI(
279 * Method getValidator.
281 * @return a specific validator for the class described by this
284 public org.exolab.castor.xml.TypeValidator getValidator(
292 * @return the XML Name for the Class being described.
294 public java.lang.String getXMLName(
300 * Method isElementDefinition.
302 * @return true if XML schema definition of this Class is that
304 * element or element with anonymous type definition.
306 public boolean isElementDefinition(
308 return _elementDefinition;