private GenericField[] fields(GenericClass personClass, GenericReflector reflector) { return new GenericField[] { new GenericField("surname", reflector.forClass(String.class), false), new GenericField("birthdate", reflector.forClass(Date.class), false), new GenericField("bestFriend", personClass, false), new GenericField("nArray", reflector.forClass(int[][].class), true) }; }
/** * todo: Move the GenericClass creation into a utility/factory class. * * @return */ public GenericClass initGenericClass() { GenericReflector reflector = new GenericReflector(null, Platform4.reflectorForType(GenericObjectsTest.class)); GenericClass _objectIClass = (GenericClass) reflector.forClass(Object.class); GenericClass result = new GenericClass(reflector, null, PERSON_CLASSNAME, _objectIClass); result.initFields(fields(result, reflector)); return result; }