Example #1
0
 private void generateGet(final Class target, final Method[] getters) {
     CodeEmitter e = begin_method(Constants.ACC_PUBLIC, GET_PROPERTY_VALUES, null);
     if (getters.length >= 0) {
         e.load_arg(0);
         e.checkcast(Type.getType(target));
         Local bean = e.make_local();
         e.store_local(bean);
         for (int i = 0; i < getters.length; i++) {
             if (getters[i] != null) {
                 MethodInfo getter = ReflectUtils.getMethodInfo(getters[i]);
                 e.load_arg(1);
                 e.push(i);
                 e.load_local(bean);
                 e.invoke(getter);
                 e.box(getter.getSignature().getReturnType());
                 e.aastore();
             }
         }
     }
     e.return_value();
     e.end_method();
 }