-/*******************************************************************************\r
- * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
- * Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.databoard.binding.reflection;\r
-\r
-import org.simantics.databoard.binding.Binding;\r
-import org.simantics.databoard.binding.FloatBinding;\r
-import org.simantics.databoard.binding.LongBinding;\r
-import org.simantics.databoard.binding.error.BindingConstructionException;\r
-import org.simantics.databoard.binding.error.BindingException;\r
-import org.simantics.databoard.type.NumberType;\r
-import org.simantics.databoard.type.RecordType;\r
-\r
-public class MyBinding extends ClassBinding {\r
- \r
- public MyBinding(RecordType type) throws BindingConstructionException {\r
- super( ClassInfo.getInfo(MyClass.class) );\r
- this.type = type;\r
- }\r
-\r
-// @Override\r
- public Object getComponent(Object obj, int index) throws BindingException {\r
- MyClass x = (MyClass) obj;\r
- switch ( index ) {\r
- case 0: return x.field0;\r
- case 1: return x.field1;\r
- case 2: return x.field2;\r
- case 3: return x.field3;\r
- case 4: return x.field4;\r
- case 5: return x.field5;\r
- case 6: return x.field6;\r
- case 7: return x.field7;\r
- case 8: return x.field8;\r
- case 9: return x.field9;\r
- case 10: return x.field10;\r
- case 11: return x.field11;\r
- case 12: return x.field12;\r
- case 13: return x.field13;\r
- case 14: return x.field14;\r
- case 15: return x.field15;\r
- case 16: return x.field16;\r
- default: throw new BindingException("Illegal field index");\r
- }\r
- }\r
-\r
- public Object getComponent2(Object obj, int index) throws BindingException {\r
- MyClass x = (MyClass) obj;\r
- switch ( index ) {\r
- case 0: return x.getField0();\r
- case 1: return x.getField1();\r
- case 2: return x.getField2();\r
- case 3: return x.getField3();\r
- case 4: return x.getField4();\r
- case 5: return x.getField5();\r
- case 6: return x.getField6();\r
- case 7: return x.getField7();\r
- case 8: return x.getField8();\r
- case 9: return x.getField9();\r
- case 10: return x.getField10();\r
- case 11: return x.getField11();\r
- case 12: return x.getField12();\r
- case 13: return x.getField13();\r
- case 14: return x.getField14();\r
- case 15: return x.getField15();\r
- case 16: return x.getField16();\r
- default: throw new BindingException("Illegal field index");\r
- }\r
- }\r
- \r
-// @Override\r
- public Object create(Object... values) throws BindingException {\r
-// return new MyClass(\r
-// (Byte) values[0],\r
-// (Integer) values[1],\r
-// (Short) values[2],\r
-// (Long) values[3],\r
-// (Float) values[4],\r
-// (Boolean) values[5],\r
-// (Double) values[6],\r
-// (NumberType) values[7],\r
-// (byte[]) values[8],\r
-// (int[]) values[9],\r
-// (short[]) values[10],\r
-// (long[]) values[11],\r
-// (float[]) values[12],\r
-// (boolean[]) values[13],\r
-// (double[]) values[14],\r
-// values[15],\r
-// (Integer) values[16]\r
-// );\r
- return null;\r
- }\r
- \r
- public Object create2(Object... values) throws BindingException {\r
- MyClass x = new MyClass(this);\r
- setComponents(x, values);\r
- return x;\r
- } \r
- \r
-// @Override\r
- public Object createPartial() throws BindingException {\r
- return new MyClass(this);\r
- }\r
-\r
- public Object createPartial2() throws BindingException {\r
- Object values[] = new Object[15];\r
- for (int i=0; i<values.length; i++) {\r
- Binding fb = componentBindings[i];\r
- values[i] = fb.createDefault();\r
- } \r
- return create(values);\r
- }\r
- \r
-// @Override\r
- public void setComponents(Object obj, Object... value)\r
- throws BindingException {\r
- MyClass x = (MyClass) obj;\r
- // 0: Write field\r
- x.field0 = (Byte) value[0];\r
- x.field1 = (Integer) value[1];\r
- x.field2 = (Short) value[2];\r
- x.field3 = (Long) value[3];\r
- x.field4 = (Float) value[4];\r
- x.field5 = (Boolean) value[5];\r
- x.field6 = (Double) value[6];\r
- x.field7 = (NumberType) value[7];\r
- x.field8 = (byte[]) value[8];\r
- x.field9 = (int[]) value[9];\r
- x.field10 = (short[]) value[10];\r
- x.field11 = (long[]) value[11];\r
- x.field12 = (float[]) value[12];\r
- x.field13 = (boolean[]) value[13];\r
- x.field14 = (double[]) value[14];\r
- x.field15 = value[15];\r
- x.field16 = (Integer) value[16];\r
- }\r
-\r
- public void setComponents2(Object obj, Object... value)\r
- throws BindingException {\r
- MyClass x = (MyClass) obj;\r
- // Set with setters\r
- x.setField0((Byte) value[0]);\r
- x.setField1((Integer) value[1]);\r
- x.setField2((Short) value[2]);\r
- x.setField3((Long) value[3]);\r
- x.setField4((Float) value[4]);\r
- x.setField5((Boolean) value[5]);\r
- x.setField6((Double) value[6]);\r
- x.setField7((NumberType) value[7]);\r
- x.setField8((byte[]) value[8]);\r
- x.setField9((int[]) value[9]);\r
- x.setField10((short[]) value[10]);\r
- x.setField11((long[]) value[11]);\r
- x.setField12((float[]) value[12]);\r
- x.setField13((boolean[]) value[13]);\r
- x.setField14((double[]) value[14]);\r
- x.setField15(value[15]);\r
- x.setField16((Integer)value[16]);\r
- }\r
-\r
-// @Override\r
- public void setComponent(Object obj, int index, Object value)\r
- throws BindingException {\r
- MyClass x = (MyClass) obj;\r
- switch ( index ) {\r
- case 0: x.field0 = (Byte) value;\r
- case 1: x.field1 = (Integer) value;\r
- case 2: x.field2 = (Short) value;\r
- case 3: x.field3 = (Long) value;\r
- case 4: x.field4 = (Float) value;\r
- case 5: x.field5 = (Boolean) value;\r
- case 6: x.field6 = (Double) value;\r
- case 7: x.field7 = (NumberType) value;\r
- case 8: x.field8 = (byte[]) value;\r
- case 9: x.field9 = (int[]) value;\r
- case 10: x.field10 = (short[]) value;\r
- case 11: x.field11 = (long[]) value;\r
- case 12: x.field12 = (float[]) value;\r
- case 13: x.field13 = (boolean[]) value;\r
- case 14: x.field14 = (double[]) value;\r
- case 15: x.field15 = value;\r
- default: throw new BindingException("Illegal field index"); \r
- }\r
- }\r
-\r
- public void setComponent2(Object obj, int index, Object value)\r
- throws BindingException {\r
- MyClass x = (MyClass) obj;\r
- switch ( index ) {\r
- case 0: x.setField0( (Byte) value );\r
- case 1: x.setField1( (Integer) value );\r
- case 2: x.setField2( (Short) value );\r
- case 3: x.setField3( (Long) value );\r
- case 4: x.setField4( (Float) value );\r
- case 5: x.setField5( (Boolean) value );\r
- case 6: x.setField6( (Double) value );\r
- case 7: x.setField7( (NumberType) value );\r
- case 8: x.setField8( (byte[]) value );\r
- case 9: x.setField9( (int[]) value );\r
- case 10: x.setField10( (short[]) value );\r
- case 11: x.setField11( (long[]) value );\r
- case 12: x.setField12( (float[]) value );\r
- case 13: x.setField13( (boolean[]) value );\r
- case 14: x.setField14( (double[]) value );\r
- case 15: x.setField15( value );\r
- default: throw new BindingException("Illegal field index"); \r
- }\r
- }\r
-\r
-// @Override\r
- public boolean isInstance(Object obj) {\r
- return obj instanceof MyClass;\r
- }\r
- \r
-// @Override\r
- public boolean isImmutable() {\r
- return false;\r
- }\r
-\r
- public void setBoolean(Object r, int index, boolean z) throws BindingException\r
- {\r
- MyClass x = (MyClass) r;\r
- switch ( index ) {\r
- case 5: x.field5 = z; break;\r
- case 19: x.field19 = z; break;\r
- default: throw new BindingException("Field is not boolean"); \r
- }\r
- }\r
-\r
- public void setBoolean2(Object r, int index, boolean z) throws BindingException\r
- {\r
- MyClass x = (MyClass) r;\r
- switch ( index ) {\r
- case 5: x.field5 = z; break;\r
- case 19: x.field19 = z; break;\r
- default: throw new BindingException("Field is not boolean"); \r
- }\r
- }\r
-\r
- public void setBoolean3(Object r, int index, boolean z) throws BindingException\r
- {\r
- MyClass x = (MyClass) r;\r
- if ( index==5 ) x.field5 = z; \r
- else if ( index==19 ) x.field19 = z; \r
- //default: throw new BindingException("Field is not boolean"); \r
- \r
- }\r
- \r
- public boolean getBoolean(Object r, int index) throws BindingException\r
- {\r
- MyClass x = (MyClass) r;\r
- switch ( index ) {\r
- case 5: return x.field5;\r
- case 19: return x.getField5();\r
- default: throw new BindingException("Field is not boolean"); \r
- }\r
- }\r
- \r
- public void setByte(Object r, int index, byte z) throws BindingException\r
- {\r
- MyClass x = (MyClass) r;\r
- switch ( index ) {\r
- case 6: x.field6 = z; break;\r
- default: throw new BindingException("Field is not boolean"); \r
- }\r
- }\r
- \r
- public byte getByte(Object r, int index) throws BindingException\r
- {\r
- try {\r
- return ci.fields[index].getByte(r);\r
- } catch (IllegalArgumentException e) {\r
- throw new BindingException(e);\r
- } catch (IllegalAccessException e) {\r
- throw new BindingException(e);\r
- }\r
- }\r
-\r
- public void setInt(Object r, int index, int x) throws BindingException\r
- {\r
- try {\r
- ci.fields[index].setInt(r, x);\r
- } catch (IllegalArgumentException e) {\r
- throw new BindingException(e);\r
- } catch (IllegalAccessException e) {\r
- throw new BindingException(e);\r
- }\r
- }\r
- \r
- public int getInt(Object r, int index) throws BindingException\r
- {\r
- try {\r
- return ci.fields[index].getInt(r);\r
- } catch (IllegalArgumentException e) {\r
- throw new BindingException(e);\r
- } catch (IllegalAccessException e) {\r
- throw new BindingException(e);\r
- }\r
- }\r
- \r
- public void setLong(Object r, int index, long z) throws BindingException\r
- {\r
- MyClass x = (MyClass) r;\r
- switch ( index ) {\r
- case 6: x.field3 = z; break;\r
- case 8: x.setField3(z); break;\r
- default: setComponent(r, index, ((LongBinding)componentBindings[index]).create(z)); \r
- }\r
- }\r
- \r
- public long getLong(Object r, int index) throws BindingException\r
- {\r
- MyClass x = (MyClass) r;\r
- switch ( index ) {\r
- case 3: return x.field3;\r
- case 4: return x.field3;\r
- default: return ((LongBinding)componentBindings[index]).getValue_( getComponent(r, index) );\r
- }\r
- }\r
- \r
- public void setFloat(Object r, int index, float z) throws BindingException\r
- {\r
- MyClass x = (MyClass) r;\r
- switch ( index ) {\r
-// case 6: x.field4 = z; break;\r
- //case 8: x.; break;\r
- default: setComponent(r, index, ((FloatBinding)componentBindings[index]).create(z)); \r
- }\r
- }\r
- \r
- public float getFloat(Object r, int index) throws BindingException\r
- {\r
- try {\r
- return ci.fields[index].getFloat(r);\r
- } catch (IllegalArgumentException e) {\r
- throw new BindingException(e);\r
- } catch (IllegalAccessException e) {\r
- throw new BindingException(e);\r
- }\r
- }\r
- \r
- public void setDouble(Object r, int index, double z) throws BindingException\r
- {\r
- MyClass x = (MyClass) r;\r
- switch ( index ) {\r
- case 6: x.field6 = z; break;\r
- //case 8: x.; break;\r
- default: throw new BindingException("Field is not boolean"); \r
- }\r
- }\r
- \r
- public double getDouble(Object r, int index) throws BindingException\r
- {\r
- MyClass x = (MyClass) r;\r
- switch ( index ) {\r
-// case 3: return x.field6;\r
- case 4: return x.getField6_();\r
- case 5: return x.field16;\r
- default: throw new BindingException("Field is not boolean"); \r
- }\r
- }\r
- \r
- \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in
+ * Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.databoard.binding.reflection;
+
+import org.simantics.databoard.binding.Binding;
+import org.simantics.databoard.binding.FloatBinding;
+import org.simantics.databoard.binding.LongBinding;
+import org.simantics.databoard.binding.error.BindingConstructionException;
+import org.simantics.databoard.binding.error.BindingException;
+import org.simantics.databoard.type.NumberType;
+import org.simantics.databoard.type.RecordType;
+
+public class MyBinding extends ClassBinding {
+
+ public MyBinding(RecordType type) throws BindingConstructionException {
+ super( ClassInfo.getInfo(MyClass.class) );
+ this.type = type;
+ }
+
+// @Override
+ public Object getComponent(Object obj, int index) throws BindingException {
+ MyClass x = (MyClass) obj;
+ switch ( index ) {
+ case 0: return x.field0;
+ case 1: return x.field1;
+ case 2: return x.field2;
+ case 3: return x.field3;
+ case 4: return x.field4;
+ case 5: return x.field5;
+ case 6: return x.field6;
+ case 7: return x.field7;
+ case 8: return x.field8;
+ case 9: return x.field9;
+ case 10: return x.field10;
+ case 11: return x.field11;
+ case 12: return x.field12;
+ case 13: return x.field13;
+ case 14: return x.field14;
+ case 15: return x.field15;
+ case 16: return x.field16;
+ default: throw new BindingException("Illegal field index");
+ }
+ }
+
+ public Object getComponent2(Object obj, int index) throws BindingException {
+ MyClass x = (MyClass) obj;
+ switch ( index ) {
+ case 0: return x.getField0();
+ case 1: return x.getField1();
+ case 2: return x.getField2();
+ case 3: return x.getField3();
+ case 4: return x.getField4();
+ case 5: return x.getField5();
+ case 6: return x.getField6();
+ case 7: return x.getField7();
+ case 8: return x.getField8();
+ case 9: return x.getField9();
+ case 10: return x.getField10();
+ case 11: return x.getField11();
+ case 12: return x.getField12();
+ case 13: return x.getField13();
+ case 14: return x.getField14();
+ case 15: return x.getField15();
+ case 16: return x.getField16();
+ default: throw new BindingException("Illegal field index");
+ }
+ }
+
+// @Override
+ public Object create(Object... values) throws BindingException {
+// return new MyClass(
+// (Byte) values[0],
+// (Integer) values[1],
+// (Short) values[2],
+// (Long) values[3],
+// (Float) values[4],
+// (Boolean) values[5],
+// (Double) values[6],
+// (NumberType) values[7],
+// (byte[]) values[8],
+// (int[]) values[9],
+// (short[]) values[10],
+// (long[]) values[11],
+// (float[]) values[12],
+// (boolean[]) values[13],
+// (double[]) values[14],
+// values[15],
+// (Integer) values[16]
+// );
+ return null;
+ }
+
+ public Object create2(Object... values) throws BindingException {
+ MyClass x = new MyClass(this);
+ setComponents(x, values);
+ return x;
+ }
+
+// @Override
+ public Object createPartial() throws BindingException {
+ return new MyClass(this);
+ }
+
+ public Object createPartial2() throws BindingException {
+ Object values[] = new Object[15];
+ for (int i=0; i<values.length; i++) {
+ Binding fb = componentBindings[i];
+ values[i] = fb.createDefault();
+ }
+ return create(values);
+ }
+
+// @Override
+ public void setComponents(Object obj, Object... value)
+ throws BindingException {
+ MyClass x = (MyClass) obj;
+ // 0: Write field
+ x.field0 = (Byte) value[0];
+ x.field1 = (Integer) value[1];
+ x.field2 = (Short) value[2];
+ x.field3 = (Long) value[3];
+ x.field4 = (Float) value[4];
+ x.field5 = (Boolean) value[5];
+ x.field6 = (Double) value[6];
+ x.field7 = (NumberType) value[7];
+ x.field8 = (byte[]) value[8];
+ x.field9 = (int[]) value[9];
+ x.field10 = (short[]) value[10];
+ x.field11 = (long[]) value[11];
+ x.field12 = (float[]) value[12];
+ x.field13 = (boolean[]) value[13];
+ x.field14 = (double[]) value[14];
+ x.field15 = value[15];
+ x.field16 = (Integer) value[16];
+ }
+
+ public void setComponents2(Object obj, Object... value)
+ throws BindingException {
+ MyClass x = (MyClass) obj;
+ // Set with setters
+ x.setField0((Byte) value[0]);
+ x.setField1((Integer) value[1]);
+ x.setField2((Short) value[2]);
+ x.setField3((Long) value[3]);
+ x.setField4((Float) value[4]);
+ x.setField5((Boolean) value[5]);
+ x.setField6((Double) value[6]);
+ x.setField7((NumberType) value[7]);
+ x.setField8((byte[]) value[8]);
+ x.setField9((int[]) value[9]);
+ x.setField10((short[]) value[10]);
+ x.setField11((long[]) value[11]);
+ x.setField12((float[]) value[12]);
+ x.setField13((boolean[]) value[13]);
+ x.setField14((double[]) value[14]);
+ x.setField15(value[15]);
+ x.setField16((Integer)value[16]);
+ }
+
+// @Override
+ public void setComponent(Object obj, int index, Object value)
+ throws BindingException {
+ MyClass x = (MyClass) obj;
+ switch ( index ) {
+ case 0: x.field0 = (Byte) value;
+ case 1: x.field1 = (Integer) value;
+ case 2: x.field2 = (Short) value;
+ case 3: x.field3 = (Long) value;
+ case 4: x.field4 = (Float) value;
+ case 5: x.field5 = (Boolean) value;
+ case 6: x.field6 = (Double) value;
+ case 7: x.field7 = (NumberType) value;
+ case 8: x.field8 = (byte[]) value;
+ case 9: x.field9 = (int[]) value;
+ case 10: x.field10 = (short[]) value;
+ case 11: x.field11 = (long[]) value;
+ case 12: x.field12 = (float[]) value;
+ case 13: x.field13 = (boolean[]) value;
+ case 14: x.field14 = (double[]) value;
+ case 15: x.field15 = value;
+ default: throw new BindingException("Illegal field index");
+ }
+ }
+
+ public void setComponent2(Object obj, int index, Object value)
+ throws BindingException {
+ MyClass x = (MyClass) obj;
+ switch ( index ) {
+ case 0: x.setField0( (Byte) value );
+ case 1: x.setField1( (Integer) value );
+ case 2: x.setField2( (Short) value );
+ case 3: x.setField3( (Long) value );
+ case 4: x.setField4( (Float) value );
+ case 5: x.setField5( (Boolean) value );
+ case 6: x.setField6( (Double) value );
+ case 7: x.setField7( (NumberType) value );
+ case 8: x.setField8( (byte[]) value );
+ case 9: x.setField9( (int[]) value );
+ case 10: x.setField10( (short[]) value );
+ case 11: x.setField11( (long[]) value );
+ case 12: x.setField12( (float[]) value );
+ case 13: x.setField13( (boolean[]) value );
+ case 14: x.setField14( (double[]) value );
+ case 15: x.setField15( value );
+ default: throw new BindingException("Illegal field index");
+ }
+ }
+
+// @Override
+ public boolean isInstance(Object obj) {
+ return obj instanceof MyClass;
+ }
+
+// @Override
+ public boolean isImmutable() {
+ return false;
+ }
+
+ public void setBoolean(Object r, int index, boolean z) throws BindingException
+ {
+ MyClass x = (MyClass) r;
+ switch ( index ) {
+ case 5: x.field5 = z; break;
+ case 19: x.field19 = z; break;
+ default: throw new BindingException("Field is not boolean");
+ }
+ }
+
+ public void setBoolean2(Object r, int index, boolean z) throws BindingException
+ {
+ MyClass x = (MyClass) r;
+ switch ( index ) {
+ case 5: x.field5 = z; break;
+ case 19: x.field19 = z; break;
+ default: throw new BindingException("Field is not boolean");
+ }
+ }
+
+ public void setBoolean3(Object r, int index, boolean z) throws BindingException
+ {
+ MyClass x = (MyClass) r;
+ if ( index==5 ) x.field5 = z;
+ else if ( index==19 ) x.field19 = z;
+ //default: throw new BindingException("Field is not boolean");
+
+ }
+
+ public boolean getBoolean(Object r, int index) throws BindingException
+ {
+ MyClass x = (MyClass) r;
+ switch ( index ) {
+ case 5: return x.field5;
+ case 19: return x.getField5();
+ default: throw new BindingException("Field is not boolean");
+ }
+ }
+
+ public void setByte(Object r, int index, byte z) throws BindingException
+ {
+ MyClass x = (MyClass) r;
+ switch ( index ) {
+ case 6: x.field6 = z; break;
+ default: throw new BindingException("Field is not boolean");
+ }
+ }
+
+ public byte getByte(Object r, int index) throws BindingException
+ {
+ try {
+ return ci.fields[index].getByte(r);
+ } catch (IllegalArgumentException e) {
+ throw new BindingException(e);
+ } catch (IllegalAccessException e) {
+ throw new BindingException(e);
+ }
+ }
+
+ public void setInt(Object r, int index, int x) throws BindingException
+ {
+ try {
+ ci.fields[index].setInt(r, x);
+ } catch (IllegalArgumentException e) {
+ throw new BindingException(e);
+ } catch (IllegalAccessException e) {
+ throw new BindingException(e);
+ }
+ }
+
+ public int getInt(Object r, int index) throws BindingException
+ {
+ try {
+ return ci.fields[index].getInt(r);
+ } catch (IllegalArgumentException e) {
+ throw new BindingException(e);
+ } catch (IllegalAccessException e) {
+ throw new BindingException(e);
+ }
+ }
+
+ public void setLong(Object r, int index, long z) throws BindingException
+ {
+ MyClass x = (MyClass) r;
+ switch ( index ) {
+ case 6: x.field3 = z; break;
+ case 8: x.setField3(z); break;
+ default: setComponent(r, index, ((LongBinding)componentBindings[index]).create(z));
+ }
+ }
+
+ public long getLong(Object r, int index) throws BindingException
+ {
+ MyClass x = (MyClass) r;
+ switch ( index ) {
+ case 3: return x.field3;
+ case 4: return x.field3;
+ default: return ((LongBinding)componentBindings[index]).getValue_( getComponent(r, index) );
+ }
+ }
+
+ public void setFloat(Object r, int index, float z) throws BindingException
+ {
+ MyClass x = (MyClass) r;
+ switch ( index ) {
+// case 6: x.field4 = z; break;
+ //case 8: x.; break;
+ default: setComponent(r, index, ((FloatBinding)componentBindings[index]).create(z));
+ }
+ }
+
+ public float getFloat(Object r, int index) throws BindingException
+ {
+ try {
+ return ci.fields[index].getFloat(r);
+ } catch (IllegalArgumentException e) {
+ throw new BindingException(e);
+ } catch (IllegalAccessException e) {
+ throw new BindingException(e);
+ }
+ }
+
+ public void setDouble(Object r, int index, double z) throws BindingException
+ {
+ MyClass x = (MyClass) r;
+ switch ( index ) {
+ case 6: x.field6 = z; break;
+ //case 8: x.; break;
+ default: throw new BindingException("Field is not boolean");
+ }
+ }
+
+ public double getDouble(Object r, int index) throws BindingException
+ {
+ MyClass x = (MyClass) r;
+ switch ( index ) {
+// case 3: return x.field6;
+ case 4: return x.getField6_();
+ case 5: return x.field16;
+ default: throw new BindingException("Field is not boolean");
+ }
+ }
+
+
+}