*
* @throws ConversionException
* if the given field is not of primitive type
*/
public static void setJPFPrimitiveField (ElementInfo ei, int index, Field fld, Object JVMObj) throws IllegalAccessException, ConversionException{
Fields fields = ei.getFields();
if (fld.getType().getName().equals("boolean")){
fields.setBooleanValue(index, fld.getBoolean(JVMObj));
} else if (fld.getType().getName().equals("byte")){
fields.setByteValue(index, fld.getByte(JVMObj));
} else if (fld.getType().getName().equals("int")){
fields.setIntValue(index, fld.getInt(JVMObj));
} else if (fld.getType().getName().equals("short")){
fields.setShortValue(index, fld.getShort(JVMObj));
} else if (fld.getType().getName().equals("long")){
fields.setLongValue(index, fld.getLong(JVMObj));
} else if (fld.getType().getName().equals("char")){
fields.setCharValue(index, fld.getChar(JVMObj));
} else if (fld.getType().getName().equals("float")){
fields.setFloatValue(index, fld.getFloat(JVMObj));
} else if (fld.getType().getName().equals("double")){
fields.setDoubleValue(index, fld.getDouble(JVMObj));
} else{
throw new ConversionException("Unknown premitive type " + fld.getType().getName());
}
}