916a92cdb844ed9b0123c62c40b926ea707ca6d9
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / HiddenColumnsDescriptor.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
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
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.schemabinding.version2.descriptors;
22
23 //---------------------------------/
24 //- Imported classes and packages -/
25 //---------------------------------/
26
27 import jalview.schemabinding.version2.HiddenColumns;
28
29 /**
30  * Class HiddenColumnsDescriptor.
31  * 
32  * @version $Revision$ $Date$
33  */
34 public class HiddenColumnsDescriptor extends
35         org.exolab.castor.xml.util.XMLClassDescriptorImpl
36 {
37
38   // --------------------------/
39   // - Class/Member Variables -/
40   // --------------------------/
41
42   /**
43    * Field _elementDefinition.
44    */
45   private boolean _elementDefinition;
46
47   /**
48    * Field _nsPrefix.
49    */
50   private java.lang.String _nsPrefix;
51
52   /**
53    * Field _nsURI.
54    */
55   private java.lang.String _nsURI;
56
57   /**
58    * Field _xmlName.
59    */
60   private java.lang.String _xmlName;
61
62   // ----------------/
63   // - Constructors -/
64   // ----------------/
65
66   public HiddenColumnsDescriptor()
67   {
68     super();
69     _nsURI = "www.jalview.org";
70     _xmlName = "hiddenColumns";
71     _elementDefinition = true;
72     org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
73     org.exolab.castor.mapping.FieldHandler handler = null;
74     org.exolab.castor.xml.FieldValidator fieldValidator = null;
75     // -- initialize attribute descriptors
76
77     // -- _start
78     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
79             java.lang.Integer.TYPE, "_start", "start",
80             org.exolab.castor.xml.NodeType.Attribute);
81     handler = new org.exolab.castor.xml.XMLFieldHandler()
82     {
83       public java.lang.Object getValue(java.lang.Object object)
84               throws IllegalStateException
85       {
86         HiddenColumns target = (HiddenColumns) object;
87         if (!target.hasStart())
88         {
89           return null;
90         }
91         return new java.lang.Integer(target.getStart());
92       }
93
94       public void setValue(java.lang.Object object, java.lang.Object value)
95               throws IllegalStateException, IllegalArgumentException
96       {
97         try
98         {
99           HiddenColumns target = (HiddenColumns) object;
100           // if null, use delete method for optional primitives
101           if (value == null)
102           {
103             target.deleteStart();
104             return;
105           }
106           target.setStart(((java.lang.Integer) value).intValue());
107         } catch (java.lang.Exception ex)
108         {
109           throw new IllegalStateException(ex.toString());
110         }
111       }
112
113       public java.lang.Object newInstance(java.lang.Object parent)
114       {
115         return null;
116       }
117     };
118     desc.setHandler(handler);
119     desc.setMultivalued(false);
120     addFieldDescriptor(desc);
121
122     // -- validation code for: _start
123     fieldValidator = new org.exolab.castor.xml.FieldValidator();
124     { // -- local scope
125       org.exolab.castor.xml.validators.IntValidator typeValidator;
126       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
127       fieldValidator.setValidator(typeValidator);
128       typeValidator.setMinInclusive(-2147483648);
129       typeValidator.setMaxInclusive(2147483647);
130     }
131     desc.setValidator(fieldValidator);
132     // -- _end
133     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
134             java.lang.Integer.TYPE, "_end", "end",
135             org.exolab.castor.xml.NodeType.Attribute);
136     handler = new org.exolab.castor.xml.XMLFieldHandler()
137     {
138       public java.lang.Object getValue(java.lang.Object object)
139               throws IllegalStateException
140       {
141         HiddenColumns target = (HiddenColumns) object;
142         if (!target.hasEnd())
143         {
144           return null;
145         }
146         return new java.lang.Integer(target.getEnd());
147       }
148
149       public void setValue(java.lang.Object object, java.lang.Object value)
150               throws IllegalStateException, IllegalArgumentException
151       {
152         try
153         {
154           HiddenColumns target = (HiddenColumns) object;
155           // if null, use delete method for optional primitives
156           if (value == null)
157           {
158             target.deleteEnd();
159             return;
160           }
161           target.setEnd(((java.lang.Integer) value).intValue());
162         } catch (java.lang.Exception ex)
163         {
164           throw new IllegalStateException(ex.toString());
165         }
166       }
167
168       public java.lang.Object newInstance(java.lang.Object parent)
169       {
170         return null;
171       }
172     };
173     desc.setHandler(handler);
174     desc.setMultivalued(false);
175     addFieldDescriptor(desc);
176
177     // -- validation code for: _end
178     fieldValidator = new org.exolab.castor.xml.FieldValidator();
179     { // -- local scope
180       org.exolab.castor.xml.validators.IntValidator typeValidator;
181       typeValidator = new org.exolab.castor.xml.validators.IntValidator();
182       fieldValidator.setValidator(typeValidator);
183       typeValidator.setMinInclusive(-2147483648);
184       typeValidator.setMaxInclusive(2147483647);
185     }
186     desc.setValidator(fieldValidator);
187     // -- initialize element descriptors
188
189   }
190
191   // -----------/
192   // - Methods -/
193   // -----------/
194
195   /**
196    * Method getAccessMode.
197    * 
198    * @return the access mode specified for this class.
199    */
200   public org.exolab.castor.mapping.AccessMode getAccessMode()
201   {
202     return null;
203   }
204
205   /**
206    * Method getIdentity.
207    * 
208    * @return the identity field, null if this class has no identity.
209    */
210   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
211   {
212     return super.getIdentity();
213   }
214
215   /**
216    * Method getJavaClass.
217    * 
218    * @return the Java class represented by this descriptor.
219    */
220   public java.lang.Class getJavaClass()
221   {
222     return jalview.schemabinding.version2.HiddenColumns.class;
223   }
224
225   /**
226    * Method getNameSpacePrefix.
227    * 
228    * @return the namespace prefix to use when marshaling as XML.
229    */
230   public java.lang.String getNameSpacePrefix()
231   {
232     return _nsPrefix;
233   }
234
235   /**
236    * Method getNameSpaceURI.
237    * 
238    * @return the namespace URI used when marshaling and unmarshaling as XML.
239    */
240   public java.lang.String getNameSpaceURI()
241   {
242     return _nsURI;
243   }
244
245   /**
246    * Method getValidator.
247    * 
248    * @return a specific validator for the class described by this
249    *         ClassDescriptor.
250    */
251   public org.exolab.castor.xml.TypeValidator getValidator()
252   {
253     return this;
254   }
255
256   /**
257    * Method getXMLName.
258    * 
259    * @return the XML Name for the Class being described.
260    */
261   public java.lang.String getXMLName()
262   {
263     return _xmlName;
264   }
265
266   /**
267    * Method isElementDefinition.
268    * 
269    * @return true if XML schema definition of this Class is that of a global
270    *         element or element with anonymous type definition.
271    */
272   public boolean isElementDefinition()
273   {
274     return _elementDefinition;
275   }
276
277 }