@Test public void testGenerateJavaCode() { DataValueGenerator dvg = new DataValueGenerator(); JavaBeanInterface jbi = dvg.heapInstance(JavaBeanInterface.class); jbi.setByte((byte) 1); jbi.setChar('2'); jbi.setShort((short) 3); jbi.setInt(4); jbi.setFloat(5); jbi.setLong(6); jbi.setDouble(7); jbi.setFlag(true); assertEquals(1, jbi.getByte()); assertEquals('2', jbi.getChar()); assertEquals(3, jbi.getShort()); assertEquals(4, jbi.getInt()); assertEquals(5.0, jbi.getFloat(), 0); assertEquals(6, jbi.getLong()); assertEquals(7.0, jbi.getDouble(), 0.0); assertTrue(jbi.getFlag()); }
public <T> T heapInstance(Class<T> tClass) { try { return (T) acquireHeapClass(tClass).newInstance(); } catch (Exception e) { throw new AssertionError(e); } }
DataValueGenerator { public <T> T heapInstance(Class<T> tClass) { try { return (T) acquireHeapClass(tClass).newInstance(); } catch (Exception e) { throw new AssertionError(e); } } }
DataValueGenerator { public <T> T heapInstance(Class<T> tClass) { try { return (T) acquireHeapClass(tClass).newInstance(); } catch (Exception e) { throw new AssertionError(e); } }  }
DataValueGenerator { public <T> T heapInstance(Class<T> tClass) { try { return (T) acquireHeapClass(tClass).newInstance(); } catch (Exception e) { throw new AssertionError(e); } }  static Class firstPrimitiveFieldType(Class valueClass); static String bytesType(Class type); static String simpleName(Class<?> type); static CharSequence normalize(Class aClass); static Method getGetter(FieldModel model); static Method getVolatileGetter(FieldModel model); static Method getSetter(FieldModel model); static Method getOrderedSetter(FieldModel model); static void appendImported(SortedSet<Class> imported, StringBuilder sb); static void appendPackage(DataValueModel<?> dvmodel, StringBuilder sb); static String getPackage(DataValueModel<?> dvmodel); static int fieldSize(FieldModel model); static TreeSet<Class> newImported(); static boolean shouldImport(Class type); static Map.Entry<String, FieldModel>[] heapSizeOrderedFieldsGrouped(DataValueModel<?> dvmodel); static int computeOffset(int offset, FieldModel model); static int computeNonScalarOffset(DataValueModel dvmodel, Class type); T heapInstance(Class<T> tClass); Class acquireHeapClass(Class<T> tClass); T nativeInstance(Class<T> tClass); Class acquireNativeClass(Class<T> tClass); String generateNativeObject(Class<?> tClass); String generateNativeObject(DataValueModel<?> dvmodel); boolean isDumpCode(); void setDumpCode(boolean dumpCode); }
DataValueGenerator { public <T> T heapInstance(Class<T> tClass) { try { return (T) acquireHeapClass(tClass).newInstance(); } catch (Exception e) { throw new AssertionError(e); } }  static Class firstPrimitiveFieldType(Class valueClass); static String bytesType(Class type); static String simpleName(Class<?> type); static CharSequence normalize(Class aClass); static Method getGetter(FieldModel model); static Method getVolatileGetter(FieldModel model); static Method getSetter(FieldModel model); static Method getOrderedSetter(FieldModel model); static void appendImported(SortedSet<Class> imported, StringBuilder sb); static void appendPackage(DataValueModel<?> dvmodel, StringBuilder sb); static String getPackage(DataValueModel<?> dvmodel); static int fieldSize(FieldModel model); static TreeSet<Class> newImported(); static boolean shouldImport(Class type); static Map.Entry<String, FieldModel>[] heapSizeOrderedFieldsGrouped(DataValueModel<?> dvmodel); static int computeOffset(int offset, FieldModel model); static int computeNonScalarOffset(DataValueModel dvmodel, Class type); T heapInstance(Class<T> tClass); Class acquireHeapClass(Class<T> tClass); T nativeInstance(Class<T> tClass); Class acquireNativeClass(Class<T> tClass); String generateNativeObject(Class<?> tClass); String generateNativeObject(DataValueModel<?> dvmodel); boolean isDumpCode(); void setDumpCode(boolean dumpCode);  }