- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- Alcodon target = (Alcodon) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deletePos1();
- return;
- }
- target.setPos1(((java.lang.Long) value).longValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
+ public AlcodonDescriptor() {
+ super();
+ _nsURI = "www.vamsas.ac.uk/jalview/version2";
+ _xmlName = "alcodon";
+ _elementDefinition = true;
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ //-- initialize attribute descriptors
+
+ //-- _pos1
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_pos1", "pos1", org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ Alcodon target = (Alcodon) object;
+ if (!target.hasPos1()) { return null; }
+ return new java.lang.Long(target.getPos1());
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ Alcodon target = (Alcodon) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deletePos1();
+ return;
+ }
+ target.setPos1( ((java.lang.Long) value).longValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _pos1
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { //-- local scope
+ org.exolab.castor.xml.validators.LongValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.LongValidator();
+ fieldValidator.setValidator(typeValidator);