public final void setValue(X target, Y value) { initialize(); try { Object leafObj = getLeafObject(target, false); final Method setter = leafSetter == null && leafObj != null ? ReflectionUtils .getSetter( leafObj.getClass(), explodedPropertyPath[explodedPropertyPath.length - 1]) : leafSetter; setter.invoke(leafObj, value); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException(ex); } }
@SuppressWarnings("unchecked") private Y getValue(X target, boolean nullSafe) { initialize(); try { Object leafObj = getLeafObject(target, nullSafe); final Method getter = leafGetter == null && leafObj != null ? ReflectionUtils .getGetter( leafObj.getClass(), explodedPropertyPath[explodedPropertyPath.length - 1]) : leafGetter; return nullSafe && leafObj == null ? null : (Y) getter .invoke(leafObj); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException(ex); } }