/** * Copy bean properties. Called with the copy object on the stack. Must * return with the copy object on the stack. */ private void copyProperties(Class type, Code code) { int copy = code.getNextLocalsIndex(); code.astore().setLocal(copy); Method[] meths = type.getMethods(); Method getter; int mods; for (int i = 0; i < meths.length; i++) { mods = meths[i].getModifiers(); if (!Modifier.isPublic(mods) || Modifier.isStatic(mods)) continue; if (!startsWith(meths[i].getName(), "set") || meths[i].getParameterTypes().length != 1) continue; getter = findGetter(type, meths[i]); if (getter == null) continue; // copy.setXXX(orig.getXXX()); code.aload().setLocal(copy); code.aload().setParam(0); code.checkcast().setType(type); code.invokevirtual().setMethod(getter); code.invokevirtual().setMethod(meths[i]); } code.aload().setLocal(copy); }
/** * Copy bean properties. Called with the copy object on the stack. Must * return with the copy object on the stack. */ private void copyProperties(Class type, Code code) { int copy = code.getNextLocalsIndex(); code.astore().setLocal(copy); Method[] meths = type.getMethods(); Method getter; int mods; for (int i = 0; i < meths.length; i++) { mods = meths[i].getModifiers(); if (!Modifier.isPublic(mods) || Modifier.isStatic(mods)) continue; if (!startsWith(meths[i].getName(), "set") || meths[i].getParameterTypes().length != 1) continue; getter = findGetter(type, meths[i]); if (getter == null) continue; // copy.setXXX(orig.getXXX()); code.aload().setLocal(copy); code.aload().setParam(0); code.checkcast().setType(type); code.invokevirtual().setMethod(getter); code.invokevirtual().setMethod(meths[i]); } code.aload().setLocal(copy); }
/** * Copy bean properties. Called with the copy object on the stack. Must * return with the copy object on the stack. */ private void copyProperties(Class type, Code code) { int copy = code.getNextLocalsIndex(); code.astore().setLocal(copy); Method[] meths = type.getMethods(); Method getter; int mods; for (int i = 0; i < meths.length; i++) { mods = meths[i].getModifiers(); if (!Modifier.isPublic(mods) || Modifier.isStatic(mods)) continue; if (!startsWith(meths[i].getName(), "set") || meths[i].getParameterTypes().length != 1) continue; getter = findGetter(type, meths[i]); if (getter == null) continue; // copy.setXXX(orig.getXXX()); code.aload().setLocal(copy); code.aload().setParam(0); code.checkcast().setType(type); code.invokevirtual().setMethod(getter); code.invokevirtual().setMethod(meths[i]); } code.aload().setLocal(copy); }
/** * Copy bean properties. Called with the copy object on the stack. Must * return with the copy object on the stack. */ private void copyProperties(Class type, Code code) { int copy = code.getNextLocalsIndex(); code.astore().setLocal(copy); Method[] meths = type.getMethods(); Method getter; int mods; for (int i = 0; i < meths.length; i++) { mods = meths[i].getModifiers(); if (!Modifier.isPublic(mods) || Modifier.isStatic(mods)) continue; if (!startsWith(meths[i].getName(), "set") || meths[i].getParameterTypes().length != 1) continue; getter = findGetter(type, meths[i]); if (getter == null) continue; // copy.setXXX(orig.getXXX()); code.aload().setLocal(copy); code.aload().setParam(0); code.checkcast().setType(type); code.invokevirtual().setMethod(getter); code.invokevirtual().setMethod(meths[i]); } code.aload().setLocal(copy); }
/** * Copy bean properties. Called with the copy object on the stack. Must * return with the copy object on the stack. */ private void copyProperties(Class type, Code code) { int copy = code.getNextLocalsIndex(); code.astore().setLocal(copy); Method[] meths = type.getMethods(); Method getter; int mods; for (int i = 0; i < meths.length; i++) { mods = meths[i].getModifiers(); if (!Modifier.isPublic(mods) || Modifier.isStatic(mods)) continue; if (!startsWith(meths[i].getName(), "set") || meths[i].getParameterTypes().length != 1) continue; getter = findGetter(type, meths[i]); if (getter == null) continue; // copy.setXXX(orig.getXXX()); code.aload().setLocal(copy); code.aload().setParam(0); code.checkcast().setType(type); code.invokevirtual().setMethod(getter); code.invokevirtual().setMethod(meths[i]); } code.aload().setLocal(copy); }