+ //-- _score\r
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_score", "score", org.exolab.castor.xml.NodeType.Attribute);\r
+ handler = (new org.exolab.castor.xml.XMLFieldHandler() {\r
+ public java.lang.Object getValue( java.lang.Object object ) \r
+ throws IllegalStateException\r
+ {\r
+ Feature target = (Feature) object;\r
+ if(!target.hasScore())\r
+ return null;\r
+ return new java.lang.Float(target.getScore());\r
+ }\r
+ public void setValue( java.lang.Object object, java.lang.Object value) \r
+ throws IllegalStateException, IllegalArgumentException\r
+ {\r
+ try {\r
+ Feature target = (Feature) object;\r
+ // if null, use delete method for optional primitives \r
+ if (value == null) {\r
+ target.deleteScore();\r
+ return;\r
+ }\r
+ target.setScore( ((java.lang.Float)value).floatValue());\r
+ }\r
+ catch (java.lang.Exception ex) {\r
+ throw new IllegalStateException(ex.toString());\r
+ }\r
+ }\r
+ public java.lang.Object newInstance( java.lang.Object parent ) {\r
+ return null;\r
+ }\r
+ } );\r
+ desc.setHandler(handler);\r
+ addFieldDescriptor(desc);\r
+ \r
+ //-- validation code for: _score\r
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();\r
+ { //-- local scope\r
+ FloatValidator typeValidator = new FloatValidator();\r
+ fieldValidator.setValidator(typeValidator);\r
+ }\r
+ desc.setValidator(fieldValidator);\r