JAL-3181 refactor: extracted buildLinkMenu() for testability
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / GroupDescriptor.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.Group;
15
16 /**
17  * Class GroupDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class GroupDescriptor extends
22         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 GroupDescriptor()
54   {
55     super();
56     _nsURI = "www.jalview.org";
57     _xmlName = "group";
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
63
64     // -- _name
65     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
66             java.lang.String.class, "_name", "name",
67             org.exolab.castor.xml.NodeType.Attribute);
68     desc.setImmutable(true);
69     handler = new org.exolab.castor.xml.XMLFieldHandler()
70     {
71       public java.lang.Object getValue(java.lang.Object object)
72               throws IllegalStateException
73       {
74         Group target = (Group) object;
75         return target.getName();
76       }
77
78       public void setValue(java.lang.Object object, java.lang.Object value)
79               throws IllegalStateException, IllegalArgumentException
80       {
81         try
82         {
83           Group target = (Group) object;
84           target.setName((java.lang.String) value);
85         } catch (java.lang.Exception ex)
86         {
87           throw new IllegalStateException(ex.toString());
88         }
89       }
90
91       public java.lang.Object newInstance(java.lang.Object parent)
92       {
93         return null;
94       }
95     };
96     desc.setHandler(handler);
97     desc.setRequired(true);
98     desc.setMultivalued(false);
99     addFieldDescriptor(desc);
100
101     // -- validation code for: _name
102     fieldValidator = new org.exolab.castor.xml.FieldValidator();
103     fieldValidator.setMinOccurs(1);
104     { // -- local scope
105       org.exolab.castor.xml.validators.StringValidator typeValidator;
106       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
107       fieldValidator.setValidator(typeValidator);
108       typeValidator.setWhiteSpace("preserve");
109     }
110     desc.setValidator(fieldValidator);
111     // -- _display
112     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
113             java.lang.Boolean.TYPE, "_display", "display",
114             org.exolab.castor.xml.NodeType.Attribute);
115     handler = new org.exolab.castor.xml.XMLFieldHandler()
116     {
117       public java.lang.Object getValue(java.lang.Object object)
118               throws IllegalStateException
119       {
120         Group target = (Group) object;
121         if (!target.hasDisplay())
122         {
123           return null;
124         }
125         return (target.getDisplay() ? java.lang.Boolean.TRUE
126                 : java.lang.Boolean.FALSE);
127       }
128
129       public void setValue(java.lang.Object object, java.lang.Object value)
130               throws IllegalStateException, IllegalArgumentException
131       {
132         try
133         {
134           Group target = (Group) object;
135           // ignore null values for non optional primitives
136           if (value == null)
137           {
138             return;
139           }
140
141           target.setDisplay(((java.lang.Boolean) value).booleanValue());
142         } catch (java.lang.Exception ex)
143         {
144           throw new IllegalStateException(ex.toString());
145         }
146       }
147
148       public java.lang.Object newInstance(java.lang.Object parent)
149       {
150         return null;
151       }
152     };
153     desc.setHandler(handler);
154     desc.setRequired(true);
155     desc.setMultivalued(false);
156     addFieldDescriptor(desc);
157
158     // -- validation code for: _display
159     fieldValidator = new org.exolab.castor.xml.FieldValidator();
160     fieldValidator.setMinOccurs(1);
161     { // -- local scope
162       org.exolab.castor.xml.validators.BooleanValidator typeValidator;
163       typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
164       fieldValidator.setValidator(typeValidator);
165     }
166     desc.setValidator(fieldValidator);
167     // -- initialize element descriptors
168
169   }
170
171   // -----------/
172   // - Methods -/
173   // -----------/
174
175   /**
176    * Method getAccessMode.
177    * 
178    * @return the access mode specified for this class.
179    */
180   public org.exolab.castor.mapping.AccessMode getAccessMode()
181   {
182     return null;
183   }
184
185   /**
186    * Method getIdentity.
187    * 
188    * @return the identity field, null if this class has no identity.
189    */
190   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
191   {
192     return super.getIdentity();
193   }
194
195   /**
196    * Method getJavaClass.
197    * 
198    * @return the Java class represented by this descriptor.
199    */
200   public java.lang.Class getJavaClass()
201   {
202     return jalview.schemabinding.version2.Group.class;
203   }
204
205   /**
206    * Method getNameSpacePrefix.
207    * 
208    * @return the namespace prefix to use when marshaling as XML.
209    */
210   public java.lang.String getNameSpacePrefix()
211   {
212     return _nsPrefix;
213   }
214
215   /**
216    * Method getNameSpaceURI.
217    * 
218    * @return the namespace URI used when marshaling and unmarshaling as XML.
219    */
220   public java.lang.String getNameSpaceURI()
221   {
222     return _nsURI;
223   }
224
225   /**
226    * Method getValidator.
227    * 
228    * @return a specific validator for the class described by this
229    *         ClassDescriptor.
230    */
231   public org.exolab.castor.xml.TypeValidator getValidator()
232   {
233     return this;
234   }
235
236   /**
237    * Method getXMLName.
238    * 
239    * @return the XML Name for the Class being described.
240    */
241   public java.lang.String getXMLName()
242   {
243     return _xmlName;
244   }
245
246   /**
247    * Method isElementDefinition.
248    * 
249    * @return true if XML schema definition of this Class is that of a global
250    *         element or element with anonymous type definition.
251    */
252   public boolean isElementDefinition()
253   {
254     return _elementDefinition;
255   }
256
257 }