public void examine(Object object) { if (!translationProvider.willTranslate(object)) { return; } if (getCacheState(object) != CacheProviderState.UNKNOWN) { return; } if (object instanceof Collection) { examineCollection((Collection) object); } else { examineObject(object); } }
private void examineObject(Object object) { try { Object cacheKey = getCacheKey(object); if (translationProvider.willTranslate(object)) { pendingValues.put(cacheKey, object); } BeanInfo info = Introspector.getBeanInfo(object.getClass()); for (PropertyDescriptor pd : info.getPropertyDescriptors()) { String propName = pd.getName(); if (!"handler".equals(propName) && !"class".equals(propName) && pd.getReadMethod() != null) { Object val = pd.getReadMethod().invoke(object, null); if (val != null) { examine(val); } } } } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }