public Object cloneWithRespect(Object bean, Class respectful) { Class beanclz = bean.getClass(); MethodAnalyser targetma = mappingcontext.getAnalyser(beanclz); MethodAnalyser respectma = mappingcontext.getAnalyser(respectful); Object togo = reflectivecache.construct(beanclz); for (int i = 0; i < targetma.allgetters.length; ++i) { AccessMethod pot = targetma.allgetters[i]; if (!pot.canGet() || !pot.canSet()) continue; String propname = pot.getPropertyName(); if (respectma.getAccessMethod(propname) != null) { Object getit = pot.getChildObject(bean); pot.setChildObject(togo, getit); } } return togo; } }