Adds one instance of {@link ModelFieldBean} to the internal collection of fields

@param bean instance of {@link ModelFieldBean}
352407
public void addField(ModelFieldBean bean) {
		Assert.notNull(bean, "ModelFieldBean must not be null");

		this.fields.put(bean.getName(), bean);
	}
618801
private void populateMap(Object bean) {
		final Collection<PropDesc> props = BeanUtil.getBeanDesc(bean.getClass()).getProps();

		Method getter;
		Object value;
		for (PropDesc prop : props) {
			// 得到property对应的getter方法
			getter = prop.getGetter();
			if (null == getter) {
				// 无Getter跳过
				continue;
			}

			// 只读取有getter方法的属性
			try {
				value = getter.invoke(bean);
			} catch (Exception ignore) {
				// 忽略读取失败的属性
				continue;
			}

			if (ObjectUtil.isNull(value) && this.config.isIgnoreNullValue()) {
				// 值为null且用户定义跳过则跳过
				continue;
			}

			if (value != bean) {
				// 防止循环引用
				this.rawHashMap.put(prop.getFieldName(), JSONUtil.wrap(value, this.config.isIgnoreNullValue()));
			}
		}
	}
795463
@SuppressWarnings("unchecked")
	@Override
	public T paramBean(final Object bean) {
		if (bean != null) {
			BeanAccessor.fields(bean.getClass()).stream()
					.forEach(f -> param(f.getName(), BeanAccessor.value(f, bean)));
		}
		return (T) this;
	}
1083052
public static void validate(@NotNull Object bean) {
        Assert.notNull(bean, "bean不能为null");
        Set<ConstraintViolation<Object>> constraintViolations = validator.validate(bean);
        check(constraintViolations);
    }
134321
public void setEnterpriseBean(Object bean) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "setEnterpriseBean : " + Util.identity(bean));
        ivEjbInstance = bean;
    }
1056193
@Override
    public <T> T addBean(Class<T> type) {
        Bean    beanAnnotation = type.getAnnotation(Bean.class);
        boolean isSingleton    = null == beanAnnotation || beanAnnotation.singleton();
        if (isSingleton) {
            Object bean = put(type, true);
            return type.cast(bean);
        }
        return null;
    }
856974
public static Map<String, Object> getBeanProperties(Object bean) {
        Map<String, Object> props = new HashMap<>();

        if (bean == null) {
            return props;
        }

        Class<?> clazz = bean.getClass();
        try {
            //Public fields:
            Field[] fields = clazz.getFields();
            for (Field field : fields) {
                String name = field.getName();
                if (!name.equals("class")) {
                    props.put(field.getName(), field.get(bean));
                }
            }

            //Getters:
            BeanInfo info = Introspector.getBeanInfo(clazz);
            for (PropertyDescriptor desc : info.getPropertyDescriptors()) {
                Method readMethod = desc.getReadMethod();
                String name = desc.getName();
                if (readMethod != null && !name.equals("class")) {
                    props.put(desc.getName(), readMethod.invoke(bean));
                }
            }

            return props;
        } catch (IntrospectionException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
            throw new UniformException("Error while getting bean object properties of class" + clazz.getName(), ex);
        }
    }
924030
public void setProperties(Object bean, Map map) {
        checkInitalised();
        for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) {
            Map.Entry entry = (Map.Entry) iter.next();
            String key = entry.getKey().toString();

            Object value = entry.getValue();
            setProperty(bean, key, value);
        }
    }
560520
private <T> T getReference(final Bean<T> bean) {
        T ret = (T) beanReferences.get(bean);

        if (null != ret) {
            return ret;
        }

        ret = bean.create();

        if (null != ret) {
            beanReferences.put(bean, ret);

            return ret;
        }

        throw new RuntimeException("Can't create reference for bean [" + bean + "]");
    }
872098
public void setBean(String name, Object object) {
		Bean bean = beans.get(name);
		if (null == bean) {
			bean = new Bean();
			beans.put(name, bean);
		}
		bean.object = object;
	}
1305810
public T executeFrom(Object bean) {
    List<T> executeFromCollectionResult = executeFrom(Collections.singleton(bean));
    if (CollectionUtils.isEmpty(executeFromCollectionResult)) {
      return null;
    } else {
      return executeFromCollectionResult.get(0);
    }
  }
957711
@SuppressWarnings({ "unchecked", "rawtypes" })
	public static void setFieldValue(Object bean, String fieldNameOrIndex, Object value) {
		if (bean instanceof Map) {
			((Map) bean).put(fieldNameOrIndex, value);
		} else if (bean instanceof List) {
			CollUtil.setOrAppend((List) bean, Convert.toInt(fieldNameOrIndex), value);
		} else if (ArrayUtil.isArray(bean)) {
			ArrayUtil.setOrAppend(bean, Convert.toInt(fieldNameOrIndex), value);
		} else {
			// 普通Bean对象
			ReflectUtil.setFieldValue(bean, fieldNameOrIndex, value);
		}
	}
1049574
public function append($bean)
	{
		$this->validate($bean);
		parent::offsetSet($bean->getIndex(), $bean);
		$this->rewind();
	}
696839
@Override
	public void setBean(final Object bean) {
		BeanAndProviderBoundComponentModel model = getOrCreateComponentModel();
		model.setBean(bean);

		if (getBeanProperty() == null) {
			setBeanProperty(".");
		}
		// Remove values in scratch map
		removeBeanFromScratchMap();
	}
1333879
protected void addPropertyReferenceFromElement(String id, Element element, BeanDefinitionBuilder bean) {
        String beanElement = element.getAttribute(id);
        bean.addPropertyReference(id, beanElement);
    }
289745
@Override
    public void merge(Collection<Bean> beans) throws AbortRuntimeException {
        init();
        Map<HBeanRow, HBeanRow> providedRows = new HashMap<>();
        for (Bean bean : beans) {
            HBeanRow row = new HBeanRow(bean, uids);
            providedRows.put(row, row);
            for (BeanId id : bean.getReferences()) {
                HBeanRow refRow = new HBeanRow(id, uids);
                providedRows.put(refRow, refRow);
            }
        }
        HBeanRowCollector storedCollector = null;
        try {
            storedCollector = table.getEager(providedRows);
        } catch (HBeanNotFoundException e) {
            // only throw exception if the bean was not provided
            if (!idsFoundIn(beans, e)) {
                throw Events.CFG301_MISSING_RUNTIME_REF(e.getNotFound().iterator().next());
            }
        }

        Map<HBeanRow, HBeanRow> storedRows = storedCollector.getRowMap();
        Set<RowMutations> mutations = new HashSet<>();

        for (HBeanRow provided : providedRows.keySet()) {
            HBeanRow stored = storedRows.get(provided);
            RowMutations rowMutations = new RowMutations(provided.getRowKey());
            Set<HBeanRow> deleteReferences = stored.merge(provided, rowMutations);
            try {
                deleteReferences = table.getLazy(deleteReferences);
                for (HBeanRow row : deleteReferences) {
                    RowMutations mutation = row.removePredecessor(provided);
                    mutations.add(mutation);
                }
            } catch (HBeanNotFoundException e) {
                throw new IllegalStateException("Broken predecessors");
            }
            mutations.add(rowMutations);
        }
        table.mutate(mutations);
    }
284049
public void registerSingleton(String name, Class<?> clazz) throws BeansException {
        GenericBeanDefinition bd = new GenericBeanDefinition();
        bd.setBeanClass(clazz);
        getDefaultListableBeanFactory().registerBeanDefinition(name, bd);
    }