2014/1/23 Eric Chow <[email protected]>

> Hello,
>
> Is it possible to reset all the properties to the new instance default
> value?
>

What do you mean by default values? The values that get assigned during
construction of the object? You could use:

MyBean beanToReset = ...;
BeanUtils.copyProperties(beanToReset, new MyBean());

keep in mind that there are some restrictions when copying properties. See
the JavaDoc of BeanUtilsBean.copyProperties [1]

HTH,
Benedikt

[1]
http://commons.apache.org/proper/commons-beanutils/javadocs/v1.9.1/apidocs/org/apache/commons/beanutils/BeanUtilsBean.html<http://commons.apache.org/proper/commons-beanutils/javadocs/v1.9.1/apidocs/org/apache/commons/beanutils/BeanUtilsBean.html#copyProperties(java.lang.Object>

>
> Best regards,
> Eric
>



-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Reply via email to