private void writeStructValue(TypeDescription type, Object value) { IFieldDescription[] fields = type.getFieldDescriptions(); for (int i = 0; i < fields.length; ++i) { try { writeValue( (TypeDescription) fields[i].getTypeDescription(), value == null ? null : fields[i].getField().get(value)); } catch (IllegalAccessException e) { throw new RuntimeException(e.toString()); } } }
public IFieldDescription getFieldDescription(String name) { for (int i = 0; i < fieldDescriptions.length; ++i) { if (fieldDescriptions[i].getName().equals(name)) { return fieldDescriptions[i]; } } return superTypes != null && superTypes.length == 1 ? superTypes[0].getFieldDescription(name) : null; }
private void readFields(TypeDescription type, Object value) { IFieldDescription[] fields = type.getFieldDescriptions(); for (int i = 0; i < fields.length; ++i) { try { fields[i].getField().set( value, readValue( (TypeDescription) fields[i].getTypeDescription())); } catch (IllegalAccessException e) { throw new RuntimeException(e.toString()); } } }
Type ft = new Type(fs[i].getTypeDescription()); try { completeValue(ft, fs[i].getField().get(v1)), completeValue(ft, fs[i].getField().get(v2))))