public void processCase(Object key, Label end) { Type type = (Type)fields.get(key); e.getfield((String)key); e.box(type); e.return_value(); } public void processDefault() {
public void processCase(int key, Label end) throws Exception { Type type = (Type)fields.get(names[key]); e.getfield(names[key]); e.box(type); e.return_value(); } public void processDefault() throws Exception {
public void processCase(Object key, Label end) { Type type = (Type)fields.get(key); e.getfield((String)key); e.box(type); e.return_value(); } public void processDefault() {
public void processCase(int key, Label end) throws Exception { Type type = (Type)fields.get(names[key]); e.getfield(names[key]); e.box(type); e.return_value(); } public void processDefault() throws Exception {
public void processCase(Object key, Label end) { PropertyDescriptor pd = (PropertyDescriptor)getters.get(key); MethodInfo method = ReflectUtils.getMethodInfo(pd.getReadMethod()); e.invoke(method); e.box(method.getSignature().getReturnType()); e.return_value(); } public void processDefault() {
public void processCase(Object key, Label end) { PropertyDescriptor pd = (PropertyDescriptor)getters.get(key); MethodInfo method = ReflectUtils.getMethodInfo(pd.getReadMethod()); e.invoke(method); e.box(method.getSignature().getReturnType()); e.return_value(); } public void processDefault() {
public void processCase(Object key, Label end) { PropertyDescriptor pd = (PropertyDescriptor)setters.get(key); if (pd.getReadMethod() == null) { e.aconst_null(); } else { MethodInfo read = ReflectUtils.getMethodInfo(pd.getReadMethod()); e.dup(); e.invoke(read); e.box(read.getSignature().getReturnType()); } e.swap(); // move old value behind bean e.load_arg(2); // new value MethodInfo write = ReflectUtils.getMethodInfo(pd.getWriteMethod()); e.unbox(write.getSignature().getArgumentTypes()[0]); e.invoke(write); e.return_value(); } public void processDefault() {
public void processCase(Object key, Label end) { PropertyDescriptor pd = (PropertyDescriptor)setters.get(key); if (pd.getReadMethod() == null) { e.aconst_null(); } else { MethodInfo read = ReflectUtils.getMethodInfo(pd.getReadMethod()); e.dup(); e.invoke(read); e.box(read.getSignature().getReturnType()); } e.swap(); // move old value behind bean e.load_arg(2); // new value MethodInfo write = ReflectUtils.getMethodInfo(pd.getWriteMethod()); e.unbox(write.getSignature().getArgumentTypes()[0]); e.invoke(write); e.return_value(); } public void processDefault() {
/** * Allocates and fills an Object[] array with the arguments to the * current method. Primitive values are inserted as their boxed * (Object) equivalents. */ public void create_arg_array() { /* generates: Object[] args = new Object[]{ arg1, new Integer(arg2) }; */ push(state.argumentTypes.length); newarray(); for (int i = 0; i < state.argumentTypes.length; i++) { dup(); push(i); load_arg(i); box(state.argumentTypes[i]); aastore(); } }
/** * Allocates and fills an Object[] array with the arguments to the * current method. Primitive values are inserted as their boxed * (Object) equivalents. */ public void create_arg_array() { /* generates: Object[] args = new Object[]{ arg1, new Integer(arg2) }; */ push(state.argumentTypes.length); newarray(); for (int i = 0; i < state.argumentTypes.length; i++) { dup(); push(i); load_arg(i); box(state.argumentTypes[i]); aastore(); } }
public void processCase(int key, Label end) { MethodInfo method = (MethodInfo)info.get(key); Type[] types = method.getSignature().getArgumentTypes(); for (int i = 0; i < types.length; i++) { e.load_arg(arg); e.aaload(i); e.unbox(types[i]); } // TODO: change method lookup process so MethodInfo will already reference base // instead of superclass when superclass method is inaccessible e.invoke(method, base); if (!TypeUtils.isConstructor(method)) { e.box(method.getSignature().getReturnType()); } e.return_value(); } public void processDefault() {
public void processCase(int key, Label end) { MethodInfo method = (MethodInfo)info.get(key); Type[] types = method.getSignature().getArgumentTypes(); for (int i = 0; i < types.length; i++) { e.load_arg(arg); e.aaload(i); e.unbox(types[i]); } // TODO: change method lookup process so MethodInfo will already reference base // instead of superclass when superclass method is inaccessible e.invoke(method, base); if (!TypeUtils.isConstructor(method)) { e.box(method.getSignature().getReturnType()); } e.return_value(); } public void processDefault() {
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(); }
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(); }
e.load_local(sourceLocal); e.invoke(read); e.box(read.getSignature().getReturnType()); EmitUtils.load_class(e, setterType); e.push(write.getSignature().getName());
e.load_local(sourceLocal); e.invoke(read); e.box(read.getSignature().getReturnType()); EmitUtils.load_class(e, setterType); e.push(write.getSignature().getName());
public void processCase(Object key, Label end) { Type type = (Type)fields.get(key); e.getfield((String)key); e.box(type); e.return_value(); } public void processDefault() {
public void processCase(int key, Label end) throws Exception { Type type = (Type)fields.get(names[key]); e.getfield(names[key]); e.box(type); e.return_value(); } public void processDefault() throws Exception {
public void processCase(Object key, Label end) { PropertyDescriptor pd = (PropertyDescriptor)getters.get(key); MethodInfo method = ReflectUtils.getMethodInfo(pd.getReadMethod()); e.invoke(method); e.box(method.getSignature().getReturnType()); e.return_value(); } public void processDefault() {
public void processCase(Object key, Label end) { PropertyDescriptor pd = (PropertyDescriptor)getters.get(key); MethodInfo method = ReflectUtils.getMethodInfo(pd.getReadMethod()); e.invoke(method); e.box(method.getSignature().getReturnType()); e.return_value(); } public void processDefault() {