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.Group;
17 * Class GroupDescriptor.
19 * @version $Revision$ $Date$
21 public class GroupDescriptor 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 GroupDescriptor()
56 _nsURI = "www.jalview.org";
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, "_name", "name",
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 Group target = (Group) object;
75 return target.getName();
78 public void setValue(java.lang.Object object, java.lang.Object value)
79 throws IllegalStateException, IllegalArgumentException
83 Group target = (Group) object;
84 target.setName((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.setRequired(true);
98 desc.setMultivalued(false);
99 addFieldDescriptor(desc);
101 // -- validation code for: _name
102 fieldValidator = new org.exolab.castor.xml.FieldValidator();
103 fieldValidator.setMinOccurs(1);
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");
110 desc.setValidator(fieldValidator);
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()
117 public java.lang.Object getValue(java.lang.Object object)
118 throws IllegalStateException
120 Group target = (Group) object;
121 if (!target.hasDisplay())
125 return (target.getDisplay() ? java.lang.Boolean.TRUE
126 : java.lang.Boolean.FALSE);
129 public void setValue(java.lang.Object object, java.lang.Object value)
130 throws IllegalStateException, IllegalArgumentException
134 Group target = (Group) object;
135 // ignore null values for non optional primitives
141 target.setDisplay(((java.lang.Boolean) value).booleanValue());
142 } catch (java.lang.Exception ex)
144 throw new IllegalStateException(ex.toString());
148 public java.lang.Object newInstance(java.lang.Object parent)
153 desc.setHandler(handler);
154 desc.setRequired(true);
155 desc.setMultivalued(false);
156 addFieldDescriptor(desc);
158 // -- validation code for: _display
159 fieldValidator = new org.exolab.castor.xml.FieldValidator();
160 fieldValidator.setMinOccurs(1);
162 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
163 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
164 fieldValidator.setValidator(typeValidator);
166 desc.setValidator(fieldValidator);
167 // -- initialize element descriptors
176 * Method getAccessMode.
178 * @return the access mode specified for this class.
180 public org.exolab.castor.mapping.AccessMode getAccessMode()
186 * Method getIdentity.
188 * @return the identity field, null if this class has no identity.
190 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
192 return super.getIdentity();
196 * Method getJavaClass.
198 * @return the Java class represented by this descriptor.
200 public java.lang.Class getJavaClass()
202 return jalview.schemabinding.version2.Group.class;
206 * Method getNameSpacePrefix.
208 * @return the namespace prefix to use when marshaling as XML.
210 public java.lang.String getNameSpacePrefix()
216 * Method getNameSpaceURI.
218 * @return the namespace URI used when marshaling and unmarshaling as XML.
220 public java.lang.String getNameSpaceURI()
226 * Method getValidator.
228 * @return a specific validator for the class described by this
231 public org.exolab.castor.xml.TypeValidator getValidator()
239 * @return the XML Name for the Class being described.
241 public java.lang.String getXMLName()
247 * Method isElementDefinition.
249 * @return true if XML schema definition of this Class is that of a global
250 * element or element with anonymous type definition.
252 public boolean isElementDefinition()
254 return _elementDefinition;