@SuppressWarnings("unchecked") private void invokeGetBindingField(UIFormInput uiFormInput, Object bean) throws Exception { String bindingField = uiFormInput.getBindingField(); if (bindingField == null) return; Method method = ReflectionUtil.getGetBindingMethod(bean, bindingField); Object value = method.invoke(bean, ReflectionUtil.EMPTY_ARGS); if (value == null) return; uiFormInput.setValue(value); }
private void invokeSetBindingField(Object bean, UIFormInput uiFormInput) throws Exception { // Do not execute in case uiFormInput is not editable if (uiFormInput instanceof UIFormInputBase) { UIFormInputBase uiStringBase = (UIFormInputBase) uiFormInput; if (uiStringBase.isReadOnly() || uiStringBase.isDisabled()) { return; } } String bindingField = uiFormInput.getBindingField(); if (bindingField == null) return; Class[] classes = new Class[] {uiFormInput.getTypeValue()}; Method method = ReflectionUtil.getSetBindingMethod(bean, bindingField, classes); method.invoke(bean, new Object[] {uiFormInput.getValue()}); }