把视图组件转为可绑定 value 的组件
@param component 原始组件
@param _valueProp 原组件的值的属性名称，默认(一般)为 value, 可以根据原组件的情况设为 checked 等
6682
function makeBindable(component, _valueProp) {
    var Bind = /** @class */ (function (_super) {
        __extends(Bind, _super);
        function Bind() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.onChange = function (newValue) {
                var valueToSet;
                if (newValue.target) {
                    valueToSet = newValue.target[_valueProp || _this.props.valueProp || 'value'];
                }
                else {
                    valueToSet = newValue;
                }
                var imState = _this.props.value;
                if (imState === null || imState === undefined) {
                    throw new Error('[pastate] The binding value cannot be null or undefined. If you want to support null and undefined, you can use store + bind props.');
                }
                var store = imState.__store__;
                if (!store) {
                    throw new Error('[pastate] You can only give state node from this.props to pastate two-ways binding HOC component');
                }
                store.set(imState, valueToSet);
                store.currentActionName = '[binding]';
                store.sync();
                _this.props.afterChange && _this.props.afterChange(valueToSet);
            };
            return _this;
        }
        Bind.prototype.render = function () {
            if (Array.isArray(this.props.children)) {
                throw new Error('[pastate] you can only give only one child to Bind component');
            }
            var _a = this.props, valueProp = _a.valueProp, afterChange = _a.afterChange, parentProps = __rest(_a, ["valueProp", "afterChange"]);
            var props = Object.assign({}, parentProps, (_b = {},
                _b[_valueProp || valueProp || 'value'] = unpack(this.props.value),
                _b.onChange = this.onChange,
                _b));
            return React.createElement(component, props, this.props.children);
            var _b;
        };
        return Bind;
    }(React.PureComponent));
    return Bind;
}
988120
private void processProps() {
    ElementFilter
        .fieldsIn(component.getEnclosedElements())
        .stream()
        .filter(field -> hasAnnotation(field, Prop.class))
        .forEach(field -> {
          String propName = field.getSimpleName().toString();
          Prop prop = field.getAnnotation(Prop.class);

          collectionFieldsValidator.validateComponentPropField(field);

          fieldsWithNameExposed.add(new ExposedField(propName, field.asType()));

          optionsBuilder.addStatement(
              "options.addJavaProp($S, $T.getFieldName(this, () -> this.$L = $L), $L, $S)",
              propName,
              VueGWTTools.class,
              propName,
              getFieldMarkingValueForType(field.asType()),
              prop.required(),
              prop.checkType() ? getNativeNameForJavaType(field.asType()) : null
          );
        });
  }
629783
@Override
    public void setValue(org.openprovenance.prov.model.LangString value) {
        this.value = value;
    }
267844
function handleConnected(p_ComponentInstance, p_Properties) {
	ensureQuickAccess(p_ComponentInstance);
	if (p_Properties) {
		const originalValues = {};

		Object.keys(p_Properties).forEach((p_PropertyKey) => {
			const property = p_Properties[p_PropertyKey];
			const attributeName = camelCaseToDashes(p_PropertyKey);

			originalValues[p_PropertyKey] = p_ComponentInstance[p_PropertyKey];

			Object.defineProperty(p_ComponentInstance, p_PropertyKey, {
				get() { return p_ComponentInstance._properties[p_PropertyKey]; },
				set(p_Value) {
					const oldValue = p_ComponentInstance._properties[p_PropertyKey];
					let toAttribute = (p_ConvertValue) => p_ConvertValue.toString();
					switch (property.type) {
						case Array: p_ComponentInstance._properties[p_PropertyKey] = (typeof p_Value === 'string') ? JSON.parse(p_Value) : Array.isArray(p_Value) ? p_Value : []; toAttribute = (p_ConvertValue) => JSON.stringify(p_ConvertValue); break;
						case Boolean: p_ComponentInstance._properties[p_PropertyKey] = p_Value && p_Value !== 'false'; toAttribute = () => ''; break;
						case Number: p_ComponentInstance._properties[p_PropertyKey] = ((p_Value === undefined) ? 0 : Number(p_Value)) || 0; break;
						case Object: p_ComponentInstance._properties[p_PropertyKey] = (typeof p_Value === 'string') ? JSON.parse(p_Value) : (typeof p_Value === 'object') ? p_Value : {}; toAttribute = (p_ConvertValue) => JSON.stringify(p_ConvertValue); break;
						case String: p_ComponentInstance._properties[p_PropertyKey] = ((p_Value === undefined || p_Value === null) ? '' : String(p_Value)) || ''; break;
					}
					if (property.observer) {
						if (typeof property.observer === 'function') {
							if (oldValue !== p_ComponentInstance._properties[p_PropertyKey]) {
								property.observer(p_ComponentInstance, p_ComponentInstance._properties[p_PropertyKey], oldValue);
							}
						} else if (p_ComponentInstance[property.observer]) {
							if (oldValue !== p_ComponentInstance._properties[p_PropertyKey]) {
								p_ComponentInstance[property.observer](p_ComponentInstance._properties[p_PropertyKey], oldValue);
							}
						} else {
							console.warn(`The observer with the name: '${property.observer}' was not found inside the class for web component ${p_ComponentInstance.constructor.is}. Make sure that you added a public function with the name '${property.observer}' to the class.`);
						}
					}
					if (property.reflectToAttribute) {
						if (p_ComponentInstance._properties[p_PropertyKey]) {
							p_ComponentInstance.setAttribute(attributeName, toAttribute(p_ComponentInstance._properties[p_PropertyKey]));
						} else {
							p_ComponentInstance.removeAttribute(attributeName);
						}
					}
				},
			});
		});

		Object.keys(p_Properties).forEach((p_PropertyKey) => {
			const property = p_Properties[p_PropertyKey];
			const attributeName = camelCaseToDashes(p_PropertyKey);
			let userInitialized;
			let originalValue = originalValues[p_PropertyKey] || null;

			if (originalValue) {
				switch (property.type) {
					case Array:
						if (Array.isArray(originalValue)) {
							p_ComponentInstance[p_PropertyKey] = originalValue;
						} else {
							originalValue = null;
						}
						break;
					case Boolean:
						if (typeof originalValue === 'boolean') {
							p_ComponentInstance[p_PropertyKey] = originalValue;
						} else {
							originalValue = null;
						}
						break;
					case Number:
						if (typeof originalValue === 'number') {
							p_ComponentInstance[p_PropertyKey] = originalValue;
						} else {
							originalValue = null;
						}
						break;
					case Object:
						if (typeof originalValue === 'object') {
							p_ComponentInstance[p_PropertyKey] = originalValue;
						} else {
							originalValue = null;
						}
						break;
					case String:
						if (typeof originalValue === 'string') {
							p_ComponentInstance[p_PropertyKey] = originalValue;
						} else {
							originalValue = null;
						}
						break;
				}
			}

			/* if (originalValue === null)  { */
			if (p_ComponentInstance.hasAttribute(attributeName)) {
				userInitialized = p_ComponentInstance.getAttribute(attributeName);
			}

			if (property.reflectToAttribute || p_ComponentInstance[p_PropertyKey] === undefined) {
				// use the user specified value if it was specified
				if (userInitialized !== undefined) {
					switch (property.type) {
						case Array:
							p_ComponentInstance[p_PropertyKey] = JSON.parse(userInitialized);
							break;
						case Boolean:
							p_ComponentInstance[p_PropertyKey] = userInitialized !== 'false';
							break;
						case Number:
							p_ComponentInstance[p_PropertyKey] = Number(userInitialized);
							break;
						case Object:
							p_ComponentInstance[p_PropertyKey] = JSON.parse(userInitialized);
							break;
						case String:
							p_ComponentInstance[p_PropertyKey] = String(userInitialized);
							break;
					}
				} else { // use the default value
					switch (property.type) {
						case Array:
							p_ComponentInstance[p_PropertyKey] = property.value || [];
							break;
						case Boolean:
							p_ComponentInstance[p_PropertyKey] = property.value || false;
							break;
						case Number:
							p_ComponentInstance[p_PropertyKey] = property.value || 0;
							break;
						case Object:
							p_ComponentInstance[p_PropertyKey] = property.value || {};
							break;
						case String:
							p_ComponentInstance[p_PropertyKey] = property.value || '';
							break;
					}
				}
			}
			// }
		});
	}
}
397846
private void setValue(Element element, String attrName, Object pojo,
                          CustomPropertyDescriptor field) {
        XmlNode attrXmlNode = field.getAnnotation(XmlNode.class);
        log.debug("要赋值的fieldName为{}", field.getName());
        final XmlTypeConvert convert = XmlTypeConverterUtil.resolve(attrXmlNode, field);
        if (!BeanUtils.setProperty(pojo, field.getName(), convert.read(element, attrName))) {
            log.debug("copy中复制{}时发生错误，属性[{}]的值将被忽略", field.getName(), field.getName());
        }
    }
834468
private _ValueReferenceWrapper getValueReference(
            final ValueExpression valueExpression, final FacesContext context)
    {
        ELContext elCtx = context.getELContext();
        if (_ExternalSpecifications.isUnifiedELAvailable())
        {
            // unified el 2.2 is available --> we can use ValueExpression.getValueReference()
            // we can't access ValueExpression.getValueReference() directly here, because
            // Class loading would fail in applications with el-api versions prior to 2.2
            _ValueReferenceWrapper wrapper = _BeanValidatorUELUtils.getUELValueReferenceWrapper(valueExpression, elCtx);
            if (wrapper != null)
            {
                if (wrapper.getProperty() == null)
                {
                    // Fix for issue in Glassfish EL-impl-2.2.3
                    if (firstValueReferenceWarning && log.isLoggable(Level.WARNING))
                    {
                        firstValueReferenceWarning = false;
                        log.warning("ValueReference.getProperty() is null. " +
                                    "Falling back to classic ValueReference resolving. " +
                                    "This fallback may hurt performance. " +
                                    "This may be caused by a bug your EL implementation. " +
                                    "Glassfish EL-impl-2.2.3 is known for this issue. " +
                                    "Try switching to a different EL implementation.");
                    }
                }
                else
                {
                    return wrapper;
                }
            }
        }

        // get base object and property name the "old-fashioned" way
        return _ValueReferenceResolver.resolve(valueExpression, elCtx);
    }
493157
function defaultElementPropHandler(el, value, name) {
    var propName = HTML_ATTR_PROP_MAP[name] || name;
    value = value == null ? '' : value;
    // input 的 type 是个特殊属性，其实也应该用 setAttribute
    // 但是 type 不应该运行时动态改变，否则会有兼容性问题
    // 所以这里直接就不管了
    if (propName in el) {
        el[propName] = value;
    }
    else {
        el.setAttribute(name, value);
    }

    // attribute 绑定的是 text，所以不会出现 null 的情况，这里无需处理
    // 换句话来说，san 是做不到 attribute 时有时无的
    // if (value == null) {
    //     el.removeAttribute(name);
    // }
}
1144046
public static Class<?> getValueType(FacesContext context, UIComponent comp) {
		ValueExpression expr = comp.getValueExpression("value");
		Class<?> valueType = expr == null ? null : expr.getType(context.getELContext());
		return valueType;
	}
822980
function validateProps(element, props) {
  // TODO (yungsters): Remove support for `selected` in <option>.
  {
    if (props.selected != null && !didWarnSelectedSetOnOption) {
      warning(false, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');
      didWarnSelectedSetOnOption = true;
    }
  }
}
60655
public void retrieveValue()
    {
        BaseField field = this.getOwner();
        RecordOwner recordOwner = field.getRecord().getRecordOwner();
        if (recordOwner instanceof ComponentParent)
        {
            String strValue = recordOwner.getProperty(field.getFieldName());
            if (strValue != null)
            {
                boolean[] rgbEnabled = field.setEnableListeners(false);
                field.setString(strValue, DBConstants.DISPLAY, DBConstants.INIT_MOVE);
                field.setEnableListeners(rgbEnabled);
            }
            m_recordOwnerCache = (ComponentParent)recordOwner;
        }
    }
768409
private void valueProviderToBean(ValueProvider<String> valueProvider, Object bean) {
		if (null == valueProvider) {
			return;
		}

		final CopyOptions copyOptions = this.copyOptions;
		Class<?> actualEditable = bean.getClass();
		if (copyOptions.editable != null) {
			// 检查限制类是否为target的父类或接口
			if (false == copyOptions.editable.isInstance(bean)) {
				throw new IllegalArgumentException(StrUtil.format("Target class [{}] not assignable to Editable class [{}]", bean.getClass().getName(), copyOptions.editable.getName()));
			}
			actualEditable = copyOptions.editable;
		}
		final HashSet<String> ignoreSet = (null != copyOptions.ignoreProperties) ? CollUtil.newHashSet(copyOptions.ignoreProperties) : null;
		final Map<String, String> fieldReverseMapping = copyOptions.getReversedMapping();

		final Collection<PropDesc> props = BeanUtil.getBeanDesc(actualEditable).getProps();
		String fieldName;
		Object value;
		Method setterMethod;
		Class<?> propClass;
		for (PropDesc prop : props) {
			// 获取值
			fieldName = prop.getFieldName();
			if (CollUtil.contains(ignoreSet, fieldName)) {
				// 目标属性值被忽略或值提供者无此key时跳过
				continue;
			}
			final String providerKey = mappingKey(fieldReverseMapping, fieldName);
			if (false == valueProvider.containsKey(providerKey)) {
				// 无对应值可提供
				continue;
			}
			setterMethod = prop.getSetter();
			if (null == setterMethod) {
				// Setter方法不存在跳过
				continue;
			}

			Type firstParamType = TypeUtil.getFirstParamType(setterMethod);
			if (firstParamType instanceof ParameterizedType) {
				// 参数为泛型参数类型，解析对应泛型类型为真实类型
				ParameterizedType tmp = (ParameterizedType) firstParamType;
				Type[] actualTypeArguments = tmp.getActualTypeArguments();
				if (TypeUtil.hasTypeVeriable(actualTypeArguments)) {
					// 泛型对象中含有未被转换的泛型变量
					actualTypeArguments = TypeUtil.getActualTypes(this.destType, setterMethod.getDeclaringClass(), tmp.getActualTypeArguments());
					if (ArrayUtil.isNotEmpty(actualTypeArguments)) {
						// 替换泛型变量为实际类型
						firstParamType = new ParameterizedTypeImpl(actualTypeArguments, tmp.getOwnerType(), tmp.getRawType());
					}
				}
			} else if (firstParamType instanceof TypeVariable) {
				// 参数为泛型，查找其真实类型（适用于泛型方法定义于泛型父类）
				firstParamType = TypeUtil.getActualType(this.destType, setterMethod.getDeclaringClass(), (TypeVariable<?>) firstParamType);
			}

			value = valueProvider.value(providerKey, firstParamType);
			if (null == value && copyOptions.ignoreNullValue) {
				continue;// 当允许跳过空时，跳过
			}
			if (bean.equals(value)) {
				continue;// 值不能为bean本身，防止循环引用
			}

			try {
				// valueProvider在没有对值做转换且当类型不匹配的时候，执行默认转换
				propClass = prop.getFieldClass();
				if (false == propClass.isInstance(value)) {
					value = Convert.convert(propClass, value);
					if (null == value && copyOptions.ignoreNullValue) {
						continue;// 当允许跳过空时，跳过
					}
				}

				// 执行set方法注入值
				setterMethod.invoke(bean, value);
			} catch (Exception e) {
				if (copyOptions.ignoreError) {
					continue;// 忽略注入失败
				} else {
					throw new UtilException(e, "Inject [{}] error!", prop.getFieldName());
				}
			}
		}
	}
969213
@SuppressWarnings("unchecked")
    public static <T> T getPropValue(final Object entity, final Method propGetMethod) {
        try {
            return (T) propGetMethod.invoke(entity);
        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
            throw N.toRuntimeException(e);
        }
    }
492705
public void setValueEntity(I_CmsEntityRenderer renderer, CmsEntity value) {

        if (m_hasValue) {
            throw new RuntimeException("Value has already been set");
        }
        m_hasValue = true;
        m_isSimpleValue = false;
        FlowPanel entityPanel = new FlowPanel();
        m_widgetHolder.add(entityPanel);
        int index = getValueIndex();
        m_handler.ensureHandlers(index);
        renderer.renderForm(value, entityPanel, m_handler, index);
        removeStyleName(formCss().emptyValue());
    }
289365
function (name, value) {
    if (DOMProperty.isReservedProp(name)) {
      return false;
    }
    if ((name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
      return false;
    }
    if (value === null) {
      return true;
    }
    switch (typeof value) {
      case 'boolean':
        return DOMProperty.shouldAttributeAcceptBooleanValue(name);
      case 'undefined':
      case 'number':
      case 'string':
      case 'object':
        return true;
      default:
        // function, symbol
        return false;
    }
  }
604842
public static void setPropValue(final Object entity, final String propName, final Object propValue) {
        setPropValue(entity, propName, propValue, false);
    }
1060329
public static boolean hasValue(InputComponent<?, ?> input)
   {
      boolean ret;
      Object value = InputComponents.getValueFor(input);
      if (value == null)
      {
         ret = false;
      }
      else if (value instanceof String && value.toString().isEmpty())
      {
         ret = false;
      }
      else if (!input.getValueType().isInstance(value) && value instanceof Iterable
               && !((Iterable) value).iterator().hasNext())
      {
         ret = false;
      }
      else
      {
         ret = true;
      }
      return ret;
   }
535069
private void setType(UIComponent component, String type) {
		Method method;
		try {
			method = component.getClass().getMethod("getType");
			if (null != method) {
				Object invoke = method.invoke(component);
				if (invoke != null) {
					// is it an PrimeFaces component?
					if (component.getClass().getName().equals("org.primefaces.component.inputtext.InputText")) {
						if (!"text".equals(invoke)) {
							// the programmer has explicitly assigned a type
							return;
						}
					}
					else return;
				}
			}
			
			method = component.getClass().getMethod("setType", String.class);
			if (null != method) {
				method.invoke(component, type);
				return;
			}
		} catch (ReflectiveOperationException e) {
			// catch block required by compiler, can't happen in reality
		}
		if (null == component.getAttributes().get("type") && null == component.getPassThroughAttributes().get("type")) {
			component.getPassThroughAttributes().put("type", type);
		}
	}