JAL-1767 schema and Castor changes for Save PCA in project
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / DoubleMatrixDescriptor.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2.descriptors;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import jalview.schemabinding.version2.DoubleMatrix;
15
16 /**
17  * Class DoubleMatrixDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class DoubleMatrixDescriptor
22         extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
23 {
24
25   // --------------------------/
26   // - Class/Member Variables -/
27   // --------------------------/
28
29   /**
30    * Field _elementDefinition.
31    */
32   private boolean _elementDefinition;
33
34   /**
35    * Field _nsPrefix.
36    */
37   private java.lang.String _nsPrefix;
38
39   /**
40    * Field _nsURI.
41    */
42   private java.lang.String _nsURI;
43
44   /**
45    * Field _xmlName.
46    */
47   private java.lang.String _xmlName;
48
49   // ----------------/
50   // - Constructors -/
51   // ----------------/
52
53   public DoubleMatrixDescriptor()
54   {
55     super();
56     _nsURI = "www.jalview.org";
57     _xmlName = "DoubleMatrix";
58     _elementDefinition = false;
59
60     // -- set grouping compositor
61     setCompositorAsSequence();
62     org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
63     org.exolab.castor.mapping.FieldHandler handler = null;
64     org.exolab.castor.xml.FieldValidator fieldValidator = null;
65     // -- initialize attribute descriptors
66
67     // -- _rows
68     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
69             java.lang.Integer.TYPE, "_rows", "rows",
70             org.exolab.castor.xml.NodeType.Attribute);
71     handler = new org.exolab.castor.xml.XMLFieldHandler()
72     {
73       public java.lang.Object getValue(java.lang.Object object)
74               throws IllegalStateException
75       {
76         DoubleMatrix target = (DoubleMatrix) object;
77         if (!target.hasRows())
78         {
79           return null;
80         }
81         return new java.lang.Integer(target.getRows());
82       }
83
84       public void setValue(java.lang.Object object, java.lang.Object value)
85               throws IllegalStateException, IllegalArgumentException
86       {
87         try
88         {
89           DoubleMatrix target = (DoubleMatrix) object;
90           // if null, use delete method for optional primitives
91           if (value == null)
92           {
93             target.deleteRows();
94             return;
95           }
96           target.setRows(((java.lang.Integer) value).intValue());
97         } catch (java.lang.Exception ex)
98         {
99           throw new IllegalStateException(ex.toString());
100         }
101       }
102
103       public java.lang.Object newInstance(java.lang.Object parent)
104       {
105         return null;
106       }
107     };
108     desc.setHandler(handler);
109     desc.setMultivalued(false);
110     addFieldDescriptor(desc);
111
112     // -- validation code for: _rows
113     fieldValidator = new org.exolab.castor.xml.FieldValidator();
114     { // -- local scope
115       org.exolab.castor.xml.validators.IntValidator typeValidator;
116       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
117       fieldValidator.setValidator(typeValidator);
118       typeValidator.setMinInclusive(-2147483648);
119       typeValidator.setMaxInclusive(2147483647);
120     }
121     desc.setValidator(fieldValidator);
122     // -- _columns
123     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
124             java.lang.Integer.TYPE, "_columns", "columns",
125             org.exolab.castor.xml.NodeType.Attribute);
126     handler = new org.exolab.castor.xml.XMLFieldHandler()
127     {
128       public java.lang.Object getValue(java.lang.Object object)
129               throws IllegalStateException
130       {
131         DoubleMatrix target = (DoubleMatrix) object;
132         if (!target.hasColumns())
133         {
134           return null;
135         }
136         return new java.lang.Integer(target.getColumns());
137       }
138
139       public void setValue(java.lang.Object object, java.lang.Object value)
140               throws IllegalStateException, IllegalArgumentException
141       {
142         try
143         {
144           DoubleMatrix target = (DoubleMatrix) object;
145           // if null, use delete method for optional primitives
146           if (value == null)
147           {
148             target.deleteColumns();
149             return;
150           }
151           target.setColumns(((java.lang.Integer) value).intValue());
152         } catch (java.lang.Exception ex)
153         {
154           throw new IllegalStateException(ex.toString());
155         }
156       }
157
158       public java.lang.Object newInstance(java.lang.Object parent)
159       {
160         return null;
161       }
162     };
163     desc.setHandler(handler);
164     desc.setMultivalued(false);
165     addFieldDescriptor(desc);
166
167     // -- validation code for: _columns
168     fieldValidator = new org.exolab.castor.xml.FieldValidator();
169     { // -- local scope
170       org.exolab.castor.xml.validators.IntValidator typeValidator;
171       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
172       fieldValidator.setValidator(typeValidator);
173       typeValidator.setMinInclusive(-2147483648);
174       typeValidator.setMaxInclusive(2147483647);
175     }
176     desc.setValidator(fieldValidator);
177     // -- initialize element descriptors
178
179     // -- _rowList
180     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
181             jalview.schemabinding.version2.Row.class, "_rowList", "row",
182             org.exolab.castor.xml.NodeType.Element);
183     handler = new org.exolab.castor.xml.XMLFieldHandler()
184     {
185       public java.lang.Object getValue(java.lang.Object object)
186               throws IllegalStateException
187       {
188         DoubleMatrix target = (DoubleMatrix) object;
189         return target.getRow();
190       }
191
192       public void setValue(java.lang.Object object, java.lang.Object value)
193               throws IllegalStateException, IllegalArgumentException
194       {
195         try
196         {
197           DoubleMatrix target = (DoubleMatrix) object;
198           target.addRow((jalview.schemabinding.version2.Row) value);
199         } catch (java.lang.Exception ex)
200         {
201           throw new IllegalStateException(ex.toString());
202         }
203       }
204
205       public void resetValue(Object object)
206               throws IllegalStateException, IllegalArgumentException
207       {
208         try
209         {
210           DoubleMatrix target = (DoubleMatrix) object;
211           target.removeAllRow();
212         } catch (java.lang.Exception ex)
213         {
214           throw new IllegalStateException(ex.toString());
215         }
216       }
217
218       public java.lang.Object newInstance(java.lang.Object parent)
219       {
220         return new jalview.schemabinding.version2.Row();
221       }
222     };
223     desc.setHandler(handler);
224     desc.setNameSpaceURI("www.jalview.org");
225     desc.setMultivalued(true);
226     addFieldDescriptor(desc);
227
228     // -- validation code for: _rowList
229     fieldValidator = new org.exolab.castor.xml.FieldValidator();
230     fieldValidator.setMinOccurs(0);
231     { // -- local scope
232     }
233     desc.setValidator(fieldValidator);
234   }
235
236   // -----------/
237   // - Methods -/
238   // -----------/
239
240   /**
241    * Method getAccessMode.
242    * 
243    * @return the access mode specified for this class.
244    */
245   public org.exolab.castor.mapping.AccessMode getAccessMode()
246   {
247     return null;
248   }
249
250   /**
251    * Method getIdentity.
252    * 
253    * @return the identity field, null if this class has no identity.
254    */
255   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
256   {
257     return super.getIdentity();
258   }
259
260   /**
261    * Method getJavaClass.
262    * 
263    * @return the Java class represented by this descriptor.
264    */
265   public java.lang.Class getJavaClass()
266   {
267     return jalview.schemabinding.version2.DoubleMatrix.class;
268   }
269
270   /**
271    * Method getNameSpacePrefix.
272    * 
273    * @return the namespace prefix to use when marshaling as XML.
274    */
275   public java.lang.String getNameSpacePrefix()
276   {
277     return _nsPrefix;
278   }
279
280   /**
281    * Method getNameSpaceURI.
282    * 
283    * @return the namespace URI used when marshaling and unmarshaling as XML.
284    */
285   public java.lang.String getNameSpaceURI()
286   {
287     return _nsURI;
288   }
289
290   /**
291    * Method getValidator.
292    * 
293    * @return a specific validator for the class described by this
294    *         ClassDescriptor.
295    */
296   public org.exolab.castor.xml.TypeValidator getValidator()
297   {
298     return this;
299   }
300
301   /**
302    * Method getXMLName.
303    * 
304    * @return the XML Name for the Class being described.
305    */
306   public java.lang.String getXMLName()
307   {
308     return _xmlName;
309   }
310
311   /**
312    * Method isElementDefinition.
313    * 
314    * @return true if XML schema definition of this Class is that of a global
315    *         element or element with anonymous type definition.
316    */
317   public boolean isElementDefinition()
318   {
319     return _elementDefinition;
320   }
321
322 }