当前位置: 首页>>代码示例>>Java>>正文


Java BeanUtil.setDeclaredProperty方法代码示例

本文整理汇总了Java中jodd.bean.BeanUtil.setDeclaredProperty方法的典型用法代码示例。如果您正苦于以下问题:Java BeanUtil.setDeclaredProperty方法的具体用法?Java BeanUtil.setDeclaredProperty怎么用?Java BeanUtil.setDeclaredProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jodd.bean.BeanUtil的用法示例。


在下文中一共展示了BeanUtil.setDeclaredProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: instanceFirstInit

import jodd.bean.BeanUtil; //导入方法依赖的package包/类
public static <T extends Object> T instanceFirstInit(final Class<T> klass) {
  try {
    T _xblockexpression = null;
    {
      final T instance = klass.newInstance();
      Field[] _declaredFields = klass.getDeclaredFields();
      final Consumer<Field> _function = (Field field) -> {
        String _name = field.getName();
        String _name_1 = field.getName();
        Object _firstInitFrom = MockHelper.firstInitFrom(_name_1);
        BeanUtil.setDeclaredProperty(instance, _name, _firstInitFrom);
      };
      ((List<Field>)Conversions.doWrapArray(_declaredFields)).forEach(_function);
      _xblockexpression = instance;
    }
    return _xblockexpression;
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:East196,项目名称:maker,代码行数:21,代码来源:MockHelper.java

示例2: instanceSecondInit

import jodd.bean.BeanUtil; //导入方法依赖的package包/类
public static <T extends Object> T instanceSecondInit(final T instance) {
  T _xblockexpression = null;
  {
    Class<?> _class = instance.getClass();
    Field[] _declaredFields = _class.getDeclaredFields();
    final Consumer<Field> _function = (Field field) -> {
      String _name = field.getName();
      String _name_1 = field.getName();
      Object _secondInitFrom = MockHelper.secondInitFrom(_name_1, instance);
      BeanUtil.setDeclaredProperty(instance, _name, _secondInitFrom);
    };
    ((List<Field>)Conversions.doWrapArray(_declaredFields)).forEach(_function);
    _xblockexpression = instance;
  }
  return _xblockexpression;
}
 
开发者ID:East196,项目名称:maker,代码行数:17,代码来源:MockHelper.java

示例3: getHystrixThreadPoolPropertiesSetter

import jodd.bean.BeanUtil; //导入方法依赖的package包/类
private HystrixThreadPoolProperties.Setter getHystrixThreadPoolPropertiesSetter(
		com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand hystrixCommand) {
	HystrixThreadPoolProperties.Setter commandPropertiesDefaults = HystrixThreadPoolProperties.defaultSetter();

	if (hystrixCommand.threadPoolProperties() == null || hystrixCommand.threadPoolProperties().length == 0) {
		return commandPropertiesDefaults;
	}
	Map<String, Object> commandProperties = new HashMap<String, Object>();
	for (HystrixProperty commandProperty : hystrixCommand.threadPoolProperties()) {
		commandProperties.put(commandProperty.name(), commandProperty.value());
			BeanUtil.setDeclaredProperty(commandPropertiesDefaults, commandProperty.name(),
					commandProperty.value());
	}
	return commandPropertiesDefaults;
}
 
开发者ID:xiaomin0322,项目名称:spring-integration-hystrix,代码行数:16,代码来源:HystrixCommandAspect.java


注:本文中的jodd.bean.BeanUtil.setDeclaredProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。