org.apache.commons.beanutils.WrapDynaBean Java Examples
The following examples show how to use
org.apache.commons.beanutils.WrapDynaBean.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BeanHelper.java From commons-configuration with Apache License 2.0 | 5 votes |
/** * Creates a {@code DynaBean} instance which wraps the passed in bean. * * @param bean the bean to be wrapped (must not be <b>null</b>) * @return a {@code DynaBean} wrapping the passed in bean * @throws IllegalArgumentException if the bean is <b>null</b> * @since 2.0 */ public static DynaBean createWrapDynaBean(final Object bean) { if (bean == null) { throw new IllegalArgumentException("Bean must not be null!"); } final WrapDynaClass dynaClass = WrapDynaClass.createDynaClass(bean.getClass(), BEAN_UTILS_BEAN.getPropertyUtils()); return new WrapDynaBean(bean, dynaClass); }
Example #2
Source File: DynaBeanModelTest.java From commons-jxpath with Apache License 2.0 | 4 votes |
protected Object createContextBean() { return new WrapDynaBean(new TestBean()); }